diff --git a/data/interfaces/default/comicdetails.html b/data/interfaces/default/comicdetails.html index 1d0c8936..ea240045 100755 --- a/data/interfaces/default/comicdetails.html +++ b/data/interfaces/default/comicdetails.html @@ -319,6 +319,7 @@ + %if mylar.FAILED_DOWNLOAD_HANDLING: %endif diff --git a/mylar/__init__.py b/mylar/__init__.py index ff11da9c..4d8346e5 100755 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -152,6 +152,7 @@ ZERO_LEVEL = False ZERO_LEVEL_N = None LOWERCASE_FILENAME = False IGNORE_HAVETOTAL = False +SNATCHED_HAVETOTAL = False USE_MINSIZE = False MINSIZE = 10 USE_MAXSIZE = False @@ -368,7 +369,7 @@ def initialize(): USE_NZBGET, NZBGET_HOST, NZBGET_PORT, NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, NZBGET_DIRECTORY, NZBSU, NZBSU_UID, NZBSU_APIKEY, DOGNZB, DOGNZB_UID, DOGNZB_APIKEY, \ NEWZNAB, NEWZNAB_NAME, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_UID, NEWZNAB_ENABLED, EXTRA_NEWZNABS, NEWZNAB_EXTRA, \ RAW, RAW_PROVIDER, RAW_USERNAME, RAW_PASSWORD, RAW_GROUPS, EXPERIMENTAL, ALTEXPERIMENTAL, \ - ENABLE_META, CMTAGGER_PATH, CT_TAG_CR, CT_TAG_CBL, CT_CBZ_OVERWRITE, UNRAR_CMD, INDIE_PUB, BIGGIE_PUB, IGNORE_HAVETOTAL, PROVIDER_ORDER, \ + ENABLE_META, CMTAGGER_PATH, CT_TAG_CR, CT_TAG_CBL, CT_CBZ_OVERWRITE, UNRAR_CMD, INDIE_PUB, BIGGIE_PUB, IGNORE_HAVETOTAL, SNATCHED_HAVETOTAL, PROVIDER_ORDER, \ dbUpdateScheduler, searchScheduler, RSSScheduler, WeeklyScheduler, VersionScheduler, FolderMonitorScheduler, \ ENABLE_TORRENTS, MINSEEDS, TORRENT_LOCAL, LOCAL_WATCHDIR, TORRENT_SEEDBOX, SEEDBOX_HOST, SEEDBOX_PORT, SEEDBOX_USER, SEEDBOX_PASS, SEEDBOX_WATCHDIR, \ ENABLE_RSS, RSS_CHECKINTERVAL, RSS_LASTRUN, FAILED_DOWNLOAD_HANDLING, FAILED_AUTO, ENABLE_TORRENT_SEARCH, ENABLE_KAT, KAT_PROXY, ENABLE_CBT, CBT_PASSKEY, SNATCHEDTORRENT_NOTIFY, \ @@ -468,6 +469,7 @@ def initialize(): ZERO_LEVEL_N = check_setting_str(CFG, 'General', 'zero_level_n', '') LOWERCASE_FILENAMES = bool(check_setting_int(CFG, 'General', 'lowercase_filenames', 0)) IGNORE_HAVETOTAL = bool(check_setting_int(CFG, 'General', 'ignore_havetotal', 0)) + SNATCHED_HAVETOTAL = bool(check_setting_int(CFG, 'General', 'snatched_havetotal', 0)) SYNO_FIX = bool(check_setting_int(CFG, 'General', 'syno_fix', 0)) SEARCH_DELAY = check_setting_int(CFG, 'General', 'search_delay', 1) GRABBAG_DIR = check_setting_str(CFG, 'General', 'grabbag_dir', '') @@ -1115,6 +1117,7 @@ def config_write(): new_config['General']['zero_level_n'] = ZERO_LEVEL_N new_config['General']['lowercase_filenames'] = int(LOWERCASE_FILENAMES) new_config['General']['ignore_havetotal'] = int(IGNORE_HAVETOTAL) + new_config['General']['snatched_havetotal'] = int(SNATCHED_HAVETOTAL) new_config['General']['syno_fix'] = int(SYNO_FIX) new_config['General']['search_delay'] = SEARCH_DELAY new_config['General']['grabbag_dir'] = GRABBAG_DIR diff --git a/mylar/updater.py b/mylar/updater.py index 02237c4a..593bdbf1 100755 --- a/mylar/updater.py +++ b/mylar/updater.py @@ -1107,6 +1107,14 @@ def forceRescan(ComicID,archive=None,module=None): havefiles = havefiles + ignorecount logger.fdebug(module + ' Adjusting have total to ' + str(havefiles) + ' because of this many Ignored files:' + str(ignorecount)) + snatchedcount = 0 + if mylar.SNATCHED_HAVETOTAL: # if this is enabled, will increase Have total as if in Archived Status + snatches = myDB.select("SELECT count(*) FROM issues WHERE ComicID=? AND Status='Snatched'", [ComicID]) + if int(snatches[0][0]) > 0: + snatchedcount = snatches[0][0] + havefiles = havefiles + snatchedcount + logger.fdebug(module + ' Adjusting have total to ' + str(havefiles) + ' because of this many Snatched files:' + str(snatchedcount)) + #now that we are finished... #adjust for issues that have been marked as Downloaded, but aren't found/don't exist. #do it here, because above loop only cycles though found comics using filechecker. @@ -1160,6 +1168,6 @@ def forceRescan(ComicID,archive=None,module=None): combined_total = rescan['Total'] + anncnt myDB.upsert("comics", newValueStat, controlValueStat) - logger.info(module + ' I have physically found ' + str(foundcount) + ' issues, ignored ' + str(ignorecount) + ' issues, and accounted for ' + str(totalarc) + ' in an Archived state. Total Issue Count: ' + str(havefiles) + ' / ' + str(combined_total)) + logger.info(module + ' I have physically found ' + str(foundcount) + ' issues, ignored ' + str(ignorecount) + ' issues, snatched ' + str(snatchedcount) + ' issues, and accounted for ' + str(totalarc) + ' in an Archived state [ Total Issue Count: ' + str(havefiles) + ' / ' + str(combined_total) + ' ]') return diff --git a/mylar/webserve.py b/mylar/webserve.py index a8cdacea..b8b549f6 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -120,10 +120,11 @@ class WebInterface(object): isCounts[4] = 0 #4 downloaded isCounts[5] = 0 #5 ignored isCounts[6] = 0 #6 failed - #isCounts[7] = 0 #7 read + isCounts[7] = 0 #7 snatched + #isCounts[8] = 0 #8 read for curResult in issues: - baseissues = {'skipped':1,'wanted':2,'archived':3,'downloaded':4,'ignored':5,'failed':6} + baseissues = {'skipped':1,'wanted':2,'archived':3,'downloaded':4,'ignored':5,'failed':6,'snatched':7} for seas in baseissues: if curResult['Status'] is None: continue @@ -138,7 +139,8 @@ class WebInterface(object): "Archived" : str(isCounts[3]), "Downloaded" : str(isCounts[4]), "Ignored" : str(isCounts[5]), - "Failed" : str(isCounts[6]) + "Failed" : str(isCounts[6]), + "Snatched" : str(isCounts[7]) } usethefuzzy = comic['UseFuzzy'] skipped2wanted = "0"