IMP: Added ability to set Snatched Status as being able to accumulate the HAVE totals for every series - (config.ini - snatched_havetotal = 0/1)

This commit is contained in:
evilhero 2014-12-08 12:48:13 -05:00
parent f3806a1b4c
commit d748d80ff1
4 changed files with 19 additions and 5 deletions

View File

@ -319,6 +319,7 @@
<label for="Downloaded" class="checkbox inline Downloaded"><input type="checkbox" id="Downloaded" checked="checked" /> Downloaded: <b>${isCounts['Downloaded']}</b></label>
<label for="Skipped" class="checkbox inline Skipped"><input type="checkbox" id="Skipped" checked="checked" /> Skipped: <b>${isCounts['Skipped']}</b></label>
<label for="Ignored" class="checkbox inline Ignored"><input type="checkbox" id="Ignored" checked="checked" /> Ignored: <b>${isCounts['Ignored']}</b></label>
<label for="Snatched" class="checkbox inline Snatched"><input type="checkbox" id="Snatched" checked="checked" /> Snatched: <b>${isCounts['Snatched']}</b></label>
%if mylar.FAILED_DOWNLOAD_HANDLING:
<label for="Failed" class="checkbox inline Failed"><input type="checkbox" id="Failed" checked="checked" /> Failed: <b>${isCounts['Failed']}</b></label>
%endif

View File

@ -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

View File

@ -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

View File

@ -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"