diff --git a/SickBeard.py b/SickBeard.py index b6cc16b3..1aca3fb8 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -19,12 +19,14 @@ # Check needed software dependencies to nudge users to fix their setup import sys + if sys.version_info < (2, 6): print "Sorry, requires Python 2.6 or 2.7." sys.exit(1) try: import Cheetah + if Cheetah.Version[0] != '2': raise ValueError except ValueError: @@ -35,11 +37,12 @@ except: sys.exit(1) import os + sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))) # We only need this for compiling an EXE and I will just always do that on 2.6+ if sys.hexversion >= 0x020600F0: - from multiprocessing import freeze_support # @UnresolvedImport + from multiprocessing import freeze_support # @UnresolvedImport import locale import datetime @@ -65,7 +68,8 @@ from lib.configobj import ConfigObj signal.signal(signal.SIGINT, sickbeard.sig_handler) signal.signal(signal.SIGTERM, sickbeard.sig_handler) -throwaway = datetime.datetime.strptime('20110101','%Y%m%d') +throwaway = datetime.datetime.strptime('20110101', '%Y%m%d') + def loadShowsFromDB(): """ @@ -80,10 +84,12 @@ def loadShowsFromDB(): curShow = TVShow(int(sqlShow["indexer"]), int(sqlShow["indexer_id"])) sickbeard.showList.append(curShow) except Exception, e: - logger.log(u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8'), logger.ERROR) + logger.log( + u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8'), + logger.ERROR) logger.log(traceback.format_exc(), logger.DEBUG) - # TODO: update the existing shows if the showlist has something in it + # TODO: update the existing shows if the showlist has something in it def daemonize(): @@ -101,7 +107,7 @@ def daemonize(): sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror)) sys.exit(1) - os.setsid() # @UndefinedVariable - only available in UNIX + os.setsid() # unix # Make sure I can read my own files and shut out others prev = os.umask(0) @@ -139,6 +145,7 @@ def daemonize(): os.dup2(stdout.fileno(), sys.stdout.fileno()) os.dup2(stderr.fileno(), sys.stderr.fileno()) + def main(): """ TV for me @@ -180,11 +187,23 @@ def main(): # Need console logging for SickBeard.py and SickBeard-console.exe consoleLogging = (not hasattr(sys, "frozen")) or (sickbeard.MY_NAME.lower().find('-console') > 0) + # Attempt to rename the process for easier debugging + try: + from setproctitle import setproctitle + except ImportError: + if consoleLogging: + sys.stderr.write(u"setproctitle module is not available.\n") + setproctitle = lambda t: None + + setproctitle(sickbeard.MY_NAME) + # Rename the main thread threading.currentThread().name = "MAIN" try: - opts, args = getopt.getopt(sys.argv[1:], "qfdp::", ['quiet', 'forceupdate', 'daemon', 'port=', 'pidfile=', 'nolaunch', 'config=', 'datadir=']) # @UnusedVariable + opts, args = getopt.getopt(sys.argv[1:], "qfdp::", + ['quiet', 'forceupdate', 'daemon', 'port=', 'pidfile=', 'nolaunch', 'config=', + 'datadir=']) # @UnusedVariable except getopt.GetoptError: print "Available Options: --quiet, --forceupdate, --port, --daemon, --pidfile, --config, --datadir" sys.exit() @@ -290,13 +309,17 @@ def main(): CUR_DB_VERSION = db.DBConnection().checkDBVersion() if CUR_DB_VERSION > 0: if CUR_DB_VERSION < MIN_DB_VERSION: - raise SystemExit("Your database version (" + str(db.DBConnection().checkDBVersion()) + ") is too old to migrate from with this version of SickRage (" + str(MIN_DB_VERSION) + ").\n" + \ + raise SystemExit("Your database version (" + str( + db.DBConnection().checkDBVersion()) + ") is too old to migrate from with this version of SickRage (" + str( + MIN_DB_VERSION) + ").\n" + \ "Upgrade using a previous version of SB first, or start with no database file to begin fresh.") if CUR_DB_VERSION > MAX_DB_VERSION: - raise SystemExit("Your database version (" + str(db.DBConnection().checkDBVersion()) + ") has been incremented past what this version of SickRage supports (" + str(MAX_DB_VERSION) + ").\n" + \ + raise SystemExit("Your database version (" + str( + db.DBConnection().checkDBVersion()) + ") has been incremented past what this version of SickRage supports (" + str( + MAX_DB_VERSION) + ").\n" + \ "If you have used other forks of SB, your database may be unusable due to their modifications.") - # Initialize the config and our threads + # Initialize the config and our threads sickbeard.initialize(consoleLogging=consoleLogging) sickbeard.showList = [] @@ -332,16 +355,16 @@ def main(): initWebServer({ 'port': startPort, 'host': webhost, - 'data_root': os.path.join(sickbeard.PROG_DIR, 'gui/'+sickbeard.GUI_NAME), + 'data_root': os.path.join(sickbeard.PROG_DIR, 'gui/' + sickbeard.GUI_NAME), 'web_root': sickbeard.WEB_ROOT, 'log_dir': log_dir, 'username': sickbeard.WEB_USERNAME, 'password': sickbeard.WEB_PASSWORD, 'enable_https': sickbeard.ENABLE_HTTPS, - 'handle_reverse_proxy': sickbeard.HANDLE_REVERSE_PROXY, + 'handle_reverse_proxy': sickbeard.HANDLE_REVERSE_PROXY, 'https_cert': sickbeard.HTTPS_CERT, 'https_key': sickbeard.HTTPS_KEY, - }) + }) except IOError: logger.log(u"Unable to start web server, is something else running on port %d?" % startPort, logger.ERROR) if sickbeard.LAUNCH_BROWSER and not sickbeard.DAEMON: @@ -362,7 +385,7 @@ def main(): # Start an update if we're supposed to if forceUpdate or sickbeard.UPDATE_SHOWS_ON_START: - sickbeard.showUpdateScheduler.action.run(force=True) # @UndefinedVariable + sickbeard.showUpdateScheduler.action.run(force=True) # @UndefinedVariable # Stay alive while my threads do the work while (True): diff --git a/gui/slick/css/default.css b/gui/slick/css/default.css index a1ea84ea..4b8a5b66 100644 --- a/gui/slick/css/default.css +++ b/gui/slick/css/default.css @@ -445,7 +445,8 @@ input:not(.btn){margin-right:6px;margin-top:5px;padding-top:4px;padding-bottom:4 } .sickbeardTable td.filename { -width: 30%; +width: 10%; +text-align: center; } @@ -471,6 +472,10 @@ width: 30%; .sickbeardTable td.search img { padding-right: 2px; } +.sickbeardTable td.search { + text-align: center; + width:5% +} .sickbeardTable td small { font-size: 11px; @@ -729,7 +734,7 @@ div#summary tr td { #donate a, #donate a:hover { border: 0 ; - padding: 4px 15px 4px; + padding: 8px 15px 8px; } #contentWrapper { @@ -1873,4 +1878,4 @@ pre { background: white; width: 270px; height: 220px; -} \ No newline at end of file +} diff --git a/gui/slick/images/btn-google.jpg b/gui/slick/images/btn-google.jpg new file mode 100644 index 00000000..67b8c319 Binary files /dev/null and b/gui/slick/images/btn-google.jpg differ diff --git a/gui/slick/images/paypal/btn_donateCC_LG.gif b/gui/slick/images/paypal/btn_donateCC_LG.gif deleted file mode 100644 index 2d1ec159..00000000 Binary files a/gui/slick/images/paypal/btn_donateCC_LG.gif and /dev/null differ diff --git a/gui/slick/images/paypal/btn_donate_LG.gif b/gui/slick/images/paypal/btn_donate_LG.gif deleted file mode 100644 index 43cef691..00000000 Binary files a/gui/slick/images/paypal/btn_donate_LG.gif and /dev/null differ diff --git a/gui/slick/images/providers/anidb.gif b/gui/slick/images/providers/anidb.gif new file mode 100644 index 00000000..c87ccaa3 Binary files /dev/null and b/gui/slick/images/providers/anidb.gif differ diff --git a/gui/slick/images/providers/fanzub.gif b/gui/slick/images/providers/fanzub.gif new file mode 100644 index 00000000..2a930b1b Binary files /dev/null and b/gui/slick/images/providers/fanzub.gif differ diff --git a/gui/slick/images/providers/nyaatorrents.png b/gui/slick/images/providers/nyaatorrents.png new file mode 100644 index 00000000..d122990c Binary files /dev/null and b/gui/slick/images/providers/nyaatorrents.png differ diff --git a/gui/slick/images/xem.png b/gui/slick/images/xem.png new file mode 100644 index 00000000..634def23 Binary files /dev/null and b/gui/slick/images/xem.png differ diff --git a/gui/slick/interfaces/default/comingEpisodes.tmpl b/gui/slick/interfaces/default/comingEpisodes.tmpl index 0d754156..f62df8d2 100644 --- a/gui/slick/interfaces/default/comingEpisodes.tmpl +++ b/gui/slick/interfaces/default/comingEpisodes.tmpl @@ -107,6 +107,17 @@ \$('#sbRoot').ajaxEpSearch(); + #set $fuzzydate = 'airdate' + #if $sickbeard.FUZZY_DATING: + fuzzyMoment({ + containerClass : '.${fuzzydate}', + dateHasTime : true, + dateFormat : '${sickbeard.DATE_PRESET}', + timeFormat : '${sickbeard.TIME_PRESET}', + trimZero : #if $sickbeard.TRIM_ZERO then "true" else "false"# + }); + #end if + }); //--> @@ -146,7 +157,8 @@ - $sbdatetime.sbdatetime.sbfdatetime($cur_result["localtime"]).decode($sickbeard.SYS_ENCODING)$time.mktime($cur_result["localtime"].timetuple()) + ## forced to use a div to wrap airdate, the column sort went crazy with a span +
$sbdatetime.sbdatetime.sbfdatetime($cur_result["localtime"]).decode($sickbeard.SYS_ENCODING)
$time.mktime($cur_result["localtime"].timetuple()) $cur_result["show_name"] #if int($cur_result["paused"]): [paused] @@ -212,7 +224,7 @@ #set $show_div = "ep_listing listing_default" #if $sort == "show": -

+

#end if #for $cur_result in $sql_results: diff --git a/gui/slick/interfaces/default/config_anime.tmpl b/gui/slick/interfaces/default/config_anime.tmpl new file mode 100644 index 00000000..3b42550e --- /dev/null +++ b/gui/slick/interfaces/default/config_anime.tmpl @@ -0,0 +1,102 @@ +#import sickbeard +#set global $title="Config - Anime" +#set global $header="Anime" + +#set global $sbPath="../.." + +#set global $topmenu="config"# +#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl") + + + +#if $varExists('header') +

$header

+#else +

$title

+#end if +
+
+ +
+ +
+ +
+
+

AniDB AniDB

+

AniDB is non-profit database of anime information that is freely open to the public

+
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + +
+
+ + +
+
+ +
+ +
+
+ +
+

Look and Feel

+
+
+
+ + +
+ +
+
+

+ +
+ +
+ + +
+
+ +#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_bottom.tmpl") diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl index 82128d6d..59c3359c 100644 --- a/gui/slick/interfaces/default/config_general.tmpl +++ b/gui/slick/interfaces/default/config_general.tmpl @@ -48,7 +48,7 @@

Some options may require a manual restart to take effect.

-
+
@@ -124,7 +124,7 @@
-
+
+
@@ -288,7 +296,7 @@ @@ -318,11 +326,11 @@ @@ -330,7 +338,7 @@ @@ -359,25 +367,52 @@

Date and Time

-
+
+ +
+ + +
+
+
+ + +
+
+ +
+ + diff --git a/gui/slick/interfaces/default/config_notifications.tmpl b/gui/slick/interfaces/default/config_notifications.tmpl index 3e99a027..a67adfbb 100644 --- a/gui/slick/interfaces/default/config_notifications.tmpl +++ b/gui/slick/interfaces/default/config_notifications.tmpl @@ -19,9 +19,9 @@
@@ -381,7 +381,8 @@
-

Synology Indexer

+

Synology

+

The Synology DiskStation NAS.

Synology Indexer is the daemon running on the Synology NAS to build its media database.

@@ -390,7 +391,7 @@
diff --git a/gui/slick/interfaces/default/config_postProcessing.tmpl b/gui/slick/interfaces/default/config_postProcessing.tmpl index 39522cf5..bca4ef90 100644 --- a/gui/slick/interfaces/default/config_postProcessing.tmpl +++ b/gui/slick/interfaces/default/config_postProcessing.tmpl @@ -423,7 +423,7 @@ Show.Name.S02E03.HDTV.XviD-RLSGROUP - Release Group: + Release Group: %RG RLSGROUP @@ -467,6 +467,42 @@
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+
#end if diff --git a/gui/slick/interfaces/default/config_search.tmpl b/gui/slick/interfaces/default/config_search.tmpl index ef15e363..513d0316 100644 --- a/gui/slick/interfaces/default/config_search.tmpl +++ b/gui/slick/interfaces/default/config_search.tmpl @@ -457,7 +457,8 @@
diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index d6e3e8be..103b07b9 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -22,17 +22,54 @@ + - +