Skip to content

Commit

Permalink
Force piratebay to default setting, to make it "just work" in most ca…
Browse files Browse the repository at this point in the history
…ses.
  • Loading branch information
steeve committed Dec 18, 2013
1 parent 13cb0dc commit 53b2884
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions resources/site-packages/xbmctorrent/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
tpb


@plugin.route("/")
@ensure_fanart
@tracked(force=True)
def index():
def _ensure_settings():
import os
firstrun = os.path.join(plugin.addon.getAddonInfo("path"), ".firstrun")
if not os.path.exists(firstrun):
with open(firstrun, "w"):
# This doesn't get set properly
plugin.set_setting("encryption", "1")
plugin.set_setting("base_tpb", "http://thepiratebay.org") # Properly set TPB for now
plugin.notify("Please review your settings.")
plugin.open_settings()


@plugin.route("/")
@ensure_fanart
@tracked(force=True)
def index():
_ensure_settings()

if PLATFORM["os"] not in ["android", "linux", "windows", "darwin"]:
plugin.notify("Your system \"%(os)s_%(arch)s\" is not supported." % PLATFORM, delay=15000)

Expand Down

0 comments on commit 53b2884

Please sign in to comment.