diff --git a/data/interfaces/default/artistredone.html b/data/interfaces/default/artistredone.html index 134bed01..5a32ef9e 100755 --- a/data/interfaces/default/artistredone.html +++ b/data/interfaces/default/artistredone.html @@ -88,7 +88,11 @@
- +
@@ -258,10 +262,10 @@ %if issue['Status'] == 'Skipped': %elif (issue['Status'] == 'Wanted'): - + %elif (issue['Status'] == 'Snatched'): - + %else: %if issue['inCacheDIR']: <% @@ -279,7 +283,7 @@ %endif - + %endif diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index fd3b13e9..37814e06 100755 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -198,7 +198,7 @@ Usenet
- +
@@ -497,8 +497,68 @@
+
- +

Notifications

+
+

Prowl

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

NotifyMyAndroid

+
+ +
+
+
+
+ +
+ + + Separate multiple api keys with commas +
+
+ + +
+
+
@@ -539,6 +599,48 @@ function initThisPage() { + + if ($("#prowl").is(":checked")) + { + $("#prowloptions").show(); + } + else + { + $("#prowloptions").hide(); + } + + $("#prowl").click(function(){ + if ($("#prowl").is(":checked")) + { + $("#prowloptions").slideDown(); + } + else + { + $("#prowloptions").slideUp(); + } + }); + + if ($("#nma").is(":checked")) + { + $("#nmaoptions").show(); + } + else + { + $("#nmaoptions").hide(); + } + + $("#nma").click(function(){ + if ($("#nma").is(":checked")) + { + $("#nmaoptions").slideDown(); + } + else + { + $("#nmaoptions").slideUp(); + } + }); + + var deletedNewznabs = 0; $(".remove").click(function() { @@ -567,6 +669,7 @@ }); initActions(); initConfigCheckbox("#launch_browser"); + initConfigCheckbox("#useblackhole"); initConfigCheckbox("#usenewznab"); initConfigCheckbox("#usenzbsu"); initConfigCheckbox("#usedognzb"); diff --git a/data/interfaces/default/upcoming.html b/data/interfaces/default/upcoming.html index 7839ebbe..af452a3d 100755 --- a/data/interfaces/default/upcoming.html +++ b/data/interfaces/default/upcoming.html @@ -38,7 +38,7 @@ %for issue in issues: - ${issue['ComicName']} + ${issue['ComicName']} ${issue['Issue_Number']} ${issue['IssueDate']} diff --git a/mylar/PostProcessor.py b/mylar/PostProcessor.py index 3e5a8fa6..7b43ea8f 100755 --- a/mylar/PostProcessor.py +++ b/mylar/PostProcessor.py @@ -27,7 +27,7 @@ import urllib2 import sqlite3 from xml.dom.minidom import parseString -from mylar import logger, db, helpers, updater +from mylar import logger, db, helpers, updater, notifiers class PostProcessor(object): """ @@ -375,6 +375,16 @@ class PostProcessor(object): logger.info(u"Post-Processing completed for: " + series + " issue: " + str(issuenum) ) self._log(u"Post Processing SUCCESSFULL! ", logger.DEBUG) + if mylar.PROWL_ENABLED: + pushmessage = series + '(' + issueyear + ') - issue #' + issuenum + logger.info(u"Prowl request") + prowl = notifiers.PROWL() + prowl.notify(pushmessage,"Download and Postprocessing completed") + + if mylar.NMA_ENABLED: + nma = notifiers.NMA() + nma.notify(series, str(issueyear), str(issuenum)) + # retrieve/create the corresponding comic objects if mylar.ENABLE_EXTRA_SCRIPTS: diff --git a/mylar/__init__.py b/mylar/__init__.py index 05140fbf..cd068e20 100755 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -122,6 +122,14 @@ AUTOWANT_UPCOMING = True AUTOWANT_ALL = False COMIC_COVER_LOCAL = False ADD_TO_CSV = True +PROWL_ENABLED = True +PROWL_PRIORITY = 1 +PROWL_KEYS = None +PROWL_ONSNATCH = True +NMA_ENABLED = False +NMA_APIKEY = None +NMA_PRIORITY = None +NMA_ONSNATCH = None SKIPPED2WANTED = False CVINFO = False LOG_LEVEL = None @@ -231,6 +239,7 @@ def initialize(): NZBSU, NZBSU_APIKEY, DOGNZB, DOGNZB_APIKEY, NZBX,\ NEWZNAB, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_ENABLED, EXTRA_NEWZNABS,\ RAW, RAW_PROVIDER, RAW_USERNAME, RAW_PASSWORD, RAW_GROUPS, EXPERIMENTAL, \ + PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, NMA_ENABLED, NMA_APIKEY, NMA_PRIORITY, NMA_ONSNATCH, \ PREFERRED_QUALITY, MOVE_FILES, RENAME_FILES, LOWERCASE_FILENAMES, USE_MINSIZE, MINSIZE, USE_MAXSIZE, MAXSIZE, CORRECT_METADATA, FOLDER_FORMAT, FILE_FORMAT, REPLACE_CHAR, REPLACE_SPACES, ADD_TO_CSV, CVINFO, LOG_LEVEL, POST_PROCESSING, \ COMIC_LOCATION, QUAL_ALTVERS, QUAL_SCANNER, QUAL_TYPE, QUAL_QUALITY, ENABLE_EXTRA_SCRIPTS, EXTRA_SCRIPTS, ENABLE_PRE_SCRIPTS, PRE_SCRIPTS, PULLNEW, COUNT_ISSUES, COUNT_HAVES, COUNT_COMICS @@ -300,6 +309,17 @@ def initialize(): ZERO_LEVEL = bool(check_setting_int(CFG, 'General', 'zero_level', 0)) ZERO_LEVEL_N = check_setting_str(CFG, 'General', 'zero_level_n', '') LOWERCASE_FILENAMES = bool(check_setting_int(CFG, 'General', 'lowercase_filenames', 0)) + + PROWL_ENABLED = bool(check_setting_int(CFG, 'Prowl', 'prowl_enabled', 0)) + PROWL_KEYS = check_setting_str(CFG, 'Prowl', 'prowl_keys', '') + PROWL_ONSNATCH = bool(check_setting_int(CFG, 'Prowl', 'prowl_onsnatch', 0)) + PROWL_PRIORITY = check_setting_int(CFG, 'Prowl', 'prowl_priority', 0) + + NMA_ENABLED = bool(check_setting_int(CFG, 'NMA', 'nma_enabled', 0)) + NMA_APIKEY = check_setting_str(CFG, 'NMA', 'nma_apikey', '') + NMA_PRIORITY = check_setting_int(CFG, 'NMA', 'nma_priority', 0) + NMA_ONSNATCH = bool(check_setting_int(CFG, 'NMA', 'nma_onsnatch', 0)) + USE_MINSIZE = bool(check_setting_int(CFG, 'General', 'use_minsize', 0)) MINSIZE = check_setting_str(CFG, 'General', 'minsize', '') USE_MAXSIZE = bool(check_setting_int(CFG, 'General', 'use_maxsize', 0)) @@ -567,6 +587,7 @@ def config_write(): new_config['General']['zero_level'] = int(ZERO_LEVEL) new_config['General']['zero_level_n'] = ZERO_LEVEL_N new_config['General']['lowercase_filenames'] = LOWERCASE_FILENAMES + new_config['General']['use_minsize'] = int(USE_MINSIZE) new_config['General']['minsize'] = MINSIZE new_config['General']['use_maxsize'] = int(USE_MAXSIZE) @@ -616,6 +637,18 @@ def config_write(): new_config['Newznab']['extra_newznabs'] = flattened_newznabs + new_config['Prowl'] = {} + new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) + new_config['Prowl']['prowl_keys'] = PROWL_KEYS + new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) + new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) + + new_config['NMA'] = {} + new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) + new_config['NMA']['nma_apikey'] = NMA_APIKEY + new_config['NMA']['nma_priority'] = NMA_PRIORITY + new_config['NMA']['nma_onsnatch'] = int(PROWL_ONSNATCH) + new_config['Raw'] = {} new_config['Raw']['raw'] = int(RAW) new_config['Raw']['raw_provider'] = RAW_PROVIDER @@ -728,6 +761,14 @@ def dbcheck(): except sqlite3.OperationalError: c.execute('ALTER TABLE issues ADD COLUMN inCacheDIR TEXT') + #if it's prior to Wednesday, the issue counts will be inflated by one as the online db's everywhere + #prepare for the next 'new' release of a series. It's caught in updater.py, so let's just store the + #value in the sql so we can display it in the details screen for everyone to wonder at. + try: + c.execute('SELECT not_updated_db from comics') + except sqlite3.OperationalError: + c.execute('ALTER TABLE comics ADD COLUMN not_updated_db TEXT') + # -- not implemented just yet ;) # for metadata... diff --git a/mylar/search.py b/mylar/search.py index a733984b..fef62b2e 100755 --- a/mylar/search.py +++ b/mylar/search.py @@ -16,7 +16,7 @@ from __future__ import division import mylar -from mylar import logger, db, updater, helpers, parseit, findcomicfeed, prov_nzbx +from mylar import logger, db, updater, helpers, parseit, findcomicfeed, prov_nzbx, notifiers nzbsu_APIkey = mylar.NZBSU_APIKEY dognzb_APIkey = mylar.DOGNZB_APIKEY @@ -742,12 +742,15 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is return logger.info(u"Successfully sent nzb file to SABnzbd") - #delete the .nzb now. - #if mylar.PROG_DIR is not "/" and nzbprov != 'nzb.su': - # logger.fdebug("preparing to remove temporary nzb file at: " + str(savefile)) - # os.remove(savefile) - # logger.info(u"Removed temporary save file") - #raise an exception to break out of loop + + if mylar.PROWL_ENABLED and mylar.PROWL_ONSNATCH: + logger.info(u"Sending Prowl notification") + prowl = notifiers.PROWL() + prowl.notify(nzbname,"Download started") + if mylar.NMA_ENABLED and mylar.NMA_ONSNATCH: + logger.info(u"Sending NMA notification") + nma = notifiers.NMA() + nma.notify(snatched_nzb=nzbname) foundc = "yes" diff --git a/mylar/updater.py b/mylar/updater.py index 01e702c1..f90a0457 100755 --- a/mylar/updater.py +++ b/mylar/updater.py @@ -93,6 +93,15 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate): upco_iss = myDB.action("SELECT COUNT(*) FROM UPCOMING WHERE ComicID=?",[ComicID]).fetchone() if upco_iss > 0: print ("There is " + str(upco_iss[0]) + " of " + str(ComicName) + " that's not accounted for") + newKey = {"ComicID": ComicID} + newVal = {"not_updated_db": str(upco_iss[0])} + myDB.upsert("comics", newVal, newKey) + elif upco_iss <=0 and lastupdatecheck['not_updated_db']: + #if not_updated_db has a value, and upco_iss is > 0, let's zero it back out cause it's updated now. + newKey = {"ComicID": ComicID} + newVal - {"not_updated_db": null} + myDB.upsert("comics", newVal, newKey) + if hours > 5: pullupd = "yes" logger.fdebug("Now Refreshing comic " + str(ComicName) + " to make sure it's up-to-date") diff --git a/mylar/webserve.py b/mylar/webserve.py index b8994dbd..e3f49f8f 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -979,6 +979,14 @@ class WebInterface(object): "add_to_csv" : helpers.checked(mylar.ADD_TO_CSV), "cvinfo" : helpers.checked(mylar.CVINFO), "lowercase_filenames" : helpers.checked(mylar.LOWERCASE_FILENAMES), + "prowl_enabled": helpers.checked(mylar.PROWL_ENABLED), + "prowl_onsnatch": helpers.checked(mylar.PROWL_ONSNATCH), + "prowl_keys": mylar.PROWL_KEYS, + "prowl_priority": mylar.PROWL_PRIORITY, + "nma_enabled": helpers.checked(mylar.NMA_ENABLED), + "nma_apikey": mylar.NMA_APIKEY, + "nma_priority": int(mylar.NMA_PRIORITY), + "nma_onsnatch": helpers.checked(mylar.NMA_ONSNATCH), "enable_extra_scripts" : helpers.checked(mylar.ENABLE_EXTRA_SCRIPTS), "extra_scripts" : mylar.EXTRA_SCRIPTS, "post_processing" : helpers.checked(mylar.POST_PROCESSING), @@ -1085,6 +1093,7 @@ class WebInterface(object): sab_host=None, sab_username=None, sab_apikey=None, sab_password=None, sab_category=None, sab_priority=None, sab_directory=None, log_dir=None, log_level=0, blackhole=0, blackhole_dir=None, usenet_retention=None, nzbsu=0, nzbsu_apikey=None, dognzb=0, dognzb_apikey=None, nzbx=0, newznab=0, newznab_host=None, newznab_apikey=None, newznab_enabled=0, raw=0, raw_provider=None, raw_username=None, raw_password=None, raw_groups=None, experimental=0, + prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=None, nma_enabled=0, nma_apikey=None, nma_priority=0, nma_onsnatch=0, preferred_quality=0, move_files=0, rename_files=0, add_to_csv=1, cvinfo=0, lowercase_filenames=0, folder_format=None, file_format=None, enable_extra_scripts=0, extra_scripts=None, enable_pre_scripts=0, pre_scripts=None, post_processing=0, destination_dir=None, replace_spaces=0, replace_char=None, use_minsize=0, minsize=None, use_maxsize=0, maxsize=None, autowant_all=0, autowant_upcoming=0, comic_cover_local=0, zero_level=0, zero_level_n=None, interface=None, **kwargs): mylar.HTTP_HOST = http_host @@ -1132,6 +1141,14 @@ class WebInterface(object): mylar.ADD_TO_CSV = add_to_csv mylar.CVINFO = cvinfo mylar.LOWERCASE_FILENAMES = lowercase_filenames + mylar.PROWL_ENABLED = prowl_enabled + mylar.PROWL_ONSNATCH = prowl_onsnatch + mylar.PROWL_KEYS = prowl_keys + mylar.PROWL_PRIORITY = prowl_priority + mylar.NMA_ENABLED = nma_enabled + mylar.NMA_APIKEY = nma_apikey + mylar.NMA_PRIORITY = nma_priority + mylar.NMA_ONSNATCH = nma_onsnatch mylar.USE_MINSIZE = use_minsize mylar.MINSIZE = minsize mylar.USE_MAXSIZE = use_maxsize