2015-01-16 19:40:08 +00:00
2012-09-14 17:29:01 +00:00
# This file is part of Mylar.
2012-09-13 15:27:34 +00:00
#
2012-09-14 17:29:01 +00:00
# Mylar is free software: you can redistribute it and/or modify
2012-09-13 15:27:34 +00:00
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
2012-09-14 17:29:01 +00:00
# Mylar is distributed in the hope that it will be useful,
2012-09-13 15:27:34 +00:00
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
2012-09-14 17:29:01 +00:00
# along with Mylar. If not, see <http://www.gnu.org/licenses/>.
2012-09-13 15:27:34 +00:00
2013-01-15 19:02:32 +00:00
from __future__ import with_statement
2012-09-13 15:27:34 +00:00
import os
import cherrypy
2012-12-31 16:52:16 +00:00
import datetime
2013-01-06 08:51:44 +00:00
import re
2012-09-13 15:27:34 +00:00
from mako . template import Template
from mako . lookup import TemplateLookup
from mako import exceptions
import time
import threading
2013-01-11 21:20:51 +00:00
import csv
import platform
2013-02-06 19:55:23 +00:00
import urllib
import shutil
2012-09-13 15:27:34 +00:00
import mylar
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
from mylar import logger , db , importer , mb , search , filechecker , helpers , updater , parseit , weeklypull , PostProcessor , version , librarysync , moveit , Failed , readinglist #,rsscheck
2012-09-13 15:27:34 +00:00
import lib . simplejson as simplejson
from operator import itemgetter
def serve_template ( templatename , * * kwargs ) :
interface_dir = os . path . join ( str ( mylar . PROG_DIR ) , ' data/interfaces/ ' )
template_dir = os . path . join ( str ( interface_dir ) , mylar . INTERFACE )
_hplookup = TemplateLookup ( directories = [ template_dir ] )
try :
template = _hplookup . get_template ( templatename )
return template . render ( * * kwargs )
except :
return exceptions . html_error_template ( ) . render ( )
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
class WebInterface ( object ) :
2015-05-22 08:32:51 +00:00
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
# def filter_request():
# request = cherrypy.request
# if mylar.HTTPS_FORCE_ON:
# request.base = request.base.replace('http://', 'https://')
# cherrypy.tools.filter_request = cherrypy.Tool('before_request_body', filter_request)
2015-05-22 08:32:51 +00:00
# _cp_config = { 'tools.filter_reqeust_on': True }
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
2012-09-13 15:27:34 +00:00
def index ( self ) :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
if mylar . SAFESTART :
raise cherrypy . HTTPRedirect ( " manageComics " )
else :
raise cherrypy . HTTPRedirect ( " home " )
2012-09-13 15:27:34 +00:00
index . exposed = True
def home ( self ) :
2014-06-02 19:02:28 +00:00
comics = helpers . havetotals ( )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
return serve_template ( templatename = " index.html " , title = " Home " , comics = comics )
2012-09-13 15:27:34 +00:00
home . exposed = True
2013-07-10 01:45:10 +00:00
def comicDetails ( self , ComicID ) :
2012-09-13 15:27:34 +00:00
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
comic = myDB . selectone ( ' SELECT * FROM comics WHERE ComicID=? ' , [ ComicID ] ) . fetchone ( )
2012-09-13 15:27:34 +00:00
if comic is None :
raise cherrypy . HTTPRedirect ( " home " )
2013-03-13 01:41:45 +00:00
#let's cheat. :)
2013-03-21 17:09:10 +00:00
#comicskip = myDB.select('SELECT * from comics order by ComicSortName COLLATE NOCASE')
skipno = len ( mylar . COMICSORT [ ' SortOrder ' ] )
lastno = mylar . COMICSORT [ ' LastOrderNo ' ]
lastid = mylar . COMICSORT [ ' LastOrderID ' ]
2013-03-13 01:41:45 +00:00
series = { }
2015-04-28 02:15:53 +00:00
2013-03-30 16:53:07 +00:00
if skipno == 0 :
#it's a blank db, let's just null the values and go.
series [ ' Current ' ] = None
series [ ' Previous ' ] = None
series [ ' Next ' ] = None
2013-03-21 17:09:10 +00:00
i = 0
while ( i < skipno ) :
cskip = mylar . COMICSORT [ ' SortOrder ' ] [ i ]
2013-03-14 08:33:16 +00:00
if cskip [ ' ComicID ' ] == ComicID :
2013-03-21 17:09:10 +00:00
cursortnum = cskip [ ' ComicOrder ' ]
2013-03-14 08:33:16 +00:00
series [ ' Current ' ] = cskip [ ' ComicID ' ]
2013-03-21 17:09:10 +00:00
if cursortnum == 0 :
2013-03-14 08:33:16 +00:00
# if first record, set the Previous record to the LAST record.
2013-03-21 17:09:10 +00:00
previous = lastid
2013-03-14 08:33:16 +00:00
else :
2015-05-22 08:32:51 +00:00
previous = mylar . COMICSORT [ ' SortOrder ' ] [ i - 1 ] [ ' ComicID ' ]
2013-03-14 08:33:16 +00:00
2013-03-21 17:09:10 +00:00
# if last record, set the Next record to the FIRST record.
if cursortnum == lastno :
next = mylar . COMICSORT [ ' SortOrder ' ] [ 0 ] [ ' ComicID ' ]
else :
2015-05-22 08:32:51 +00:00
next = mylar . COMICSORT [ ' SortOrder ' ] [ i + 1 ] [ ' ComicID ' ]
2013-03-21 17:09:10 +00:00
series [ ' Previous ' ] = previous
series [ ' Next ' ] = next
2013-03-13 01:41:45 +00:00
break
2013-03-21 17:09:10 +00:00
i + = 1
2013-02-25 15:36:43 +00:00
issues = myDB . select ( ' SELECT * FROM issues WHERE ComicID=? order by Int_IssueNumber DESC ' , [ ComicID ] )
isCounts = { }
isCounts [ 1 ] = 0 #1 skipped
isCounts [ 2 ] = 0 #2 wanted
isCounts [ 3 ] = 0 #3 archived
isCounts [ 4 ] = 0 #4 downloaded
2013-07-30 04:57:37 +00:00
isCounts [ 5 ] = 0 #5 ignored
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
isCounts [ 6 ] = 0 #6 failed
2014-12-08 17:48:13 +00:00
isCounts [ 7 ] = 0 #7 snatched
2015-05-22 08:32:51 +00:00
#isCounts[8] = 0 #8 read
2013-02-25 15:36:43 +00:00
for curResult in issues :
2015-05-22 08:32:51 +00:00
baseissues = { ' skipped ' : 1 , ' wanted ' : 2 , ' archived ' : 3 , ' downloaded ' : 4 , ' ignored ' : 5 , ' failed ' : 6 , ' snatched ' : 7 }
2013-02-25 15:36:43 +00:00
for seas in baseissues :
2014-02-26 19:48:50 +00:00
if curResult [ ' Status ' ] is None :
continue
else :
if seas in curResult [ ' Status ' ] . lower ( ) :
sconv = baseissues [ seas ]
isCounts [ sconv ] + = 1
continue
2013-02-25 15:36:43 +00:00
isCounts = {
2015-05-22 08:32:51 +00:00
" Skipped " : str ( isCounts [ 1 ] ) ,
" Wanted " : str ( isCounts [ 2 ] ) ,
" Archived " : str ( isCounts [ 3 ] ) ,
" Downloaded " : str ( isCounts [ 4 ] ) ,
" Ignored " : str ( isCounts [ 5 ] ) ,
" Failed " : str ( isCounts [ 6 ] ) ,
" Snatched " : str ( isCounts [ 7 ] )
2013-02-25 15:36:43 +00:00
}
2013-01-15 22:41:00 +00:00
usethefuzzy = comic [ ' UseFuzzy ' ]
2013-01-23 07:34:50 +00:00
skipped2wanted = " 0 "
2013-01-15 22:41:00 +00:00
if usethefuzzy is None : usethefuzzy = " 0 "
2013-08-19 06:14:47 +00:00
force_continuing = comic [ ' ForceContinuing ' ]
if force_continuing is None : force_continuing = 0
2012-09-14 17:29:01 +00:00
comicConfig = {
2015-05-22 08:32:51 +00:00
" comiclocation " : mylar . COMIC_LOCATION ,
" fuzzy_year0 " : helpers . radio ( int ( usethefuzzy ) , 0 ) ,
" fuzzy_year1 " : helpers . radio ( int ( usethefuzzy ) , 1 ) ,
" fuzzy_year2 " : helpers . radio ( int ( usethefuzzy ) , 2 ) ,
" skipped2wanted " : helpers . checked ( skipped2wanted ) ,
" force_continuing " : helpers . checked ( force_continuing )
2012-09-14 17:29:01 +00:00
}
2013-03-21 17:09:10 +00:00
if mylar . ANNUALS_ON :
annuals = myDB . select ( " SELECT * FROM annuals WHERE ComicID=? " , [ ComicID ] )
2014-02-26 19:48:50 +00:00
#we need to load in the annual['ReleaseComicName'] and annual['ReleaseComicID']
#then group by ReleaseComicID, in an attempt to create seperate tables for each different annual series.
#this should allow for annuals, specials, one-shots, etc all to be included if desired.
acnt = 0
aName = [ ]
annualinfo = { }
for ann in annuals :
if not any ( d . get ( ' annualComicID ' , None ) == str ( ann [ ' ReleaseComicID ' ] ) for d in aName ) :
aName . append ( { " annualComicName " : ann [ ' ReleaseComicName ' ] ,
2015-05-22 08:32:51 +00:00
" annualComicID " : ann [ ' ReleaseComicID ' ] } )
2014-02-26 19:48:50 +00:00
#logger.info('added : ' + str(ann['ReleaseComicID']))
acnt + = 1
annualinfo = aName
#annualinfo['count'] = acnt
2014-02-27 02:45:02 +00:00
else :
annuals = None
aName = None
2014-02-26 19:48:50 +00:00
return serve_template ( templatename = " comicdetails.html " , title = comic [ ' ComicName ' ] , comic = comic , issues = issues , comicConfig = comicConfig , isCounts = isCounts , series = series , annuals = annuals , annualinfo = aName )
2013-07-10 01:45:10 +00:00
comicDetails . exposed = True
2013-02-25 15:36:43 +00:00
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
def searchit ( self , name , issue = None , mode = None , type = None , explicit = None , serinfo = None ) :
2013-02-27 08:28:40 +00:00
if type is None : type = ' comic ' # let's default this to comic search only for the time being (will add story arc, characters, etc later)
2014-02-26 19:48:50 +00:00
else : logger . fdebug ( str ( type ) + " mode enabled. " )
2012-09-13 15:27:34 +00:00
#mode dictates type of search:
# --series ... search for comicname displaying all results
# --pullseries ... search for comicname displaying a limited # of results based on issue
# --want ... individual comics
if mode is None : mode = ' series '
if len ( name ) == 0 :
raise cherrypy . HTTPRedirect ( " home " )
if type == ' comic ' and mode == ' pullseries ' :
2014-06-04 18:53:33 +00:00
searchresults , explicit = mb . findComic ( name , mode , issue = issue )
2012-09-13 15:27:34 +00:00
elif type == ' comic ' and mode == ' series ' :
2014-02-26 19:48:50 +00:00
if name . startswith ( ' 4050- ' ) :
mismatch = " no "
2015-05-22 08:32:51 +00:00
comicid = re . sub ( ' 4050- ' , ' ' , name )
2014-02-26 19:48:50 +00:00
logger . info ( ' Attempting to add directly by ComicVineID: ' + str ( comicid ) + ' . I sure hope you know what you are doing. ' )
2015-05-22 08:32:51 +00:00
threading . Thread ( target = importer . addComictoDB , args = [ comicid , mismatch , None ] ) . start ( )
2014-02-26 19:48:50 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
2014-06-04 18:53:33 +00:00
searchresults , explicit = mb . findComic ( name , mode , issue = None , explicit = explicit )
2012-09-13 15:27:34 +00:00
elif type == ' comic ' and mode == ' want ' :
2014-06-04 18:53:33 +00:00
searchresults , explicit = mb . findComic ( name , mode , issue )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
elif type == ' story_arc ' :
searchresults , explicit = mb . findComic ( name , mode = None , issue = None , explicit = ' explicit ' , type = ' story_arc ' )
2013-01-28 20:31:43 +00:00
2015-05-22 08:32:51 +00:00
searchresults = sorted ( searchresults , key = itemgetter ( ' comicyear ' , ' issues ' ) , reverse = True )
2012-09-13 15:27:34 +00:00
#print ("Results: " + str(searchresults))
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
return serve_template ( templatename = " searchresults.html " , title = ' Search Results for: " ' + name + ' " ' , searchresults = searchresults , type = type , imported = None , ogcname = None , name = name , explicit = explicit , serinfo = serinfo )
2012-09-13 15:27:34 +00:00
searchit . exposed = True
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
def addComic ( self , comicid , comicname = None , comicyear = None , comicimage = None , comicissues = None , comicpublisher = None , imported = None , ogcname = None , serinfo = None ) :
2012-10-16 08:16:29 +00:00
myDB = db . DBConnection ( )
2013-02-13 01:27:24 +00:00
if imported == " confirm " :
# if it's coming from the importer and it's just for confirmation, record the right selection and break.
# if it's 'confirmed' coming in as the value for imported
# the ogcname will be the original comicid that is either correct/incorrect (doesn't matter which)
#confirmedid is the selected series (comicid) with the letter C at the beginning to denote Confirmed.
# then sql the original comicid which will hit on all the results for the given series.
# iterate through, and overwrite the existing watchmatch with the new chosen 'C' + comicid value
2015-05-22 08:32:51 +00:00
2013-02-13 01:27:24 +00:00
confirmedid = " C " + str ( comicid )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
confirms = myDB . select ( " SELECT * FROM importresults WHERE WatchMatch=? " , [ ogcname ] )
2013-02-13 01:27:24 +00:00
if confirms is None :
2013-02-25 15:36:43 +00:00
logger . Error ( " There are no results that match...this is an ERROR. " )
2013-02-13 01:27:24 +00:00
else :
for confirm in confirms :
controlValue = { " impID " : confirm [ ' impID ' ] }
newValue = { " WatchMatch " : str ( confirmedid ) }
myDB . upsert ( " importresults " , newValue , controlValue )
2015-05-22 08:32:51 +00:00
self . importResults ( )
2013-02-13 01:27:24 +00:00
return
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
elif imported == ' futurecheck ' :
print ' serinfo: ' + str ( serinfo )
logger . info ( ' selected comicid of : ' + str ( comicid ) + ' [ ' + comicname + ' ( ' + str ( comicyear ) + ' ) ] ' )
ser = [ ]
2015-05-22 08:32:51 +00:00
ser . append ( { " comicname " : comicname ,
" comicyear " : comicyear ,
" comicissues " : comicissues ,
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
" comicpublisher " : comicpublisher ,
" IssueDate " : serinfo [ 0 ] [ ' IssueDate ' ] ,
" IssueNumber " : serinfo [ 0 ] [ ' IssueNumber ' ] } )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
weeklypull . future_check_add ( comicid , ser )
2012-10-16 08:16:29 +00:00
sresults = [ ]
2013-01-11 21:20:51 +00:00
cresults = [ ]
2012-10-16 08:16:29 +00:00
mismatch = " no "
2013-02-25 15:36:43 +00:00
#print ("comicid: " + str(comicid))
#print ("comicname: " + str(comicname))
#print ("comicyear: " + str(comicyear))
#print ("comicissues: " + str(comicissues))
#print ("comicimage: " + str(comicimage))
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
if not mylar . CV_ONLY :
2012-10-16 08:16:29 +00:00
#here we test for exception matches (ie. comics spanning more than one volume, known mismatches, etc).
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
CV_EXcomicid = myDB . selectone ( " SELECT * from exceptions WHERE ComicID=? " , [ comicid ] ) . fetchone ( )
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
if CV_EXcomicid is None : # pass #
gcdinfo = parseit . GCDScraper ( comicname , comicyear , comicissues , comicid , quickmatch = " yes " )
if gcdinfo == " No Match " :
2013-01-13 15:59:46 +00:00
#when it no matches, the image will always be blank...let's fix it.
2015-05-22 08:32:51 +00:00
cvdata = mylar . cv . getComic ( comicid , ' comic ' )
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
comicimage = cvdata [ ' ComicImage ' ]
updater . no_searchresults ( comicid )
nomatch = " true "
u_comicname = comicname . encode ( ' utf-8 ' ) . strip ( )
2015-05-22 08:32:51 +00:00
logger . info ( " I couldn ' t find an exact match for " + u_comicname + " ( " + str ( comicyear ) + " ) - gathering data for Error-Checking screen (this could take a minute)... " )
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
i = 0
loopie , cnt = parseit . ComChk ( comicname , comicyear , comicpublisher , comicissues , comicid )
logger . info ( " total count : " + str ( cnt ) )
while ( i < cnt ) :
try :
stoopie = loopie [ ' comchkchoice ' ] [ i ]
except ( IndexError , TypeError ) :
break
cresults . append ( {
2015-05-22 08:32:51 +00:00
' ComicID ' : stoopie [ ' ComicID ' ] ,
' ComicName ' : stoopie [ ' ComicName ' ] . decode ( ' utf-8 ' , ' replace ' ) ,
' ComicYear ' : stoopie [ ' ComicYear ' ] ,
' ComicIssues ' : stoopie [ ' ComicIssues ' ] ,
' ComicURL ' : stoopie [ ' ComicURL ' ] ,
' ComicPublisher ' : stoopie [ ' ComicPublisher ' ] . decode ( ' utf-8 ' , ' replace ' ) ,
' GCDID ' : stoopie [ ' GCDID ' ]
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
} )
i + = 1
if imported != ' None ' :
2013-03-29 04:02:35 +00:00
#if it's from an import and it has to go through the UEC, return the values
#to the calling function and have that return the template
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
return cresults
else :
2015-05-22 08:32:51 +00:00
return serve_template ( templatename = " searchfix.html " , title = " Error Check " , comicname = comicname , comicid = comicid , comicyear = comicyear , comicimage = comicimage , comicissues = comicissues , cresults = cresults , imported = None , ogcname = None )
2013-03-29 04:02:35 +00:00
else :
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
nomatch = " false "
2015-05-22 08:32:51 +00:00
logger . info ( u " Quick match success..continuing. " )
2013-01-11 21:20:51 +00:00
else :
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
if CV_EXcomicid [ ' variloop ' ] == ' 99 ' :
logger . info ( u " mismatched name...autocorrecting to correct GID and auto-adding. " )
mismatch = " yes "
if CV_EXcomicid [ ' NewComicID ' ] == ' none ' :
2015-05-22 08:32:51 +00:00
logger . info ( u " multi-volume series detected " )
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
testspx = CV_EXcomicid [ ' GComicID ' ] . split ( ' / ' )
for exc in testspx :
fakeit = parseit . GCDAdd ( testspx )
howmany = int ( CV_EXcomicid [ ' variloop ' ] )
t = 0
while ( t < = howmany ) :
try :
sres = fakeit [ ' serieschoice ' ] [ t ]
except IndexError :
break
sresults . append ( {
2015-05-22 08:32:51 +00:00
' ComicID ' : sres [ ' ComicID ' ] ,
' ComicName ' : sres [ ' ComicName ' ] ,
' ComicYear ' : sres [ ' ComicYear ' ] ,
' ComicIssues ' : sres [ ' ComicIssues ' ] ,
' ComicPublisher ' : sres [ ' ComicPublisher ' ] ,
' ComicCover ' : sres [ ' ComicCover ' ]
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
} )
t + = 1
#searchfix(-1).html is for misnamed comics and wrong years.
#searchfix-2.html is for comics that span multiple volumes.
return serve_template ( templatename = " searchfix-2.html " , title = " In-Depth Results " , sresults = sresults )
2013-02-09 03:34:02 +00:00
#print ("imported is: " + str(imported))
2015-05-22 08:32:51 +00:00
threading . Thread ( target = importer . addComictoDB , args = [ comicid , mismatch , None , imported , ogcname ] ) . start ( )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
2012-09-13 15:27:34 +00:00
addComic . exposed = True
2012-10-16 08:16:29 +00:00
2015-05-22 08:32:51 +00:00
def addbyid ( self , comicid , calledby = None , imported = None , ogcname = None ) :
2014-01-29 19:24:53 +00:00
mismatch = " no "
logger . info ( ' Attempting to add directly by ComicVineID: ' + str ( comicid ) )
2015-05-22 08:32:51 +00:00
if comicid . startswith ( ' 4050- ' ) : comicid = re . sub ( ' 4050- ' , ' ' , comicid )
threading . Thread ( target = importer . addComictoDB , args = [ comicid , mismatch , None , imported , ogcname ] ) . start ( )
2015-01-16 19:40:08 +00:00
if calledby == True or calledby == ' True ' :
return
elif calledby == ' web-import ' :
raise cherrypy . HTTPRedirect ( " importResults " )
else :
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
2014-01-29 19:24:53 +00:00
addbyid . exposed = True
2015-05-22 08:32:51 +00:00
def addStoryArc ( self , storyarcname , storyarcyear , storyarcpublisher , storyarcissues , arcid , arclist , desc , image ) :
2014-11-21 17:16:28 +00:00
# used when a choice is selected to 'add story arc' via the searchresults screen (via the story arc search).
# arclist contains ALL the issueid's in sequence, along with the issue titles.
# call the function within cv.py to grab all the issueid's and return all the issue data
2015-01-19 18:41:18 +00:00
module = ' [STORY ARC] '
myDB = db . DBConnection ( )
#check if it already exists.
2015-01-30 01:45:44 +00:00
arc_chk = myDB . selectone ( ' SELECT * FROM readinglist WHERE CV_ArcID=? ' , [ arcid ] ) . fetchone ( )
2015-01-19 18:41:18 +00:00
if arc_chk is None :
logger . fdebug ( module + ' No match in db based on ComicVine ID. Making sure and checking against Story Arc Name. ' )
2015-01-30 01:45:44 +00:00
arc_chk = myDB . selectone ( ' SELECT * FROM readinglist WHERE StoryArc=? ' , [ storyarcname ] ) . fetchone ( )
2015-01-19 18:41:18 +00:00
if arc_chk is not None :
logger . warn ( module + ' ' + storyarcname + ' already exists on your Story Arc Watchlist. ' )
raise cherrypy . HTTPRedirect ( " readlist " )
else :
logger . warn ( module + ' ' + storyarcname + ' already exists on your Story Arc Watchlist. ' )
raise cherrypy . HTTPRedirect ( " readlist " )
2014-11-21 17:16:28 +00:00
arc_results = mylar . cv . getComic ( comicid = None , type = ' issue ' , arcid = arcid , arclist = arclist )
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' Arcresults: ' + str ( arc_results ) )
2014-11-21 17:16:28 +00:00
if len ( arc_results ) > 0 :
import random
issuedata = [ ]
2015-05-22 08:32:51 +00:00
storyarcid = str ( random . randint ( 1000 , 9999 ) ) + str ( storyarcissues )
2014-11-21 17:16:28 +00:00
n = 0
cidlist = ' '
iscnt = int ( storyarcissues )
while ( n < = iscnt ) :
try :
arcval = arc_results [ ' issuechoice ' ] [ n ]
#print arcval
except IndexError :
break
comicname = arcval [ ' ComicName ' ]
issname = arcval [ ' Issue_Name ' ]
issid = str ( arcval [ ' IssueID ' ] )
comicid = str ( arcval [ ' ComicID ' ] )
if comicid not in cidlist :
if n == 0 :
cidlist + = str ( comicid )
else :
cidlist + = ' | ' + str ( comicid )
2015-05-22 08:32:51 +00:00
st_issueid = str ( storyarcid ) + " _ " + str ( random . randint ( 1000 , 9999 ) )
2014-11-21 17:16:28 +00:00
issnum = arcval [ ' Issue_Number ' ]
issdate = str ( arcval [ ' Issue_Date ' ] )
storedate = str ( arcval [ ' Store_Date ' ] )
if issnum . isdigit ( ) :
2015-05-22 08:32:51 +00:00
int_issnum = int ( issnum ) * 1000
2014-11-21 17:16:28 +00:00
else :
if ' a.i. ' in issnum . lower ( ) or ' ai ' in issnum . lower ( ) :
issnum = re . sub ( ' \ . ' , ' ' , issnum )
#int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i')
if ' au ' in issnum . lower ( ) :
int_issnum = ( int ( issnum [ : - 2 ] ) * 1000 ) + ord ( ' a ' ) + ord ( ' u ' )
elif ' inh ' in issnum . lower ( ) :
int_issnum = ( int ( issnum [ : - 4 ] ) * 1000 ) + ord ( ' i ' ) + ord ( ' n ' ) + ord ( ' h ' )
elif ' now ' in issnum . lower ( ) :
int_issnum = ( int ( issnum [ : - 4 ] ) * 1000 ) + ord ( ' n ' ) + ord ( ' o ' ) + ord ( ' w ' )
elif u ' \xbd ' in issnum :
int_issnum = .5 * 1000
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' 1/2 issue detected : ' + issnum + ' === ' + str ( int_issnum ) )
2014-11-21 17:16:28 +00:00
elif u ' \xbc ' in issnum :
int_issnum = .25 * 1000
elif u ' \xbe ' in issnum :
int_issnum = .75 * 1000
elif u ' \u221e ' in issnum :
#issnum = utf-8 will encode the infinity symbol without any help
int_issnum = 9999999999 * 1000 # set 9999999999 for integer value of issue
elif ' . ' in issnum or ' , ' in issnum :
2015-05-22 08:32:51 +00:00
if ' , ' in issnum : issnum = re . sub ( ' , ' , ' . ' , issnum )
2014-11-21 17:16:28 +00:00
issst = str ( issnum ) . find ( ' . ' )
#logger.fdebug("issst:" + str(issst))
if issst == 0 :
issb4dec = 0
else :
issb4dec = str ( issnum ) [ : issst ]
#logger.fdebug("issb4dec:" + str(issb4dec))
#if the length of decimal is only 1 digit, assume it's a tenth
2015-05-22 08:32:51 +00:00
decis = str ( issnum ) [ issst + 1 : ]
2014-11-21 17:16:28 +00:00
#logger.fdebug("decis:" + str(decis))
if len ( decis ) == 1 :
decisval = int ( decis ) * 10
issaftdec = str ( decisval )
elif len ( decis ) == 2 :
decisval = int ( decis )
issaftdec = str ( decisval )
else :
decisval = decis
issaftdec = str ( decisval )
try :
int_issnum = ( int ( issb4dec ) * 1000 ) + ( int ( issaftdec ) * 10 )
except ValueError :
2015-01-19 18:41:18 +00:00
logger . error ( module + ' This has no issue # for me to get - Either a Graphic Novel or one-shot. ' )
2014-11-21 17:16:28 +00:00
updater . no_searchresults ( comicid )
return
else :
try :
x = float ( issnum )
#validity check
if x < 0 :
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' I have encountered a negative issue #: ' + str ( issnum ) + ' . Trying to accomodate. ' )
logger . fdebug ( module + ' value of x is : ' + str ( x ) )
2015-05-22 08:32:51 +00:00
int_issnum = ( int ( x ) * 1000 ) - 1
2014-11-21 17:16:28 +00:00
else : raise ValueError
except ValueError , e :
x = 0
tstord = None
issno = None
invchk = " false "
while ( x < len ( issnum ) ) :
if issnum [ x ] . isalpha ( ) :
#take first occurance of alpha in string and carry it through
tstord = issnum [ x : ] . rstrip ( )
issno = issnum [ : x ] . rstrip ( )
try :
isschk = float ( issno )
except ValueError , e :
if len ( issnum ) == 1 and issnum . isalpha ( ) :
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' Detected lone alpha issue. Attempting to figure this out. ' )
2014-11-21 17:16:28 +00:00
break
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' Invalid numeric for issue - cannot be found. Ignoring. ' )
2014-11-21 17:16:28 +00:00
issno = None
tstord = None
invchk = " true "
break
x + = 1
if tstord is not None and issno is not None :
a = 0
ordtot = 0
if len ( issnum ) == 1 and issnum . isalpha ( ) :
int_issnum = ord ( tstord . lower ( ) )
else :
while ( a < len ( tstord ) ) :
ordtot + = ord ( tstord [ a ] . lower ( ) ) #lower-case the letters for simplicty
a + = 1
int_issnum = ( int ( issno ) * 1000 ) + ordtot
elif invchk == " true " :
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' This does not have an issue # that I can parse properly. ' )
2014-11-21 17:16:28 +00:00
return
else :
2015-01-19 18:41:18 +00:00
logger . error ( module + ' ' + str ( issnum ) + ' This has an alpha-numeric in the issue # which I cannot account for. ' )
2014-11-21 17:16:28 +00:00
return
issuedata . append ( { " ComicID " : comicid ,
" IssueID " : issid ,
" StoryArcID " : storyarcid ,
" IssueArcID " : st_issueid ,
" ComicName " : comicname ,
" IssueName " : issname ,
" Issue_Number " : issnum ,
" IssueDate " : issdate ,
" ReleaseDate " : storedate ,
2015-05-22 08:32:51 +00:00
" ReadingOrder " : n + 1 ,
2014-11-21 17:16:28 +00:00
" Int_IssueNumber " : int_issnum } )
n + = 1
comicid_results = mylar . cv . getComic ( comicid = None , type = ' comicyears ' , comicidlist = cidlist )
#logger.info('comicid_results: ' + str(comicid_results))
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' Initiating issue updating - just the info ' )
2014-11-21 17:16:28 +00:00
for AD in issuedata :
seriesYear = ' None '
issuePublisher = ' None '
2014-12-08 17:19:20 +00:00
if AD [ ' IssueName ' ] is None :
IssueName = ' None '
else :
IssueName = AD [ ' IssueName ' ] [ : 70 ]
2014-11-21 17:16:28 +00:00
for cid in comicid_results :
if cid [ ' ComicID ' ] == AD [ ' ComicID ' ] :
seriesYear = cid [ ' SeriesYear ' ]
issuePublisher = cid [ ' Publisher ' ]
break
newCtrl = { " IssueArcID " : AD [ ' IssueArcID ' ] ,
" StoryArcID " : AD [ ' StoryArcID ' ] }
newVals = { " ComicID " : AD [ ' ComicID ' ] ,
" IssueID " : AD [ ' IssueID ' ] ,
" StoryArc " : storyarcname ,
" ComicName " : AD [ ' ComicName ' ] ,
2014-12-08 17:19:20 +00:00
" IssueName " : IssueName ,
2014-11-21 17:16:28 +00:00
" IssueNumber " : AD [ ' Issue_Number ' ] ,
" Publisher " : storyarcpublisher ,
" TotalIssues " : storyarcissues ,
" ReadingOrder " : AD [ ' ReadingOrder ' ] ,
" IssueDate " : AD [ ' IssueDate ' ] ,
" StoreDate " : AD [ ' ReleaseDate ' ] ,
" SeriesYear " : seriesYear ,
" IssuePublisher " : issuePublisher }
myDB . upsert ( " readinglist " , newVals , newCtrl )
2015-01-16 19:40:08 +00:00
#run the Search for Watchlist matches now.
2015-01-19 18:41:18 +00:00
logger . fdebug ( module + ' Now searching your watchlist for matches belonging to this story arc. ' )
2015-01-16 19:40:08 +00:00
self . ArcWatchlist ( storyarcid )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
raise cherrypy . HTTPRedirect ( " detailStoryArc?StoryArcID= %s &StoryArcName= %s " % ( storyarcid , storyarcname ) )
2015-05-22 08:32:51 +00:00
2014-11-21 17:16:28 +00:00
addStoryArc . exposed = True
2013-07-10 01:45:10 +00:00
def wanted_Export ( self ) :
import unicodedata
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
wantlist = myDB . select ( " SELECT * FROM issues WHERE Status= ' Wanted ' AND ComicName NOT NULL " )
2013-07-10 01:45:10 +00:00
if wantlist is None :
logger . info ( " There aren ' t any issues marked as Wanted. Aborting Export. " )
return
#write it a wanted_list.csv
logger . info ( " gathered data - writing to csv... " )
2015-05-22 08:32:51 +00:00
except_file = os . path . join ( mylar . DATA_DIR , " wanted_list.csv " )
2013-07-10 01:45:10 +00:00
if os . path . exists ( except_file ) :
try :
os . remove ( except_file )
2015-05-22 08:32:51 +00:00
except ( OSError , IOError ) :
2013-07-10 01:45:10 +00:00
pass
wcount = 0
with open ( str ( except_file ) , ' w+ ' ) as f :
headrow = " SeriesName,SeriesYear,IssueNumber,IssueDate,ComicID,IssueID "
2015-05-22 08:32:51 +00:00
headerline = headrow . decode ( ' utf-8 ' , ' ignore ' )
f . write ( ' %s \n ' % ( headerline . encode ( ' ascii ' , ' replace ' ) . strip ( ) ) )
2013-07-10 01:45:10 +00:00
for want in wantlist :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
wantcomic = myDB . selectone ( " SELECT * FROM comics WHERE ComicID=? " , [ want [ ' ComicID ' ] ] ) . fetchone ( )
2013-07-10 01:45:10 +00:00
exceptln = wantcomic [ ' ComicName ' ] . encode ( ' ascii ' , ' replace ' ) + " , " + str ( wantcomic [ ' ComicYear ' ] ) + " , " + str ( want [ ' Issue_Number ' ] ) + " , " + str ( want [ ' IssueDate ' ] ) + " , " + str ( want [ ' ComicID ' ] ) + " , " + str ( want [ ' IssueID ' ] )
logger . fdebug ( exceptln )
wcount + = 1
2015-05-22 08:32:51 +00:00
f . write ( ' %s \n ' % ( exceptln . encode ( ' ascii ' , ' replace ' ) . strip ( ) ) )
2013-07-10 01:45:10 +00:00
logger . info ( " Successfully wrote to csv file " + str ( wcount ) + " entries from your Wanted list. " )
raise cherrypy . HTTPRedirect ( " home " )
wanted_Export . exposed = True
2013-03-29 04:02:35 +00:00
def from_Exceptions ( self , comicid , gcdid , comicname = None , comicyear = None , comicissues = None , comicpublisher = None , imported = None , ogcname = None ) :
2013-03-08 01:36:36 +00:00
import unicodedata
2013-01-11 21:20:51 +00:00
mismatch = " yes "
#write it to the custom_exceptions.csv and reload it so that importer will pick it up and do it's thing :)
#custom_exceptions in this format...
#99, (comicid), (gcdid), none
logger . info ( " saving new information into custom_exceptions.csv... " )
2013-03-12 16:06:44 +00:00
except_info = " none # " + str ( comicname ) + " -( " + str ( comicyear ) + " ) \n "
2015-05-22 08:32:51 +00:00
except_file = os . path . join ( mylar . DATA_DIR , " custom_exceptions.csv " )
2013-01-15 19:02:32 +00:00
if not os . path . exists ( except_file ) :
try :
csvfile = open ( str ( except_file ) , ' rb ' )
csvfile . close ( )
2015-05-22 08:32:51 +00:00
except ( OSError , IOError ) :
2013-01-15 19:02:32 +00:00
logger . error ( " Could not locate " + str ( except_file ) + " file. Make sure it ' s in datadir: " + mylar . DATA_DIR + " with proper permissions. " )
return
2013-03-08 01:36:36 +00:00
exceptln = " 99, " + str ( comicid ) + " , " + str ( gcdid ) + " , " + str ( except_info )
2015-05-22 08:32:51 +00:00
exceptline = exceptln . decode ( ' utf-8 ' , ' ignore ' )
2013-01-15 19:02:32 +00:00
with open ( str ( except_file ) , ' a ' ) as f :
2013-03-08 01:36:36 +00:00
#f.write('%s,%s,%s,%s\n' % ("99", comicid, gcdid, except_info)
2015-05-22 08:32:51 +00:00
f . write ( ' %s \n ' % ( exceptline . encode ( ' ascii ' , ' replace ' ) . strip ( ) ) )
2013-01-11 21:20:51 +00:00
logger . info ( " re-loading csv file so it ' s all nice and current. " )
mylar . csv_load ( )
2013-03-29 04:02:35 +00:00
if imported :
2015-05-22 08:32:51 +00:00
threading . Thread ( target = importer . addComictoDB , args = [ comicid , mismatch , None , imported , ogcname ] ) . start ( )
2013-03-29 04:02:35 +00:00
else :
2015-05-22 08:32:51 +00:00
threading . Thread ( target = importer . addComictoDB , args = [ comicid , mismatch ] ) . start ( )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
2013-01-11 21:20:51 +00:00
from_Exceptions . exposed = True
2012-10-16 08:16:29 +00:00
def GCDaddComic ( self , comicid , comicname = None , comicyear = None , comicissues = None , comiccover = None , comicpublisher = None ) :
#since we already know most of the info, let's add it to the db so we can reference it later.
myDB = db . DBConnection ( )
gcomicid = " G " + str ( comicid )
comicyear_len = comicyear . find ( ' ' , 2 )
2015-05-22 08:32:51 +00:00
comyear = comicyear [ comicyear_len + 1 : comicyear_len + 5 ]
2013-01-24 17:01:27 +00:00
if comyear . isdigit ( ) :
logger . fdebug ( " Series year set to : " + str ( comyear ) )
else :
logger . fdebug ( " Invalid Series year detected - trying to adjust from " + str ( comyear ) )
#comicyear_len above will trap wrong year if it's 10 October 2010 - etc ( 2000 AD)...
find_comicyear = comicyear . split ( )
for i in find_comicyear :
if len ( i ) == 4 :
logger . fdebug ( " Series year detected as : " + str ( i ) )
comyear = str ( i )
continue
logger . fdebug ( " Series year set to: " + str ( comyear ) )
2015-05-22 08:32:51 +00:00
controlValueDict = { ' ComicID ' : gcomicid }
2012-10-16 08:16:29 +00:00
newValueDict = { ' ComicName ' : comicname ,
' ComicYear ' : comyear ,
' ComicPublished ' : comicyear ,
' ComicPublisher ' : comicpublisher ,
' ComicImage ' : comiccover ,
2015-05-22 08:32:51 +00:00
' Total ' : comicissues }
2012-10-16 08:16:29 +00:00
myDB . upsert ( " comics " , newValueDict , controlValueDict )
threading . Thread ( target = importer . GCDimport , args = [ gcomicid ] ) . start ( )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % gcomicid )
2012-10-16 08:16:29 +00:00
GCDaddComic . exposed = True
IMP: (#844)Annuals now deleted from table on a Delete Series command, IMP: (#837)Better volume detection when searching for issues, IMP: (#842)(#808) Added some handling for issue titles when searching (it's not perfect, but it works for most), IMP: (#836)Added .cb7 for filechecking purposes only, IMP: (#830)issue numbers that are -1 can now be renamed, FIX: 'bi-annual' now fixed along with some other improvements for annual handling, IMP: Added version check for autoProcessComics and ComicRN - in order to help warn users of changes and the need to update these files since they are usually outside of the mylar git directory when being used, FIX:(#840) Boxcar2 should be working again, FIX: (#845) If search returned a filename that had no distinction between issue number and issue title and/or extra information, would error out if any of the words contained NOW, IMP: (#823) Added some better detection for NZBGet parameters when using ComicRN.py
2014-10-06 18:10:36 +00:00
def post_process ( self , nzb_name , nzb_folder , failed = False , apc_version = None , comicrn_version = None ) :
2015-05-22 08:32:51 +00:00
if all ( [ nzb_name != ' Manual Run ' , nzb_name != ' Manual+Run ' ] ) :
2014-11-21 17:16:28 +00:00
if comicrn_version is None and apc_version is None :
logger . warn ( ' ComicRN should be v ' + str ( mylar . STATIC_COMICRN_VERSION ) + ' and autoProcessComics.py should be v ' + str ( mylar . STATIC_APC_VERSION ) + ' , but they are not and are out of date. Post-Processing may or may not work. ' )
elif comicrn_version is None or comicrn_version != mylar . STATIC_COMICRN_VERSION :
if comicrn_version == ' None ' :
comicrn_version = " 0 "
logger . warn ( ' Your ComicRN.py script should be v ' + str ( mylar . STATIC_COMICRN_VERSION ) + ' , but is v ' + str ( comicrn_version ) + ' and is out of date. Things may still work - but you are taking your chances. ' )
elif apc_version is None or apc_version != mylar . STATIC_APC_VERSION :
if apc_version == ' None ' :
apc_version = " 0 "
logger . warn ( ' Your autoProcessComics.py script should be v ' + str ( mylar . STATIC_APC_VERSION ) + ' , but is v ' + str ( apc_version ) + ' and is out of date. Odds are something is gonna fail - you should update it. ' )
else :
logger . info ( ' ComicRN.py version: ' + str ( comicrn_version ) + ' -- autoProcessComics.py version: ' + str ( apc_version ) )
IMP: (#844)Annuals now deleted from table on a Delete Series command, IMP: (#837)Better volume detection when searching for issues, IMP: (#842)(#808) Added some handling for issue titles when searching (it's not perfect, but it works for most), IMP: (#836)Added .cb7 for filechecking purposes only, IMP: (#830)issue numbers that are -1 can now be renamed, FIX: 'bi-annual' now fixed along with some other improvements for annual handling, IMP: Added version check for autoProcessComics and ComicRN - in order to help warn users of changes and the need to update these files since they are usually outside of the mylar git directory when being used, FIX:(#840) Boxcar2 should be working again, FIX: (#845) If search returned a filename that had no distinction between issue number and issue title and/or extra information, would error out if any of the words contained NOW, IMP: (#823) Added some better detection for NZBGet parameters when using ComicRN.py
2014-10-06 18:10:36 +00:00
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
import Queue
logger . info ( ' Starting postprocessing for : ' + nzb_name )
if failed == ' 0 ' :
failed = False
elif failed == ' 1 ' :
failed = True
queue = Queue . Queue ( )
if not failed :
PostProcess = PostProcessor . PostProcessor ( nzb_name , nzb_folder , queue = queue )
if nzb_name == ' Manual Run ' or nzb_name == ' Manual+Run ' :
threading . Thread ( target = PostProcess . Process ) . start ( )
raise cherrypy . HTTPRedirect ( " home " )
else :
thread_ = threading . Thread ( target = PostProcess . Process , name = " Post-Processing " )
thread_ . start ( )
thread_ . join ( )
chk = queue . get ( )
while True :
if chk [ 0 ] [ ' mode ' ] == ' fail ' :
yield chk [ 0 ] [ ' self.log ' ]
logger . info ( ' Initiating Failed Download handling ' )
if chk [ 0 ] [ ' annchk ' ] == ' no ' : mode = ' want '
else : mode = ' want_ann '
failed = True
break
elif chk [ 0 ] [ ' mode ' ] == ' stop ' :
yield chk [ 0 ] [ ' self.log ' ]
break
else :
logger . error ( ' mode is unsupported: ' + chk [ 0 ] [ ' mode ' ] )
yield chk [ 0 ] [ ' self.log ' ]
break
if failed :
if mylar . FAILED_DOWNLOAD_HANDLING :
#drop the if-else continuation so we can drop down to this from the above if statement.
logger . info ( ' Initiating Failed Download handling for this download. ' )
FailProcess = Failed . FailedProcessor ( nzb_name = nzb_name , nzb_folder = nzb_folder , queue = queue )
thread_ = threading . Thread ( target = FailProcess . Process , name = " FAILED Post-Processing " )
thread_ . start ( )
thread_ . join ( )
failchk = queue . get ( )
if failchk [ 0 ] [ ' mode ' ] == ' retry ' :
2014-08-10 16:50:43 +00:00
yield failchk [ 0 ] [ ' self.log ' ]
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
logger . info ( ' Attempting to return to search module with ' + str ( failchk [ 0 ] [ ' issueid ' ] ) )
if failchk [ 0 ] [ ' annchk ' ] == ' no ' : mode = ' want '
else : mode = ' want_ann '
self . queueit ( mode = mode , ComicName = failchk [ 0 ] [ ' comicname ' ] , ComicIssue = failchk [ 0 ] [ ' issuenumber ' ] , ComicID = failchk [ 0 ] [ ' comicid ' ] , IssueID = failchk [ 0 ] [ ' issueid ' ] , manualsearch = True )
elif failchk [ 0 ] [ ' mode ' ] == ' stop ' :
2014-08-10 16:50:43 +00:00
yield failchk [ 0 ] [ ' self.log ' ]
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
else :
logger . error ( ' mode is unsupported: ' + failchk [ 0 ] [ ' mode ' ] )
2014-08-10 16:50:43 +00:00
yield failchk [ 0 ] [ ' self.log ' ]
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
else :
2015-05-22 08:32:51 +00:00
logger . warn ( ' Failed Download Handling is not enabled. Leaving Failed Download as-is. ' )
2012-10-30 10:43:01 +00:00
post_process . exposed = True
2012-09-13 15:27:34 +00:00
def pauseArtist ( self , ComicID ) :
logger . info ( u " Pausing comic: " + ComicID )
myDB = db . DBConnection ( )
controlValueDict = { ' ComicID ' : ComicID }
newValueDict = { ' Status ' : ' Paused ' }
myDB . upsert ( " comics " , newValueDict , controlValueDict )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2012-09-13 15:27:34 +00:00
pauseArtist . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def resumeArtist ( self , ComicID ) :
logger . info ( u " Resuming comic: " + ComicID )
myDB = db . DBConnection ( )
controlValueDict = { ' ComicID ' : ComicID }
newValueDict = { ' Status ' : ' Active ' }
myDB . upsert ( " comics " , newValueDict , controlValueDict )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2012-09-13 15:27:34 +00:00
resumeArtist . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def deleteArtist ( self , ComicID ) :
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
comic = myDB . selectone ( ' SELECT * from comics WHERE ComicID=? ' , [ ComicID ] ) . fetchone ( )
2012-09-24 05:17:29 +00:00
if comic [ ' ComicName ' ] is None : ComicName = " None "
else : ComicName = comic [ ' ComicName ' ]
2013-03-08 01:38:05 +00:00
logger . info ( u " Deleting all traces of Comic: " + ComicName )
2012-09-13 15:27:34 +00:00
myDB . action ( ' DELETE from comics WHERE ComicID=? ' , [ ComicID ] )
myDB . action ( ' DELETE from issues WHERE ComicID=? ' , [ ComicID ] )
IMP: (#844)Annuals now deleted from table on a Delete Series command, IMP: (#837)Better volume detection when searching for issues, IMP: (#842)(#808) Added some handling for issue titles when searching (it's not perfect, but it works for most), IMP: (#836)Added .cb7 for filechecking purposes only, IMP: (#830)issue numbers that are -1 can now be renamed, FIX: 'bi-annual' now fixed along with some other improvements for annual handling, IMP: Added version check for autoProcessComics and ComicRN - in order to help warn users of changes and the need to update these files since they are usually outside of the mylar git directory when being used, FIX:(#840) Boxcar2 should be working again, FIX: (#845) If search returned a filename that had no distinction between issue number and issue title and/or extra information, would error out if any of the words contained NOW, IMP: (#823) Added some better detection for NZBGet parameters when using ComicRN.py
2014-10-06 18:10:36 +00:00
if mylar . ANNUALS_ON :
myDB . action ( ' DELETE from annuals WHERE ComicID=? ' , [ ComicID ] )
2013-02-06 19:55:23 +00:00
myDB . action ( ' DELETE from upcoming WHERE ComicID=? ' , [ ComicID ] )
2013-05-06 02:34:01 +00:00
helpers . ComicSort ( sequence = ' update ' )
2012-09-13 15:27:34 +00:00
raise cherrypy . HTTPRedirect ( " home " )
deleteArtist . exposed = True
2015-05-22 08:32:51 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
def wipenzblog ( self , ComicID = None , IssueID = None ) :
2013-08-06 00:53:10 +00:00
myDB = db . DBConnection ( )
if ComicID is None :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
logger . fdebug ( " Wiping NZBLOG in it ' s entirety. You should NOT be downloading while doing this or else you ' ll lose the log for the download. " )
2013-08-06 00:53:10 +00:00
myDB . action ( ' DROP table nzblog ' )
logger . fdebug ( " Deleted nzblog table. " )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
myDB . action ( ' CREATE TABLE IF NOT EXISTS nzblog (IssueID TEXT, NZBName TEXT, SARC TEXT, PROVIDER TEXT, ID TEXT, AltNZBName TEXT) ' )
2013-08-06 00:53:10 +00:00
logger . fdebug ( " Re-created nzblog table. " )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
raise cherrypy . HTTPRedirect ( " history " )
if IssueID :
2015-05-22 08:32:51 +00:00
logger . fdebug ( ' Removing all download history for the given IssueID. This should allow post-processing to finish for the given IssueID. ' )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
myDB . action ( ' DELETE FROM nzblog WHERE IssueID=? ' , [ IssueID ] )
logger . fdebug ( ' Successfully removed all entries in the download log for IssueID: ' + str ( IssueID ) )
raise cherrypy . HTTPRedirect ( " history " )
2013-08-06 00:53:10 +00:00
wipenzblog . exposed = True
2014-06-22 22:19:32 +00:00
def refreshSeries ( self , ComicID ) :
comicsToAdd = [ ComicID ]
logger . fdebug ( " Refreshing comic: %s " % comicsToAdd )
threading . Thread ( target = updater . dbUpdate , args = [ comicsToAdd ] ) . start ( )
#threading.Thread(target=self.refreshArtist, kwargs=kwargs).start()
refreshSeries . exposed = True
2012-09-13 15:27:34 +00:00
def refreshArtist ( self , ComicID ) :
2012-10-16 08:16:29 +00:00
myDB = db . DBConnection ( )
mismatch = " no "
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
logger . fdebug ( ' Refreshing comicid: ' + str ( ComicID ) )
2013-04-07 18:06:36 +00:00
if not mylar . CV_ONLY or ComicID [ : 1 ] == " G " :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
CV_EXcomicid = myDB . selectone ( " SELECT * from exceptions WHERE ComicID=? " , [ ComicID ] ) . fetchone ( )
2013-04-07 18:06:36 +00:00
if CV_EXcomicid is None : pass
else :
if CV_EXcomicid [ ' variloop ' ] == ' 99 ' :
mismatch = " yes "
if ComicID [ : 1 ] == " G " : threading . Thread ( target = importer . GCDimport , args = [ ComicID ] ) . start ( )
2015-05-22 08:32:51 +00:00
else : threading . Thread ( target = importer . addComictoDB , args = [ ComicID , mismatch ] ) . start ( )
2012-10-16 08:16:29 +00:00
else :
2013-04-07 18:06:36 +00:00
if mylar . CV_ONETIMER == 1 :
2013-04-07 19:18:26 +00:00
logger . fdebug ( " CV_OneTimer option enabled... " )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
#in order to update to JUST CV_ONLY, we need to delete the issues for a given series so it's a clean grab.
2013-04-07 19:18:26 +00:00
logger . fdebug ( " Gathering the status of all issues for the series. " )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
2013-04-07 18:06:36 +00:00
issues = myDB . select ( ' SELECT * FROM issues WHERE ComicID=? ' , [ ComicID ] )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
if not issues :
#if issues are None it's probably a bad refresh/maxed out API that resulted in the issue data
#getting wiped out and not refreshed. Setting whack=True will force a complete refresh.
logger . info ( ' No issue data available. This is Whack. ' )
whack = True
else :
#check for series that are numerically out of whack (ie. 5/4)
logger . info ( ' Checking how out of whack the series is. ' )
whack = helpers . havetotals ( refreshit = ComicID )
2015-05-22 08:32:51 +00:00
2014-02-26 19:48:50 +00:00
annload = [ ] #initiate the list here so we don't error out below.
2013-07-30 04:57:37 +00:00
if mylar . ANNUALS_ON :
2015-05-22 08:32:51 +00:00
#now we load the annuals into memory to pass through to importer when refreshing so that it can
2014-02-26 19:48:50 +00:00
#refresh even the manually added annuals.
annual_load = myDB . select ( ' SELECT * FROM annuals WHERE ComicID=? ' , [ ComicID ] )
logger . fdebug ( ' checking annual db ' )
for annthis in annual_load :
if not any ( d [ ' ReleaseComicID ' ] == annthis [ ' ReleaseComicID ' ] for d in annload ) :
#print 'matched on annual'
annload . append ( {
' ReleaseComicID ' : annthis [ ' ReleaseComicID ' ] ,
' ReleaseComicName ' : annthis [ ' ReleaseComicName ' ] ,
' ComicID ' : annthis [ ' ComicID ' ] ,
' ComicName ' : annthis [ ' ComicName ' ]
} )
#print 'added annual'
issues + = annual_load #myDB.select('SELECT * FROM annuals WHERE ComicID=?', [ComicID])
2013-04-07 18:06:36 +00:00
#store the issues' status for a given comicid, after deleting and readding, flip the status back to$
2013-04-07 19:18:26 +00:00
logger . fdebug ( " Deleting all issue data. " )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
myDB . action ( ' DELETE FROM issues WHERE ComicID=? ' , [ ComicID ] )
myDB . action ( ' DELETE FROM annuals WHERE ComicID=? ' , [ ComicID ] )
2013-04-07 19:18:26 +00:00
logger . fdebug ( " Refreshing the series and pulling in new data using only CV. " )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
if whack == False :
2015-05-22 08:32:51 +00:00
mylar . importer . addComictoDB ( ComicID , mismatch , calledfrom = ' dbupdate ' , annload = annload )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
#reload the annuals here.
2015-05-22 08:32:51 +00:00
issues_new = myDB . select ( ' SELECT * FROM issues WHERE ComicID=? ' , [ ComicID ] )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
annuals = [ ]
ann_list = [ ]
if mylar . ANNUALS_ON :
annuals_list = myDB . select ( ' SELECT * FROM annuals WHERE ComicID=? ' , [ ComicID ] )
ann_list + = annuals_list
issues_new + = annuals_list
logger . fdebug ( " Attempting to put the Status ' back how they were. " )
icount = 0
#the problem - the loop below will not match on NEW issues that have been refreshed that weren't present in the
#db before (ie. you left Mylar off for abit, and when you started it up it pulled down new issue information)
#need to test if issuenew['Status'] is None, but in a seperate loop below.
fndissue = [ ]
for issue in issues :
for issuenew in issues_new :
#logger.fdebug(str(issue['Issue_Number']) + ' - issuenew:' + str(issuenew['IssueID']) + ' : ' + str(issuenew['Status']))
#logger.fdebug(str(issue['Issue_Number']) + ' - issue:' + str(issue['IssueID']) + ' : ' + str(issue['Status']))
if issuenew [ ' IssueID ' ] == issue [ ' IssueID ' ] and issuenew [ ' Status ' ] != issue [ ' Status ' ] :
ctrlVAL = { " IssueID " : issue [ ' IssueID ' ] }
#if the status is None and the original status is either Downloaded / Archived, keep status & stats
if issuenew [ ' Status ' ] == None and ( issue [ ' Status ' ] == ' Downloaded ' or issue [ ' Status ' ] == ' Archived ' ) :
newVAL = { " Location " : issue [ ' Location ' ] ,
" ComicSize " : issue [ ' ComicSize ' ] ,
" Status " : issue [ ' Status ' ] }
#if the status is now Downloaded/Snatched, keep status & stats (downloaded only)
elif issuenew [ ' Status ' ] == ' Downloaded ' or issue [ ' Status ' ] == ' Snatched ' :
newVAL = { " Location " : issue [ ' Location ' ] ,
" ComicSize " : issue [ ' ComicSize ' ] }
if issuenew [ ' Status ' ] == ' Downloaded ' :
newVAL [ ' Status ' ] = issuenew [ ' Status ' ]
else :
newVAL [ ' Status ' ] = issue [ ' Status ' ]
2015-05-22 08:32:51 +00:00
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
elif issue [ ' Status ' ] == ' Archived ' :
newVAL = { " Status " : issue [ ' Status ' ] ,
" Location " : issue [ ' Location ' ] ,
" ComicSize " : issue [ ' ComicSize ' ] }
else :
#change the status to the previous status
newVAL = { " Status " : issue [ ' Status ' ] }
2015-05-22 08:32:51 +00:00
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
if newVAL [ ' Status ' ] == None :
newVAL = { " Status " : " Skipped " }
if any ( d [ ' IssueID ' ] == str ( issue [ ' IssueID ' ] ) for d in ann_list ) :
logger . fdebug ( " annual detected for " + str ( issue [ ' IssueID ' ] ) + " #: " + str ( issue [ ' Issue_Number ' ] ) )
myDB . upsert ( " Annuals " , newVAL , ctrlVAL )
else :
#logger.fdebug('#' + str(issue['Issue_Number']) + ' writing issuedata: ' + str(newVAL))
myDB . upsert ( " Issues " , newVAL , ctrlVAL )
fndissue . append ( { " IssueID " : issue [ ' IssueID ' ] } )
icount + = 1
break
logger . info ( " In the process of converting the data to CV, I changed the status of " + str ( icount ) + " issues. " )
FIX:(#663) Weekly pull list would crash on issues with decimal places if series on watchlist, FIX: Error logging when performing search, FIX:(#662) Removed 'Test SABnzbd button' as was causing configuration saving issues. Can still be used by url : /SABtest, IMP: Added more logic checking to weeklypull list when comparing series for matches (to ensure an issue is part of a given series), IMP: Removed dead references to nzbx as a provider, FIX: If issue had no leading 0 in a decimal issue, mylar would crash, FIX: None status would occur when refreshing a series and more than one issue was being pulled in for data, IMP: When using manual post-processing, if issue date was near end/start of year issue comparison would fail. Comparison by month now added, FIX: file checking - if decimal in issue and no year present, would skip issue, FIX: manual post-processing - would fail/skip if no year provided for issue within filename, FIX: Manual Annual Add option will only be available if annuals_on=1 within the config.ini now
2014-04-07 16:20:05 +00:00
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
issues_new = myDB . select ( ' SELECT * FROM issues WHERE ComicID=? AND Status is NULL ' , [ ComicID ] )
if mylar . ANNUALS_ON :
issues_new + = myDB . select ( ' SELECT * FROM annuals WHERE ComicID=? AND Status is NULL ' , [ ComicID ] )
FIX:(#663) Weekly pull list would crash on issues with decimal places if series on watchlist, FIX: Error logging when performing search, FIX:(#662) Removed 'Test SABnzbd button' as was causing configuration saving issues. Can still be used by url : /SABtest, IMP: Added more logic checking to weeklypull list when comparing series for matches (to ensure an issue is part of a given series), IMP: Removed dead references to nzbx as a provider, FIX: If issue had no leading 0 in a decimal issue, mylar would crash, FIX: None status would occur when refreshing a series and more than one issue was being pulled in for data, IMP: When using manual post-processing, if issue date was near end/start of year issue comparison would fail. Comparison by month now added, FIX: file checking - if decimal in issue and no year present, would skip issue, FIX: manual post-processing - would fail/skip if no year provided for issue within filename, FIX: Manual Annual Add option will only be available if annuals_on=1 within the config.ini now
2014-04-07 16:20:05 +00:00
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
newiss = [ ]
if mylar . AUTOWANT_UPCOMING :
#only mark store date >= current date as Wanted.
newstatus = " Wanted "
else :
newstatus = " Skipped "
for iss in issues_new :
newiss . append ( { " IssueID " : iss [ ' IssueID ' ] ,
" Status " : newstatus } )
if len ( newiss ) > 0 :
for newi in newiss :
ctrlVAL = { " IssueID " : newi [ ' IssueID ' ] }
newVAL = { " Status " : newi [ ' Status ' ] }
#logger.info('writing issuedata: ' + str(newVAL))
myDB . upsert ( " Issues " , newVAL , ctrlVAL )
logger . info ( ' I have added ' + str ( len ( newiss ) ) + ' new issues for this series that were not present before. ' )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
else :
2015-05-22 08:32:51 +00:00
mylar . importer . addComictoDB ( ComicID , mismatch , annload = annload )
2013-04-07 18:06:36 +00:00
else :
2015-05-22 08:32:51 +00:00
mylar . importer . addComictoDB ( ComicID , mismatch )
2013-04-07 18:06:36 +00:00
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2015-05-22 08:32:51 +00:00
refreshArtist . exposed = True
2012-09-13 15:27:34 +00:00
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
def issue_edit ( self , id , value ) :
2014-08-10 16:50:43 +00:00
logger . fdebug ( ' id: ' + str ( id ) )
logger . fdebug ( ' value: ' + str ( value ) )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
comicid = id [ : id . find ( ' . ' ) ]
2014-08-10 16:50:43 +00:00
logger . fdebug ( ' comicid: ' + str ( comicid ) )
2015-05-22 08:32:51 +00:00
issueid = id [ id . find ( ' . ' ) + 1 : ]
2014-08-10 16:50:43 +00:00
logger . fdebug ( ' issueid: ' + str ( issueid ) )
2012-09-13 15:27:34 +00:00
myDB = db . DBConnection ( )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
comicchk = myDB . selectone ( ' SELECT ComicYear FROM comics WHERE ComicID=? ' , [ comicid ] ) . fetchone ( )
issuechk = myDB . selectone ( ' SELECT * FROM issues WHERE IssueID=? ' , [ issueid ] ) . fetchone ( )
if issuechk is None :
logger . error ( ' Cannot edit this for some reason - something is wrong. ' )
return
oldissuedate = issuechk [ ' IssueDate ' ]
seriesyear = comicchk [ ' ComicYear ' ]
2014-08-10 16:50:43 +00:00
issuenumber = issuechk [ ' Issue_Number ' ]
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
#check if the new date is in the correct format of yyyy-mm-dd
try :
valid_date = time . strptime ( value , ' % Y- % m- %d ' )
except ValueError :
logger . error ( ' invalid date provided. Rejecting edit. ' )
return oldissuedate
#if the new issue year is less than the series year - reject it.
if value [ : 4 ] < seriesyear :
logger . error ( ' Series year of ' + str ( seriesyear ) + ' is less than new issue date of ' + str ( value [ : 4 ] ) )
return oldissuedate
2015-05-22 08:32:51 +00:00
newVal = { " IssueDate " : value ,
" IssueDate_Edit " : oldissuedate }
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
ctrlVal = { " IssueID " : issueid }
myDB . upsert ( " issues " , newVal , ctrlVal )
2014-08-10 16:50:43 +00:00
logger . info ( ' Updated Issue Date for issue # ' + str ( issuenumber ) )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
return value
issue_edit . exposed = True
2015-05-22 08:32:51 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
def force_rss ( self ) :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
logger . info ( ' Attempting to run RSS Check Forcibly ' )
#forcerss = True
#threading.Thread(target=mylar.rsscheck.tehMain, args=[True]).start()
2014-05-29 18:05:11 +00:00
#this is for use with the new scheduler not in place yet.
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
forcethis = mylar . rsscheckit . tehMain ( forcerss = True )
threading . Thread ( target = forcethis . run ) . start ( )
2014-05-29 18:05:11 +00:00
return
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
force_rss . exposed = True
2014-08-18 19:54:34 +00:00
def markannuals ( self , ann_action = None , * * args ) :
self . markissues ( action = ann_action , * * args )
markannuals . exposed = True
2015-05-22 08:32:51 +00:00
2012-10-16 08:16:29 +00:00
def markissues ( self , action = None , * * args ) :
2012-09-13 15:27:34 +00:00
myDB = db . DBConnection ( )
2012-10-16 08:16:29 +00:00
issuesToAdd = [ ]
2012-10-30 10:43:01 +00:00
issuestoArchive = [ ]
2012-09-13 15:27:34 +00:00
if action == ' WantedNew ' :
newaction = ' Wanted '
else :
newaction = action
for IssueID in args :
2014-08-18 19:54:34 +00:00
if IssueID is None or ' issue_table ' in IssueID or ' history_table ' in IssueID or ' manage_issues ' in IssueID or ' issue_table_length ' in IssueID :
2013-02-09 03:34:02 +00:00
continue
2012-09-13 15:27:34 +00:00
else :
2015-05-22 08:32:51 +00:00
mi = myDB . selectone ( " SELECT * FROM issues WHERE IssueID=? " , [ IssueID ] ) . fetchone ( )
2013-07-30 04:57:37 +00:00
annchk = ' no '
if mi is None :
if mylar . ANNUALS_ON :
2015-05-22 08:32:51 +00:00
mi = myDB . selectone ( " SELECT * FROM annuals WHERE IssueID=? " , [ IssueID ] ) . fetchone ( )
2014-04-14 17:42:42 +00:00
comicname = mi [ ' ReleaseComicName ' ]
2013-07-30 04:57:37 +00:00
annchk = ' yes '
2015-05-22 08:32:51 +00:00
else :
2014-04-14 17:42:42 +00:00
comicname = mi [ ' ComicName ' ]
2014-08-18 19:54:34 +00:00
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
miyr = myDB . selectone ( " SELECT ComicYear FROM comics WHERE ComicID=? " , [ mi [ ' ComicID ' ] ] ) . fetchone ( )
2012-10-30 10:43:01 +00:00
if action == ' Downloaded ' :
if mi [ ' Status ' ] == " Skipped " or mi [ ' Status ' ] == " Wanted " :
2014-08-18 19:54:34 +00:00
logger . fdebug ( u " Cannot change status to %s as comic is not Snatched or Downloaded " % ( newaction ) )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
continue
2012-10-30 10:43:01 +00:00
elif action == ' Archived ' :
2014-08-18 19:54:34 +00:00
logger . fdebug ( u " Marking %s %s as %s " % ( comicname , mi [ ' Issue_Number ' ] , newaction ) )
2012-10-30 10:43:01 +00:00
#updater.forceRescan(mi['ComicID'])
issuestoArchive . append ( IssueID )
2013-07-06 02:42:58 +00:00
elif action == ' Wanted ' or action == ' Retry ' :
if action == ' Retry ' : newaction = ' Wanted '
2014-08-18 19:54:34 +00:00
logger . fdebug ( u " Marking %s %s as %s " % ( comicname , mi [ ' Issue_Number ' ] , newaction ) )
2012-10-30 10:43:01 +00:00
issuesToAdd . append ( IssueID )
2013-02-09 03:34:02 +00:00
elif action == ' Skipped ' :
2014-08-18 19:54:34 +00:00
logger . fdebug ( u " Marking " + str ( IssueID ) + " as Skipped " )
2013-07-06 02:42:58 +00:00
elif action == ' Clear ' :
myDB . action ( " DELETE FROM snatched WHERE IssueID=? " , [ IssueID ] )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
elif action == ' Failed ' and mylar . FAILED_DOWNLOAD_HANDLING :
2014-08-18 19:54:34 +00:00
logger . fdebug ( ' Marking [ ' + comicname + ' ] : ' + str ( IssueID ) + ' as Failed. Sending to failed download handler. ' )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
failedcomicid = mi [ ' ComicID ' ]
failedissueid = IssueID
break
2012-10-16 08:16:29 +00:00
controlValueDict = { " IssueID " : IssueID }
newValueDict = { " Status " : newaction }
2013-07-30 04:57:37 +00:00
if annchk == ' yes ' :
2015-05-22 08:32:51 +00:00
myDB . upsert ( " annuals " , newValueDict , controlValueDict )
2013-07-30 04:57:37 +00:00
else :
myDB . upsert ( " issues " , newValueDict , controlValueDict )
logger . fdebug ( " updated...to " + str ( newaction ) )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
if action == ' Failed ' and mylar . FAILED_DOWNLOAD_HANDLING :
self . failed_handling ( failedcomicid , failedissueid )
2012-10-30 10:43:01 +00:00
if len ( issuestoArchive ) > 0 :
updater . forceRescan ( mi [ ' ComicID ' ] )
2012-10-16 08:16:29 +00:00
if len ( issuesToAdd ) > 0 :
2014-08-18 19:54:34 +00:00
logger . fdebug ( " Marking issues: %s as Wanted " % ( issuesToAdd ) )
2012-10-16 08:16:29 +00:00
threading . Thread ( target = search . searchIssueIDList , args = [ issuesToAdd ] ) . start ( )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % mi [ ' ComicID ' ] )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
2012-09-13 15:27:34 +00:00
markissues . exposed = True
2015-05-22 08:32:51 +00:00
2014-08-10 16:50:43 +00:00
def retryit ( self , * * kwargs ) :
threading . Thread ( target = self . retryissue , kwargs = kwargs ) . start ( )
retryit . exposed = True
def retryissue ( self , ComicName , ComicID , IssueID , IssueNumber , ReleaseComicID = None , ComicYear = None , redirect = None ) :
logger . info ( ' ComicID: ' + str ( ComicID ) )
logger . info ( ' Retrying : ' + str ( IssueID ) )
# mode = either series or annual (want vs. want_ann)
#To retry the exact download again - we already have the nzb/torrent name stored in the nzblog.
#0 - Change status to Retrying.
#1 - we need to search the snatched table for the relevant information (since it HAS to be in snatched status)
#2 - we need to reference the ID from the snatched table to the nzblog table
# - if it doesn't match, then it's an invalid retry.
# - if it does match, we get the nzbname/torrent name and provider info
#3 - if it's an nzb - we recreate the sab/nzbget url and resubmit it directly.
# - if it's a torrent - we redownload the torrent and flip it to the watchdir on the local / seedbox.
#4 - Change status to Snatched.
myDB = db . DBConnection ( )
chk_snatch = myDB . select ( ' SELECT * FROM snatched WHERE IssueID=? ' , [ IssueID ] )
if chk_snatch is None :
logger . info ( ' Unable to locate how issue was downloaded (name, provider). Cannot continue. ' )
return
confirmedsnatch = False
for cs in chk_snatch :
if cs [ ' Status ' ] == ' Snatched ' :
logger . info ( ' Located snatched download: ' )
logger . info ( ' --Referencing : ' + cs [ ' Provider ' ] + ' @ ' + str ( cs [ ' DateAdded ' ] ) )
Provider = cs [ ' Provider ' ]
confirmedsnatch = True
elif ( cs [ ' Status ' ] == ' Post-Processed ' or cs [ ' Status ' ] == ' Downloaded ' ) and confirmedsnatch == True :
logger . info ( ' Issue has already been Snatched, Downloaded & Post-Processed. ' )
logger . info ( ' You should be using Manual Search or Mark Wanted - not retry the same download. ' )
return
2014-11-21 17:16:28 +00:00
try :
Provider_sql = ' % ' + Provider + ' % '
chk_log = myDB . selectone ( ' SELECT * FROM nzblog WHERE IssueID=? AND Provider like (?) ' , [ IssueID , Provider_sql ] ) . fetchone ( )
except :
logger . warn ( ' Unable to locate provider reference for attempted Retry. Will see if I can just get the last attempted download. ' )
chk_log = myDB . selectone ( ' SELECT * FROM nzblog WHERE IssueID=? ' , [ IssueID ] ) . fetchone ( )
2014-08-10 16:50:43 +00:00
if chk_log is None :
logger . info ( ' Unable to locate provider information from nzblog - if you wiped the log, you have to search/download as per normal ' )
return
nzbname = chk_log [ ' NZBName ' ]
id = chk_log [ ' ID ' ]
fullprov = chk_log [ ' PROVIDER ' ] #the full newznab name if it exists will appear here as 'sitename (newznab)'
#now we break it down by provider to recreate the link.
#torrents first.
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
if Provider == ' 32P ' or Provider == ' KAT ' :
2014-08-10 16:50:43 +00:00
if not mylar . ENABLE_TORRENT_SEARCH :
logger . error ( ' Torrent Providers are not enabled - unable to process retry request until provider is re-enabled. ' )
return
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
if Provider == ' 32P ' :
if not mylar . ENABLE_32P :
logger . error ( ' 32P is not enabled - unable to process retry request until provider is re-enabled. ' )
2014-08-10 16:50:43 +00:00
return
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
link = str ( id )
2014-08-10 16:50:43 +00:00
elif Provider == ' KAT ' :
if not mylar . ENABLE_KAT :
logger . error ( ' KAT is not enabled - unable to process retry request until provider is re-enabled. ' )
return
link = ' http://torcache.net/torrent/ ' + str ( id ) + ' .torrent '
logger . fdebug ( " sending .torrent to watchdir. " )
logger . fdebug ( " ComicName: " + ComicName )
logger . fdebug ( " link: " + str ( link ) )
logger . fdebug ( " Torrent Provider: " + Provider )
rcheck = mylar . rsscheck . torsend2client ( ComicName , IssueNumber , ComicYear , link , Provider )
if rcheck == " fail " :
logger . error ( " Unable to send torrent - check logs and settings. " )
else :
annualize = myDB . selectone ( ' SELECT * FROM annuals WHERE IssueID=? ' , [ IssueID ] ) . fetchone ( )
if annualize is None :
modcomicname = ComicName
else :
modcomicname = ComicName + ' Annual '
comicinfo = [ ]
comicinfo . append ( { " ComicName " : ComicName ,
" IssueNumber " : IssueNumber ,
" comyear " : ComicYear ,
2015-05-22 08:32:51 +00:00
" modcomicname " : modcomicname } )
2014-08-10 16:50:43 +00:00
if Provider == ' nzb.su ' :
if not mylar . NZBSU :
logger . error ( ' nzb.su is not enabled - unable to process retry request until provider is re-enabled. ' )
return
# http://nzb.su/getnzb/ea1befdeee0affd663735b2b09010140.nzb&i=<uid>&r=<passkey>
2015-01-16 22:43:00 +00:00
link = ' http://nzb.su/getnzb/ ' + str ( id ) + ' .nzb&i= ' + str ( mylar . NZBSU_UID ) + ' &r= ' + str ( mylar . NZBSU_APIKEY )
2014-08-10 16:50:43 +00:00
logger . info ( ' fetched via nzb.su. Retrying the send : ' + str ( link ) )
elif Provider == ' dognzb ' :
if not mylar . DOGNZB :
logger . error ( ' Dognzb is not enabled - unable to process retry request until provider is re-enabled. ' )
return
# https://dognzb.cr/fetch/5931874bf7381b274f647712b796f0ac/<passkey>
link = ' https://dognzb.cr/fetch/ ' + str ( id ) + ' / ' + str ( mylar . DOGNZB_APIKEY )
logger . info ( ' fetched via dognzb. Retrying the send : ' + str ( link ) )
elif Provider == ' experimental ' :
if not mylar . EXPERIMENTAL :
logger . error ( ' Experimental is not enabled - unable to process retry request until provider is re-enabled. ' )
return
# http://nzbindex.nl/download/110818178
link = ' http://nzbindex.nl/download/ ' + str ( id )
logger . info ( ' fetched via experimental. Retrying the send : ' + str ( link ) )
elif ' newznab ' in Provider :
if not mylar . NEWZNAB :
logger . error ( ' Newznabs are not enabled - unable to process retry request until provider is re-enabled. ' )
return
# http://192.168.2.2/getnzb/4323f9c567c260e3d9fc48e09462946c.nzb&i=<uid>&r=<passkey>
# trickier - we have to scroll through all the newznabs until we find a match.
logger . info ( ' fetched via newnzab. Retrying the send. ' )
m = re . findall ( ' [^()]+ ' , fullprov )
tmpprov = m [ 0 ] . strip ( )
2015-05-22 08:32:51 +00:00
2014-08-10 16:50:43 +00:00
for newznab_info in mylar . EXTRA_NEWZNABS :
if tmpprov . lower ( ) in newznab_info [ 0 ] . lower ( ) :
if ( newznab_info [ 4 ] == ' 1 ' or newznab_info [ 4 ] == 1 ) :
if newznab_info [ 1 ] . endswith ( ' / ' ) :
newznab_host = newznab_info [ 1 ]
else :
newznab_host = newznab_info [ 1 ] + ' / '
newznab_api = newznab_info [ 2 ]
newznab_uid = newznab_info [ 3 ]
link = str ( newznab_host ) + ' getnzb/ ' + str ( id ) + ' .nzb&i= ' + str ( newznab_uid ) + ' &r= ' + str ( newznab_api )
logger . info ( ' newznab detected as : ' + str ( newznab_info [ 0 ] ) + ' @ ' + str ( newznab_host ) )
logger . info ( ' link : ' + str ( link ) )
break
else :
logger . error ( str ( newznab_info [ 0 ] ) + ' is not enabled - unable to process retry request until provider is re-enabled. ' )
return
sendit = search . searcher ( Provider , nzbname , comicinfo , link = link , IssueID = IssueID , ComicID = ComicID , tmpprov = fullprov , directsend = True )
retryissue . exposed = True
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
def queueit ( self , * * kwargs ) :
threading . Thread ( target = self . queueissue , kwargs = kwargs ) . start ( )
queueit . exposed = True
2014-09-10 19:33:23 +00:00
def queueissue ( self , mode , ComicName = None , ComicID = None , ComicYear = None , ComicIssue = None , IssueID = None , new = False , redirect = None , SeriesYear = None , SARC = None , IssueArcID = None , manualsearch = None , Publisher = None ) :
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
logger . fdebug ( ' ComicID: ' + str ( ComicID ) )
logger . fdebug ( ' mode: ' + str ( mode ) )
2012-12-31 16:52:16 +00:00
now = datetime . datetime . now ( )
2012-09-19 04:38:25 +00:00
myDB = db . DBConnection ( )
2012-09-13 15:27:34 +00:00
#mode dictates type of queue - either 'want' for individual comics, or 'series' for series watchlist.
if ComicID is None and mode == ' series ' :
issue = None
raise cherrypy . HTTPRedirect ( " searchit?name= %s &issue= %s &mode= %s " % ( ComicName , ' None ' , ' series ' ) )
elif ComicID is None and mode == ' pullseries ' :
# we can limit the search by including the issue # and searching for
# comics that have X many issues
raise cherrypy . HTTPRedirect ( " searchit?name= %s &issue= %s &mode= %s " % ( ComicName , ' None ' , ' pullseries ' ) )
2013-04-22 03:11:12 +00:00
elif ComicID is None and mode == ' readlist ' :
# this is for marking individual comics from a readlist to be downloaded.
# Because there is no associated ComicID or IssueID, follow same pattern as in 'pullwant'
# except we know the Year
2013-05-25 06:18:00 +00:00
if SARC is None :
# it's just a readlist queue (no storyarc mode enabled)
SARC = True
IssueArcID = None
else :
logger . info ( u " Story Arc : " + str ( SARC ) + " queueing selected issue... " )
logger . info ( u " IssueArcID : " + str ( IssueArcID ) )
2015-01-16 19:40:08 +00:00
#try to load the issue dates - can now sideload issue details.
dateload = myDB . selectone ( ' SELECT * FROM readinglist WHERE IssueArcID=? ' , [ IssueArcID ] ) . fetchone ( )
if dateload is None :
IssueDate = None
StoreDate = None
else :
IssueDate = dateload [ ' IssueDate ' ]
StoreDate = dateload [ ' StoreDate ' ]
2013-04-22 03:11:12 +00:00
if ComicYear is None : ComicYear = SeriesYear
logger . info ( u " Marking " + ComicName + " " + ComicIssue + " as wanted... " )
2013-07-01 05:19:15 +00:00
controlValueDict = { " IssueArcID " : IssueArcID }
newStatus = { " Status " : " Wanted " }
myDB . upsert ( " readinglist " , newStatus , controlValueDict )
2015-01-16 19:40:08 +00:00
foundcom , prov = search . search_init ( ComicName = ComicName , IssueNumber = ComicIssue , ComicYear = ComicYear , SeriesYear = None , Publisher = None , IssueDate = IssueDate , StoreDate = StoreDate , IssueID = None , AlternateSearch = None , UseFuzzy = None , ComicVersion = None , SARC = SARC , IssueArcID = IssueArcID )
2013-04-22 03:11:12 +00:00
if foundcom == " yes " :
logger . info ( u " Downloaded " + ComicName + " # " + ComicIssue + " ( " + str ( ComicYear ) + " ) " )
2013-07-01 05:19:15 +00:00
#raise cherrypy.HTTPRedirect("readlist")
return foundcom
2013-04-22 03:11:12 +00:00
2015-05-22 08:32:51 +00:00
elif ComicID is None and mode == ' pullwant ' :
2012-09-13 15:27:34 +00:00
#this is for marking individual comics from the pullist to be downloaded.
#because ComicID and IssueID will both be None due to pullist, it's probably
#better to set both to some generic #, and then filter out later...
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
cyear = myDB . selectone ( " SELECT SHIPDATE FROM weekly " ) . fetchone ( )
2012-09-13 15:27:34 +00:00
ComicYear = str ( cyear [ ' SHIPDATE ' ] ) [ : 4 ]
2014-09-10 19:33:23 +00:00
if Publisher == ' COMICS ' : Publisher = None
2012-12-31 16:52:16 +00:00
if ComicYear == ' ' : ComicYear = now . year
2012-09-13 15:27:34 +00:00
logger . info ( u " Marking " + ComicName + " " + ComicIssue + " as wanted... " )
2014-09-10 19:33:23 +00:00
foundcom , prov = search . search_init ( ComicName = ComicName , IssueNumber = ComicIssue , ComicYear = ComicYear , SeriesYear = None , Publisher = Publisher , IssueDate = cyear [ ' SHIPDATE ' ] , StoreDate = cyear [ ' SHIPDATE ' ] , IssueID = None , AlternateSearch = None , UseFuzzy = None , ComicVersion = None )
2012-09-13 15:27:34 +00:00
if foundcom == " yes " :
2015-05-22 08:32:51 +00:00
logger . info ( u " Downloaded " + ComicName + " " + ComicIssue )
2013-04-12 02:14:27 +00:00
raise cherrypy . HTTPRedirect ( " pullist " )
#return
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
elif mode == ' want ' or mode == ' want_ann ' or manualsearch :
2015-01-25 02:26:22 +00:00
cdname = myDB . selectone ( " SELECT * from comics where ComicID=? " , [ ComicID ] ) . fetchone ( )
ComicName_Filesafe = cdname [ ' ComicName_Filesafe ' ]
SeriesYear = cdname [ ' ComicYear ' ]
AlternateSearch = cdname [ ' AlternateSearch ' ]
Publisher = cdname [ ' ComicPublisher ' ]
UseAFuzzy = cdname [ ' UseFuzzy ' ]
ComicVersion = cdname [ ' ComicVersion ' ]
ComicName = cdname [ ' ComicName ' ]
2012-09-13 15:27:34 +00:00
controlValueDict = { " IssueID " : IssueID }
newStatus = { " Status " : " Wanted " }
2013-07-01 05:19:15 +00:00
if mode == ' want ' :
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
if manualsearch :
logger . info ( ' Initiating manual search for ' + ComicName + ' issue: ' + ComicIssue )
else :
logger . info ( u " Marking " + ComicName + " issue: " + ComicIssue + " as wanted... " )
myDB . upsert ( " issues " , newStatus , controlValueDict )
2013-07-01 05:19:15 +00:00
else :
2015-05-22 08:32:51 +00:00
annual_name = myDB . selectone ( " SELECT * FROM annuals WHERE ComicID=? and IssueID=? " , [ ComicID , IssueID ] ) . fetchone ( )
IMP: (#844)Annuals now deleted from table on a Delete Series command, IMP: (#837)Better volume detection when searching for issues, IMP: (#842)(#808) Added some handling for issue titles when searching (it's not perfect, but it works for most), IMP: (#836)Added .cb7 for filechecking purposes only, IMP: (#830)issue numbers that are -1 can now be renamed, FIX: 'bi-annual' now fixed along with some other improvements for annual handling, IMP: Added version check for autoProcessComics and ComicRN - in order to help warn users of changes and the need to update these files since they are usually outside of the mylar git directory when being used, FIX:(#840) Boxcar2 should be working again, FIX: (#845) If search returned a filename that had no distinction between issue number and issue title and/or extra information, would error out if any of the words contained NOW, IMP: (#823) Added some better detection for NZBGet parameters when using ComicRN.py
2014-10-06 18:10:36 +00:00
if annual_name is None :
logger . fdebug ( ' Unable to locate. ' )
else :
ComicName = annual_name [ ' ReleaseComicName ' ]
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
if manualsearch :
IMP: (#844)Annuals now deleted from table on a Delete Series command, IMP: (#837)Better volume detection when searching for issues, IMP: (#842)(#808) Added some handling for issue titles when searching (it's not perfect, but it works for most), IMP: (#836)Added .cb7 for filechecking purposes only, IMP: (#830)issue numbers that are -1 can now be renamed, FIX: 'bi-annual' now fixed along with some other improvements for annual handling, IMP: Added version check for autoProcessComics and ComicRN - in order to help warn users of changes and the need to update these files since they are usually outside of the mylar git directory when being used, FIX:(#840) Boxcar2 should be working again, FIX: (#845) If search returned a filename that had no distinction between issue number and issue title and/or extra information, would error out if any of the words contained NOW, IMP: (#823) Added some better detection for NZBGet parameters when using ComicRN.py
2014-10-06 18:10:36 +00:00
logger . info ( ' Initiating manual search for ' + ComicName + ' : ' + ComicIssue )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
else :
IMP: (#844)Annuals now deleted from table on a Delete Series command, IMP: (#837)Better volume detection when searching for issues, IMP: (#842)(#808) Added some handling for issue titles when searching (it's not perfect, but it works for most), IMP: (#836)Added .cb7 for filechecking purposes only, IMP: (#830)issue numbers that are -1 can now be renamed, FIX: 'bi-annual' now fixed along with some other improvements for annual handling, IMP: Added version check for autoProcessComics and ComicRN - in order to help warn users of changes and the need to update these files since they are usually outside of the mylar git directory when being used, FIX:(#840) Boxcar2 should be working again, FIX: (#845) If search returned a filename that had no distinction between issue number and issue title and/or extra information, would error out if any of the words contained NOW, IMP: (#823) Added some better detection for NZBGet parameters when using ComicRN.py
2014-10-06 18:10:36 +00:00
logger . info ( u " Marking " + ComicName + " : " + ComicIssue + " as wanted... " )
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
myDB . upsert ( " annuals " , newStatus , controlValueDict )
2013-07-01 05:19:15 +00:00
#---
#this should be on it's own somewhere
#if IssueID is not None:
# controlValueDict = {"IssueID": IssueID}
# newStatus = {"Status": "Wanted"}
# myDB.upsert("issues", newStatus, controlValueDict)
2012-09-13 15:27:34 +00:00
#for future reference, the year should default to current year (.datetime)
2013-07-01 05:19:15 +00:00
if mode == ' want ' :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issues = myDB . selectone ( " SELECT IssueDate, ReleaseDate FROM issues WHERE IssueID=? " , [ IssueID ] ) . fetchone ( )
2013-07-01 05:19:15 +00:00
elif mode == ' want_ann ' :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issues = myDB . selectone ( " SELECT IssueDate, ReleaseDate FROM annuals WHERE IssueID=? " , [ IssueID ] ) . fetchone ( )
2012-09-13 15:27:34 +00:00
if ComicYear == None :
ComicYear = str ( issues [ ' IssueDate ' ] ) [ : 4 ]
2014-04-14 17:42:42 +00:00
if issues [ ' ReleaseDate ' ] is None or issues [ ' ReleaseDate ' ] == ' 0000-00-00 ' :
2014-02-26 19:48:50 +00:00
logger . info ( ' No Store Date found for given issue. This is probably due to not Refreshing the Series beforehand. ' )
logger . info ( ' I Will assume IssueDate as Store Date, but you should probably Refresh the Series and try again if required. ' )
storedate = issues [ ' IssueDate ' ]
else :
storedate = issues [ ' ReleaseDate ' ]
2015-01-25 02:26:22 +00:00
#miy = myDB.selectone("SELECT * FROM comics WHERE ComicID=?", [ComicID]).fetchone()
#SeriesYear = miy['ComicYear']
#AlternateSearch = miy['AlternateSearch']
#Publisher = miy['ComicPublisher']
#UseAFuzzy = miy['UseFuzzy']
#ComicVersion = miy['ComicVersion']
foundcom , prov = search . search_init ( ComicName , ComicIssue , ComicYear , SeriesYear , Publisher , issues [ ' IssueDate ' ] , storedate , IssueID , AlternateSearch , UseAFuzzy , ComicVersion , mode = mode , ComicID = ComicID , manualsearch = manualsearch , filesafe = ComicName_Filesafe )
2012-09-13 15:27:34 +00:00
if foundcom == " yes " :
# file check to see if issue exists and update 'have' count
if IssueID is not None :
2013-07-01 05:19:15 +00:00
logger . info ( " passing to updater. " )
2013-07-30 05:28:09 +00:00
return updater . foundsearch ( ComicID , IssueID , mode = mode , provider = prov )
IMP:(#753) Better handling of cbz files when using metatagging option, IMP: Added option for MetaTagging to enable/disable overwriting of existing metadata on cbz files, IMP: Post-Processing will now delete folders that are identical to filenames after successful post-processing, FIX:(#756) Fix for Manual Search for an Issue which resulted in traceback errors upon not finding any matches (Windows), IMP: Added module-name to logging for some modules to help troubleshooting (eventually all will be done), IMP: If a filename contained repeated characters for spaces (ie. ___ or ...), it would fail on post-processing due to the nzbname being off, IMP: Monitoring of CV API will now be persitent on restarts/shutdowns/etc, IMP: Added a maximum CV API global so that it can be adjusted for monitoring more easily should API requirements change, IMP: When Adding new series, will now only mark issues that are actually upcoming as Wanted (based on Store Date)
2014-06-22 08:32:45 +00:00
if manualsearch :
# if it's a manual search, return to null here so the thread will die and not cause http redirect errors.
return
2012-09-13 15:27:34 +00:00
if ComicID :
2014-09-10 04:54:53 +00:00
return cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2012-09-13 15:27:34 +00:00
else :
raise cherrypy . HTTPRedirect ( redirect )
queueissue . exposed = True
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
def unqueueissue ( self , IssueID , ComicID , ComicName = None , Issue = None , FutureID = None , mode = None , ReleaseComicID = None ) :
2012-09-13 15:27:34 +00:00
myDB = db . DBConnection ( )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if ComicName is None :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
if ReleaseComicID is None : #ReleaseComicID is used for annuals.
issue = myDB . selectone ( ' SELECT * FROM issues WHERE IssueID=? ' , [ IssueID ] ) . fetchone ( )
else :
2015-05-22 08:32:51 +00:00
issue = None
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
annchk = ' no '
if issue is None :
if mylar . ANNUALS_ON :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
if ReleaseComicID is None :
issann = myDB . selectone ( ' SELECT * FROM annuals WHERE IssueID=? ' , [ IssueID ] ) . fetchone ( )
else :
issann = myDB . selectone ( ' SELECT * FROM annuals WHERE IssueID=? AND ReleaseComicID=? ' , [ IssueID , ReleaseComicID ] ) . fetchone ( )
ComicName = issann [ ' ReleaseComicName ' ]
IssueNumber = issann [ ' Issue_Number ' ]
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
annchk = ' yes '
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
ComicID = issann [ ' ComicID ' ]
ReleaseComicID = issann [ ' ReleaseComicID ' ]
2014-04-14 17:42:42 +00:00
else :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
ComicName = issue [ ' ComicName ' ]
IssueNumber = issue [ ' Issue_Number ' ]
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
controlValueDict = { " IssueID " : IssueID }
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
if mode == ' failed ' and mylar . FAILED_DOWNLOAD_HANDLING :
logger . info ( u " Marking " + ComicName + " issue # " + str ( IssueNumber ) + " as Failed... " )
newValueDict = { " Status " : " Failed " }
myDB . upsert ( " failed " , newValueDict , controlValueDict )
yield cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
self . failed_handling ( ComicID = ComicID , IssueID = IssueID )
else :
logger . info ( u " Marking " + ComicName + " issue # " + str ( IssueNumber ) + " as Skipped... " )
newValueDict = { " Status " : " Skipped " }
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if annchk == ' yes ' :
myDB . upsert ( " annuals " , newValueDict , controlValueDict )
else :
myDB . upsert ( " issues " , newValueDict , controlValueDict )
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2013-07-30 04:57:37 +00:00
else :
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
#if ComicName is not None, then it's from the FuturePull list that we're 'unwanting' an issue.
#ComicID may be present if it's a watch from the Watchlist, otherwise it won't exist.
if ComicID is not None and ComicID != ' None ' :
logger . info ( ' comicid present: ' + str ( ComicID ) )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
thefuture = myDB . selectone ( ' SELECT * FROM future WHERE ComicID=? ' , [ ComicID ] ) . fetchone ( )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
else :
logger . info ( ' FutureID: ' + str ( FutureID ) )
logger . info ( ' no comicid - ComicName: ' + str ( ComicName ) + ' -- Issue: # ' + str ( Issue ) )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
thefuture = myDB . selectone ( ' SELECT * FROM future WHERE FutureID=? ' , [ FutureID ] ) . fetchone ( )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if thefuture is None :
logger . info ( ' Cannot find the corresponding issue in the Futures List for some reason. This is probably an Error. ' )
else :
logger . info ( ' Marking ' + thefuture [ ' COMIC ' ] + ' issue # ' + thefuture [ ' ISSUE ' ] + ' as skipped... ' )
if ComicID is not None and ComicID != ' None ' :
cVDict = { " ComicID " : thefuture [ ' ComicID ' ] }
else :
cVDict = { " FutureID " : thefuture [ ' FutureID ' ] }
nVDict = { " Status " : " Skipped " }
logger . info ( ' cVDict: ' + str ( cVDict ) )
logger . info ( ' nVDict: ' + str ( nVDict ) )
myDB . upsert ( " future " , nVDict , cVDict )
2012-09-13 15:27:34 +00:00
unqueueissue . exposed = True
2015-05-22 08:32:51 +00:00
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
def failed_handling ( self , ComicID , IssueID ) :
import Queue
queue = Queue . Queue ( )
FailProcess = Failed . FailedProcessor ( issueid = IssueID , comicid = ComicID , queue = queue )
thread_ = threading . Thread ( target = FailProcess . Process , name = " FAILED Post-Processing " )
thread_ . start ( )
thread_ . join ( )
failchk = queue . get ( )
if failchk [ 0 ] [ ' mode ' ] == ' retry ' :
logger . info ( ' Attempting to return to search module with ' + str ( failchk [ 0 ] [ ' issueid ' ] ) )
if failchk [ 0 ] [ ' annchk ' ] == ' no ' : mode = ' want '
else : mode = ' want_ann '
self . queueit ( mode = mode , ComicName = failchk [ 0 ] [ ' comicname ' ] , ComicIssue = failchk [ 0 ] [ ' issuenumber ' ] , ComicID = failchk [ 0 ] [ ' comicid ' ] , IssueID = failchk [ 0 ] [ ' issueid ' ] , manualsearch = True )
elif failchk [ 0 ] [ ' mode ' ] == ' stop ' :
pass
else :
logger . error ( ' mode is unsupported: ' + failchk [ 0 ] [ ' mode ' ] )
failed_handling . exposed = True
def archiveissue ( self , IssueID , comicid ) :
print ' marking issue : ' + str ( IssueID )
2013-02-17 10:31:18 +00:00
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issue = myDB . selectone ( ' SELECT * FROM issues WHERE IssueID=? ' , [ IssueID ] ) . fetchone ( )
2013-07-30 04:57:37 +00:00
annchk = ' no '
if issue is None :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
print ' issue is none '
2013-07-30 04:57:37 +00:00
if mylar . ANNUALS_ON :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issann = myDB . selectone ( ' SELECT * FROM annuals WHERE IssueID=? ' , [ IssueID ] ) . fetchone ( )
2014-04-14 17:42:42 +00:00
comicname = issann [ ' ReleaseComicName ' ]
issue = issann [ ' Issue_Number ' ]
2013-07-30 04:57:37 +00:00
annchk = ' yes '
2014-04-14 17:42:42 +00:00
comicid = issann [ ' ComicID ' ]
else :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
print ' issue not none '
2014-04-14 17:42:42 +00:00
comicname = issue [ ' ComicName ' ]
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
print comicname
2014-04-14 17:42:42 +00:00
issue = issue [ ' Issue_Number ' ]
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
print issue
2014-04-14 17:42:42 +00:00
logger . info ( u " Marking " + comicname + " issue # " + str ( issue ) + " as archived... " )
2013-02-17 10:31:18 +00:00
controlValueDict = { ' IssueID ' : IssueID }
newValueDict = { ' Status ' : ' Archived ' }
2013-07-30 04:57:37 +00:00
if annchk == ' yes ' :
myDB . upsert ( " annuals " , newValueDict , controlValueDict )
else :
myDB . upsert ( " issues " , newValueDict , controlValueDict )
2014-04-14 17:42:42 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
2013-02-17 10:31:18 +00:00
archiveissue . exposed = True
2012-09-13 15:27:34 +00:00
def pullist ( self ) :
myDB = db . DBConnection ( )
2015-01-16 19:40:08 +00:00
autowants = myDB . select ( " SELECT * FROM futureupcoming WHERE Status= ' Wanted ' " )
autowant = [ ]
if autowants :
for aw in autowants :
autowant . append ( { " ComicName " : aw [ ' ComicName ' ] ,
" IssueNumber " : aw [ ' IssueNumber ' ] ,
" Publisher " : aw [ ' Publisher ' ] ,
" Status " : aw [ ' Status ' ] ,
" DisplayComicName " : aw [ ' DisplayComicName ' ] } )
2013-01-28 20:31:43 +00:00
weeklyresults = [ ]
2014-11-21 17:16:28 +00:00
wantedcount = 0
2012-09-13 15:27:34 +00:00
popit = myDB . select ( " SELECT * FROM sqlite_master WHERE name= ' weekly ' and type= ' table ' " )
if popit :
2015-04-28 02:15:53 +00:00
w_results = myDB . select ( " SELECT * from weekly " )
2013-01-28 20:31:43 +00:00
for weekly in w_results :
2013-09-11 18:49:26 +00:00
x = None
try :
x = float ( weekly [ ' ISSUE ' ] )
except ValueError , e :
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if ' au ' in weekly [ ' ISSUE ' ] . lower ( ) or ' ai ' in weekly [ ' ISSUE ' ] . lower ( ) or ' .inh ' in weekly [ ' ISSUE ' ] . lower ( ) or ' .now ' in weekly [ ' ISSUE ' ] . lower ( ) :
2015-05-22 08:32:51 +00:00
x = weekly [ ' ISSUE ' ]
2013-09-11 18:49:26 +00:00
if x is not None :
2015-01-16 19:40:08 +00:00
if not autowant :
weeklyresults . append ( {
2015-05-22 08:32:51 +00:00
" PUBLISHER " : weekly [ ' PUBLISHER ' ] ,
" ISSUE " : weekly [ ' ISSUE ' ] ,
" COMIC " : weekly [ ' COMIC ' ] ,
" STATUS " : weekly [ ' STATUS ' ] ,
" COMICID " : weekly [ ' ComicID ' ] ,
" ISSUEID " : weekly [ ' IssueID ' ] ,
" AUTOWANT " : False
2013-01-28 20:31:43 +00:00
} )
2015-01-16 19:40:08 +00:00
else :
if any ( x [ ' ComicName ' ] . lower ( ) == weekly [ ' COMIC ' ] . lower ( ) for x in autowant ) :
weeklyresults . append ( {
2015-05-22 08:32:51 +00:00
" PUBLISHER " : weekly [ ' PUBLISHER ' ] ,
" ISSUE " : weekly [ ' ISSUE ' ] ,
" COMIC " : weekly [ ' COMIC ' ] ,
" STATUS " : weekly [ ' STATUS ' ] ,
" COMICID " : weekly [ ' ComicID ' ] ,
" ISSUEID " : weekly [ ' IssueID ' ] ,
" AUTOWANT " : True
2015-01-16 19:40:08 +00:00
} )
else :
weeklyresults . append ( {
2015-05-22 08:32:51 +00:00
" PUBLISHER " : weekly [ ' PUBLISHER ' ] ,
" ISSUE " : weekly [ ' ISSUE ' ] ,
" COMIC " : weekly [ ' COMIC ' ] ,
" STATUS " : weekly [ ' STATUS ' ] ,
" COMICID " : weekly [ ' ComicID ' ] ,
" ISSUEID " : weekly [ ' IssueID ' ] ,
" AUTOWANT " : False
2015-01-16 19:40:08 +00:00
} )
2015-05-22 08:32:51 +00:00
2014-11-21 17:16:28 +00:00
if weekly [ ' STATUS ' ] == ' Wanted ' :
wantedcount + = 1
2015-05-22 08:32:51 +00:00
weeklyresults = sorted ( weeklyresults , key = itemgetter ( ' PUBLISHER ' , ' COMIC ' ) , reverse = False )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
pulldate = myDB . selectone ( " SELECT * from weekly " ) . fetchone ( )
2012-12-16 18:41:01 +00:00
if pulldate is None :
return self . manualpull ( )
#raise cherrypy.HTTPRedirect("home")
2012-09-13 15:27:34 +00:00
else :
return self . manualpull ( )
2013-05-04 04:40:32 +00:00
weekfold = os . path . join ( mylar . DESTINATION_DIR , pulldate [ ' SHIPDATE ' ] )
2014-11-21 17:16:28 +00:00
return serve_template ( templatename = " weeklypull.html " , title = " Weekly Pull " , weeklyresults = weeklyresults , pulldate = pulldate [ ' SHIPDATE ' ] , pullfilter = True , weekfold = weekfold , wantedcount = wantedcount )
2015-05-22 08:32:51 +00:00
pullist . exposed = True
2012-09-13 15:27:34 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
def futurepull ( self ) :
from mylar import solicit
#get month-year here, and self-populate in future
now = datetime . datetime . now ( )
if len ( str ( now . month ) ) != 2 :
month = ' 0 ' + str ( now . month )
else :
month = str ( now . month )
year = str ( now . year )
logger . fdebug ( ' month = ' + str ( month ) )
logger . fdebug ( ' year = ' + str ( year ) )
2014-05-29 18:05:11 +00:00
threading . Thread ( target = solicit . solicit , args = [ month , year ] ) . start ( )
2014-06-02 19:02:28 +00:00
raise cherrypy . HTTPRedirect ( " futurepulllist " )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
futurepull . exposed = True
def futurepulllist ( self ) :
myDB = db . DBConnection ( )
futureresults = [ ]
2014-01-29 19:24:53 +00:00
watchresults = [ ]
popthis = myDB . select ( " SELECT * FROM sqlite_master WHERE name= ' futureupcoming ' and type= ' table ' " )
if popthis :
l_results = myDB . select ( " SELECT * FROM futureupcoming WHERE Status= ' Wanted ' " )
for lres in l_results :
watchresults . append ( {
" ComicName " : lres [ ' ComicName ' ] ,
2015-05-22 08:32:51 +00:00
" IssueNumber " : lres [ ' IssueNumber ' ] ,
2014-01-29 19:24:53 +00:00
" ComicID " : lres [ ' ComicID ' ] ,
" IssueDate " : lres [ ' IssueDate ' ] ,
" Publisher " : lres [ ' Publisher ' ] ,
" Status " : lres [ ' Status ' ]
} )
logger . fdebug ( ' There are ' + str ( len ( watchresults ) ) + ' issues that you are watching for but are not on your watchlist yet. ' )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
popit = myDB . select ( " SELECT * FROM sqlite_master WHERE name= ' future ' and type= ' table ' " )
if popit :
f_results = myDB . select ( " SELECT SHIPDATE, PUBLISHER, ISSUE, COMIC, EXTRA, STATUS, ComicID, FutureID from future " )
for future in f_results :
x = None
if future [ ' ISSUE ' ] is None : break
try :
x = float ( future [ ' ISSUE ' ] )
except ValueError , e :
if ' au ' in future [ ' ISSUE ' ] . lower ( ) or ' ai ' in future [ ' ISSUE ' ] . lower ( ) or ' .inh ' in future [ ' ISSUE ' ] . lower ( ) or ' .now ' in future [ ' ISSUE ' ] . lower ( ) :
x = future [ ' ISSUE ' ]
if future [ ' EXTRA ' ] == ' N/A ' or future [ ' EXTRA ' ] == ' ' :
future_extra = ' '
else :
future_extra = future [ ' EXTRA ' ]
if ' (of ' in future [ ' EXTRA ' ] . lower ( ) :
future_extra = re . sub ( ' [ \ ( \ )] ' , ' ' , future [ ' EXTRA ' ] )
if x is not None :
2014-01-29 19:24:53 +00:00
#here we check the status to make sure it's ok since we loaded all the Watch For earlier.
chkstatus = future [ ' STATUS ' ]
for wr in watchresults :
if wr [ ' ComicName ' ] == future [ ' COMIC ' ] and wr [ ' IssueNumber ' ] == future [ ' ISSUE ' ] :
logger . info ( ' matched on Name: ' + wr [ ' ComicName ' ] + ' to ' + future [ ' COMIC ' ] )
logger . info ( ' matched on Issue: # ' + wr [ ' IssueNumber ' ] + ' to # ' + future [ ' ISSUE ' ] )
logger . info ( ' matched on ID: ' + str ( wr [ ' ComicID ' ] ) + ' to ' + str ( future [ ' ComicID ' ] ) )
chkstatus = wr [ ' Status ' ]
break
2015-05-22 08:32:51 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
futureresults . append ( {
2015-05-22 08:32:51 +00:00
" SHIPDATE " : future [ ' SHIPDATE ' ] ,
" PUBLISHER " : future [ ' PUBLISHER ' ] ,
" ISSUE " : future [ ' ISSUE ' ] ,
" COMIC " : future [ ' COMIC ' ] ,
" EXTRA " : future_extra ,
" STATUS " : chkstatus ,
" COMICID " : future [ ' ComicID ' ] ,
" FUTUREID " : future [ ' FutureID ' ]
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
} )
2015-05-22 08:32:51 +00:00
futureresults = sorted ( futureresults , key = itemgetter ( ' SHIPDATE ' , ' PUBLISHER ' , ' COMIC ' ) , reverse = False )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
else :
logger . error ( ' No results to post for upcoming issues...something is probably wrong ' )
return
return serve_template ( templatename = " futurepull.html " , title = " future Pull " , futureresults = futureresults , pullfilter = True )
futurepulllist . exposed = True
2014-11-21 17:16:28 +00:00
def add2futurewatchlist ( self , ComicName , Issue , Publisher , ShipDate , FutureID = None ) :
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
myDB = db . DBConnection ( )
2014-11-21 17:16:28 +00:00
if FutureID is not None :
chkfuture = myDB . selectone ( ' SELECT * FROM futureupcoming WHERE ComicName=? AND IssueNumber=? ' , [ ComicName , Issue ] ) . fetchone ( )
if chkfuture is not None :
logger . info ( ' Already on Future Upcoming list - not adding at this time. ' )
return
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
logger . info ( ' Adding ' + ComicName + ' # ' + str ( Issue ) + ' [ ' + Publisher + ' ] to future upcoming watchlist ' )
newCtrl = { " ComicName " : ComicName ,
" IssueNumber " : Issue ,
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
" Publisher " : Publisher }
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
newVal = { " Status " : " Wanted " ,
" IssueDate " : ShipDate }
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
myDB . upsert ( " futureupcoming " , newVal , newCtrl )
2015-05-22 08:32:51 +00:00
2014-11-21 17:16:28 +00:00
if FutureID is not None :
fCtrl = { " FutureID " : FutureID }
fVal = { " Status " : " Wanted " }
myDB . upsert ( " future " , fVal , fCtrl )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
add2futurewatchlist . exposed = True
2014-03-19 19:07:25 +00:00
def future_check ( self ) :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
weeklypull . future_check
raise cherrypy . HTTPRedirect ( " upcoming " )
2014-03-19 19:07:25 +00:00
future_check . exposed = True
2012-09-13 15:27:34 +00:00
def filterpull ( self ) :
myDB = db . DBConnection ( )
weeklyresults = myDB . select ( " SELECT * from weekly " )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
pulldate = myDB . selectone ( " SELECT * from weekly " ) . fetchone ( )
2012-09-13 15:27:34 +00:00
if pulldate is None :
raise cherrypy . HTTPRedirect ( " home " )
2013-01-28 20:31:43 +00:00
return serve_template ( templatename = " weeklypull.html " , title = " Weekly Pull " , weeklyresults = weeklyresults , pulldate = pulldate [ ' SHIPDATE ' ] , pullfilter = True )
2012-09-13 15:27:34 +00:00
filterpull . exposed = True
def manualpull ( self ) :
from mylar import weeklypull
2014-05-29 18:05:11 +00:00
threading . Thread ( target = weeklypull . pullit ) . start ( )
2012-09-13 15:27:34 +00:00
raise cherrypy . HTTPRedirect ( " pullist " )
manualpull . exposed = True
2013-04-08 16:31:41 +00:00
def pullrecreate ( self ) :
from mylar import weeklypull
myDB = db . DBConnection ( )
myDB . action ( " DROP TABLE weekly " )
mylar . dbcheck ( )
logger . info ( " Deleted existed pull-list data. Recreating Pull-list... " )
2014-05-29 18:05:11 +00:00
forcecheck = ' yes '
2014-06-04 18:53:33 +00:00
weeklypull . pullit ( forcecheck )
2013-04-08 16:31:41 +00:00
raise cherrypy . HTTPRedirect ( " pullist " )
pullrecreate . exposed = True
2012-09-13 15:27:34 +00:00
def upcoming ( self ) :
myDB = db . DBConnection ( )
#upcoming = myDB.select("SELECT * from issues WHERE ReleaseDate > date('now') order by ReleaseDate DESC")
2014-03-04 05:11:52 +00:00
upcomingdata = myDB . select ( " SELECT * from upcoming WHERE IssueID is NULL AND IssueNumber is not NULL AND ComicName is not NULL order by IssueDate DESC " )
if upcomingdata is None :
logger . info ( ' No upcoming data as of yet... ' )
else :
2014-03-19 19:07:25 +00:00
futureupcoming = [ ]
2014-03-04 05:11:52 +00:00
upcoming = [ ]
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
upcoming_count = 0
futureupcoming_count = 0
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
try :
pull_date = myDB . selectone ( " SELECT SHIPDATE from weekly " ) . fetchone ( )
logger . fdebug ( u " Weekly pull list present - retrieving pull-list date. " )
if ( pull_date is None ) :
pulldate = ' 00000000 '
else :
pulldate = pull_date [ ' SHIPDATE ' ]
2015-05-22 08:32:51 +00:00
except ( sqlite3 . OperationalError , TypeError ) , msg :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
logger . info ( u " Error Retrieving weekly pull list - attempting to adjust " )
pulldate = ' 00000000 '
2014-03-04 05:11:52 +00:00
for upc in upcomingdata :
2015-05-22 08:32:51 +00:00
if len ( upc [ ' IssueDate ' ] ) < = 7 :
2014-03-04 05:11:52 +00:00
#if it's less than or equal 7, then it's a future-pull so let's check the date and display
#tmpdate = datetime.datetime.com
tmpdatethis = upc [ ' IssueDate ' ]
if tmpdatethis [ : 2 ] == ' 20 ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
tmpdate = tmpdatethis + ' 01 ' #in correct format of yyyymm
2014-03-04 05:11:52 +00:00
else :
findst = tmpdatethis . find ( ' - ' ) #find the '-'
2015-05-22 08:32:51 +00:00
tmpdate = tmpdatethis [ findst + 1 : ] + tmpdatethis [ : findst ] + ' 01 ' #rebuild in format of yyyymm
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
#timenow = datetime.datetime.now().strftime('%Y%m')
2014-01-16 20:25:02 +00:00
else :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
#if it's greater than 7 it's a full date.
2014-03-04 05:11:52 +00:00
tmpdate = re . sub ( " [^0-9] " , " " , upc [ ' IssueDate ' ] ) #convert date to numerics only (should be in yyyymmdd)
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
timenow = datetime . datetime . now ( ) . strftime ( ' % Y % m %d ' ) #convert to yyyymmdd
#logger.fdebug('comparing pubdate of: ' + str(tmpdate) + ' to now date of: ' + str(timenow))
pulldate = re . sub ( " [^0-9] " , " " , pulldate ) #convert pulldate to numerics only (should be in yyyymmdd)
if int ( tmpdate ) > = int ( timenow ) and int ( tmpdate ) == int ( pulldate ) : #int(pulldate) <= int(timenow):
if upc [ ' Status ' ] == ' Wanted ' :
upcoming_count + = 1
upcoming . append ( { " ComicName " : upc [ ' ComicName ' ] ,
" IssueNumber " : upc [ ' IssueNumber ' ] ,
" IssueDate " : upc [ ' IssueDate ' ] ,
" ComicID " : upc [ ' ComicID ' ] ,
" IssueID " : upc [ ' IssueID ' ] ,
" Status " : upc [ ' Status ' ] ,
" DisplayComicName " : upc [ ' DisplayComicName ' ] } )
elif int ( tmpdate ) > = int ( timenow ) :
if len ( upc [ ' IssueDate ' ] ) < = 7 :
issuedate = tmpdate [ : 4 ] + ' - ' + tmpdate [ 4 : 6 ] + ' -00 '
else :
issuedate = upc [ ' IssueDate ' ]
if upc [ ' Status ' ] == ' Wanted ' :
futureupcoming_count + = 1
futureupcoming . append ( { " ComicName " : upc [ ' ComicName ' ] ,
" IssueNumber " : upc [ ' IssueNumber ' ] ,
" IssueDate " : issuedate ,
" ComicID " : upc [ ' ComicID ' ] ,
" IssueID " : upc [ ' IssueID ' ] ,
" Status " : upc [ ' Status ' ] ,
" DisplayComicName " : upc [ ' DisplayComicName ' ] } )
2015-05-22 08:32:51 +00:00
futureupcoming = sorted ( futureupcoming , key = itemgetter ( ' IssueDate ' , ' ComicName ' , ' IssueNumber ' ) , reverse = True )
2014-03-04 05:11:52 +00:00
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
issues = myDB . select ( " SELECT * from issues WHERE Status= ' Wanted ' " )
if mylar . UPCOMING_SNATCHED :
issues + = myDB . select ( " SELECT * from issues WHERE Status= ' Snatched ' " )
if mylar . FAILED_DOWNLOAD_HANDLING :
issues + = myDB . select ( " SELECT * from issues WHERE Status= ' Failed ' " )
2014-01-16 20:25:02 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
# isscnt = myDB.select("SELECT COUNT(*) FROM issues WHERE Status='Wanted' OR Status='Snatched'")
isCounts = { }
isCounts [ 1 ] = 0 #1 wanted
isCounts [ 2 ] = 0 #2 snatched
isCounts [ 3 ] = 0 #3 failed
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
2013-07-30 04:57:37 +00:00
ann_list = [ ]
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
ann_cnt = 0
2013-07-30 04:57:37 +00:00
if mylar . ANNUALS_ON :
#let's add the annuals to the wanted table so people can see them
#ComicName wasn't present in db initially - added on startup chk now.
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
annuals_list = myDB . select ( " SELECT * FROM annuals WHERE Status= ' Wanted ' " )
if mylar . UPCOMING_SNATCHED :
annuals_list + = myDB . select ( " SELECT * FROM annuals WHERE Status= ' Snatched ' " )
if mylar . FAILED_DOWNLOAD_HANDLING :
annuals_list + = myDB . select ( " SELECT * FROM annuals WHERE Status= ' Failed ' " )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
# anncnt = myDB.select("SELECT COUNT(*) FROM annuals WHERE Status='Wanted' OR Status='Snatched'")
# ann_cnt = anncnt[0][0]
2013-07-30 04:57:37 +00:00
ann_list + = annuals_list
issues + = annuals_list
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
for curResult in issues :
2015-05-22 08:32:51 +00:00
baseissues = { ' wanted ' : 1 , ' snatched ' : 2 , ' failed ' : 3 }
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
for seas in baseissues :
if curResult [ ' Status ' ] is None :
continue
else :
if seas in curResult [ ' Status ' ] . lower ( ) :
sconv = baseissues [ seas ]
isCounts [ sconv ] + = 1
continue
2015-05-22 08:32:51 +00:00
isCounts = { " Wanted " : str ( isCounts [ 1 ] ) ,
" Snatched " : str ( isCounts [ 2 ] ) ,
" Failed " : str ( isCounts [ 3 ] ) }
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
iss_cnt = int ( isCounts [ ' Wanted ' ] )
wantedcount = iss_cnt # + ann_cnt
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
2014-04-14 17:42:42 +00:00
#let's straightload the series that have no issue data associated as of yet (ie. new series) from the futurepulllist
2014-06-02 19:02:28 +00:00
future_nodata_upcoming = myDB . select ( " SELECT * FROM futureupcoming WHERE IssueNumber= ' 1 ' OR IssueNumber= ' 0 ' " )
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
#let's move any items from the upcoming table into the wanted table if the date has already passed.
2012-10-16 08:16:29 +00:00
#gather the list...
mvupcome = myDB . select ( " SELECT * from upcoming WHERE IssueDate < date( ' now ' ) order by IssueDate DESC " )
#get the issue ID's
for mvup in mvupcome :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
myissue = myDB . selectone ( " SELECT ComicName, Issue_Number, IssueID, ComicID FROM issues WHERE IssueID=? " , [ mvup [ ' IssueID ' ] ] ) . fetchone ( )
2013-05-15 09:09:43 +00:00
#myissue = myDB.action("SELECT * FROM issues WHERE Issue_Number=?", [mvup['IssueNumber']]).fetchone()
2012-10-16 08:16:29 +00:00
if myissue is None : pass
else :
2013-05-15 09:09:43 +00:00
logger . fdebug ( " --Updating Status of issues table because of Upcoming status-- " )
logger . fdebug ( " ComicName: " + str ( myissue [ ' ComicName ' ] ) )
2015-05-22 08:32:51 +00:00
logger . fdebug ( " Issue number : " + str ( myissue [ ' Issue_Number ' ] ) )
2014-01-29 19:24:53 +00:00
2012-10-16 08:16:29 +00:00
mvcontroldict = { " IssueID " : myissue [ ' IssueID ' ] }
2012-10-16 15:12:44 +00:00
mvvalues = { " ComicID " : myissue [ ' ComicID ' ] ,
2012-10-16 08:16:29 +00:00
" Status " : " Wanted " }
2012-10-18 07:08:43 +00:00
myDB . upsert ( " issues " , mvvalues , mvcontroldict )
2012-10-16 08:16:29 +00:00
2012-10-21 15:30:26 +00:00
#remove old entry from upcoming so it won't try to continually download again.
2014-04-14 17:42:42 +00:00
logger . fdebug ( ' [DELETE] - ' + mvup [ ' ComicName ' ] + ' issue #: ' + str ( mvup [ ' IssueNumber ' ] ) )
2015-05-22 08:32:51 +00:00
deleteit = myDB . action ( " DELETE from upcoming WHERE ComicName=? AND IssueNumber=? " , [ mvup [ ' ComicName ' ] , mvup [ ' IssueNumber ' ] ] )
2012-10-21 15:30:26 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
return serve_template ( templatename = " upcoming.html " , title = " Upcoming " , upcoming = upcoming , issues = issues , ann_list = ann_list , futureupcoming = futureupcoming , future_nodata_upcoming = future_nodata_upcoming , futureupcoming_count = futureupcoming_count , upcoming_count = upcoming_count , wantedcount = wantedcount , isCounts = isCounts )
2012-09-13 15:27:34 +00:00
upcoming . exposed = True
2012-09-24 05:17:29 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
def skipped2wanted ( self , comicid , fromupdate = None ) :
2013-01-23 07:34:50 +00:00
# change all issues for a given ComicID that are Skipped, into Wanted.
issuestowanted = [ ]
issuesnumwant = [ ]
myDB = db . DBConnection ( )
skipped2 = myDB . select ( " SELECT * from issues WHERE ComicID=? AND Status= ' Skipped ' " , [ comicid ] )
for skippy in skipped2 :
mvcontroldict = { " IssueID " : skippy [ ' IssueID ' ] }
mvvalues = { " Status " : " Wanted " }
#print ("Changing issue " + str(skippy['Issue_Number']) + " to Wanted.")
myDB . upsert ( " issues " , mvvalues , mvcontroldict )
issuestowanted . append ( skippy [ ' IssueID ' ] )
issuesnumwant . append ( skippy [ ' Issue_Number ' ] )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if len ( issuestowanted ) > 0 :
if fromupdate is None :
logger . info ( " Marking issues: %s as Wanted " % issuesnumwant )
threading . Thread ( target = search . searchIssueIDList , args = [ issuestowanted ] ) . start ( )
else :
logger . info ( ' Marking issues: %s as Wanted ' & issuesnumwant )
logger . info ( ' These will be searched for on next Search Scan / Force Check ' )
return
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % [ comicid ] )
2013-01-23 07:34:50 +00:00
skipped2wanted . exposed = True
2014-02-26 19:48:50 +00:00
def annualDelete ( self , comicid , ReleaseComicID = None ) :
2013-07-11 03:37:52 +00:00
myDB = db . DBConnection ( )
2014-02-26 19:48:50 +00:00
if ReleaseComicID is None :
myDB . action ( " DELETE FROM annuals WHERE ComicID=? " , [ comicid ] )
logger . fdebug ( " Deleted all annuals from DB for ComicID of " + str ( comicid ) )
else :
myDB . action ( " DELETE FROM annuals WHERE ReleaseComicID=? " , [ ReleaseComicID ] )
logger . fdebug ( " Deleted selected annual from DB with a ComicID of " + str ( ReleaseComicID ) )
2013-07-11 03:37:52 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % [ comicid ] )
annualDelete . exposed = True
2013-02-13 01:27:24 +00:00
def manualRename ( self , comicid ) :
if mylar . FILE_FORMAT == ' ' :
2013-02-27 08:28:40 +00:00
logger . error ( " You haven ' t specified a File Format in Configuration/Advanced " )
logger . error ( " Cannot rename files. " )
2013-02-13 01:27:24 +00:00
return
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
comic = myDB . selectone ( " SELECT * FROM comics WHERE ComicID=? " , [ comicid ] ) . fetchone ( )
2013-02-13 01:27:24 +00:00
comicdir = comic [ ' ComicLocation ' ]
comicname = comic [ ' ComicName ' ]
2015-01-16 19:40:08 +00:00
extensions = ( ' .cbr ' , ' .cbz ' , ' .cb7 ' )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issues = myDB . select ( " SELECT * FROM issues WHERE ComicID=? " , [ comicid ] )
2014-01-16 20:25:02 +00:00
if mylar . ANNUALS_ON :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issues + = myDB . select ( " SELECT * FROM annuals WHERE ComicID=? " , [ comicid ] )
2013-02-13 01:27:24 +00:00
comfiles = [ ]
2013-02-27 08:28:40 +00:00
filefind = 0
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
if mylar . MULTIPLE_DEST_DIRS is not None and mylar . MULTIPLE_DEST_DIRS != ' None ' and os . path . join ( mylar . MULTIPLE_DEST_DIRS , os . path . basename ( comicdir ) ) != comicdir :
logger . fdebug ( ' multiple_dest_dirs: ' + mylar . MULTIPLE_DEST_DIRS )
logger . fdebug ( ' dir: ' + comicdir )
logger . fdebug ( ' os.path.basename: ' + os . path . basename ( comicdir ) )
pathdir = os . path . join ( mylar . MULTIPLE_DEST_DIRS , os . path . basename ( comicdir ) )
2013-02-13 01:27:24 +00:00
for root , dirnames , filenames in os . walk ( comicdir ) :
for filename in filenames :
if filename . lower ( ) . endswith ( extensions ) :
2013-02-27 08:28:40 +00:00
#logger.info("filename being checked is : " + str(filename))
2013-02-13 01:27:24 +00:00
for issue in issues :
if issue [ ' Location ' ] == filename :
2013-02-27 08:28:40 +00:00
#logger.error("matched " + str(filename) + " to DB file " + str(issue['Location']))
2014-01-16 20:25:02 +00:00
if ' annual ' in issue [ ' Location ' ] . lower ( ) :
annualize = ' yes '
else :
annualize = None
renameiss = helpers . rename_param ( comicid , comicname , issue [ ' Issue_Number ' ] , filename , comicyear = None , issueid = None , annualize = annualize )
2013-02-13 01:27:24 +00:00
nfilename = renameiss [ ' nfilename ' ]
2015-05-22 08:32:51 +00:00
srciss = os . path . join ( comicdir , filename )
2013-05-25 06:18:00 +00:00
if mylar . LOWERCASE_FILENAMES :
2015-05-22 08:32:51 +00:00
dstiss = os . path . join ( comicdir , nfilename ) . lower ( )
2013-05-25 06:18:00 +00:00
else :
2015-05-22 08:32:51 +00:00
dstiss = os . path . join ( comicdir , nfilename )
2013-02-27 08:28:40 +00:00
if filename != nfilename :
logger . info ( " Renaming " + str ( filename ) + " ... to ... " + str ( nfilename ) )
try :
shutil . move ( srciss , dstiss )
except ( OSError , IOError ) :
logger . error ( " Failed to move files - check directories and manually re-run. " )
return
filefind + = 1
else :
logger . info ( " Not renaming " + str ( filename ) + " as it is in desired format already. " )
#continue
2013-03-08 01:36:36 +00:00
logger . info ( " I have renamed " + str ( filefind ) + " issues of " + comicname )
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
updater . forceRescan ( comicid )
2013-02-13 01:27:24 +00:00
manualRename . exposed = True
2013-01-28 20:31:43 +00:00
2012-09-24 05:17:29 +00:00
def searchScan ( self , name ) :
return serve_template ( templatename = " searchfix.html " , title = " Manage " , name = name )
searchScan . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def manage ( self ) :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
mylarRoot = mylar . DESTINATION_DIR
return serve_template ( templatename = " manage.html " , title = " Manage " , mylarRoot = mylarRoot )
2012-09-13 15:27:34 +00:00
manage . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-18 13:13:42 +00:00
def manageComics ( self ) :
2014-06-02 19:02:28 +00:00
comics = helpers . havetotals ( )
2012-09-18 13:13:42 +00:00
return serve_template ( templatename = " managecomics.html " , title = " Manage Comics " , comics = comics )
manageComics . exposed = True
2015-05-22 08:32:51 +00:00
2014-08-10 16:50:43 +00:00
def manageIssues ( self , * * kwargs ) :
2015-01-30 01:45:44 +00:00
#print kwargs
2014-08-10 16:50:43 +00:00
status = kwargs [ ' status ' ]
2015-01-30 01:45:44 +00:00
results = [ ]
2012-09-13 15:27:34 +00:00
myDB = db . DBConnection ( )
2014-08-10 16:50:43 +00:00
issues = myDB . select ( ' SELECT * from issues WHERE Status=? ' , [ status ] )
2015-01-30 01:45:44 +00:00
for iss in issues :
results . append ( iss )
annuals = myDB . select ( ' SELECT * from annuals WHERE Status=? ' , [ status ] )
return serve_template ( templatename = " manageissues.html " , title = " Manage " + str ( status ) + " Issues " , issues = results )
2012-09-18 13:13:42 +00:00
manageIssues . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def manageNew ( self ) :
myDB = db . DBConnection ( )
newcomics = myDB . select ( ' SELECT * from newartists ' )
return serve_template ( templatename = " managenew.html " , title = " Manage New Artists " , newcomics = newcomics )
2015-05-22 08:32:51 +00:00
manageNew . exposed = True
2013-05-06 02:34:01 +00:00
2013-05-19 05:21:32 +00:00
def flushImports ( self ) :
myDB = db . DBConnection ( )
2013-05-25 06:18:00 +00:00
myDB . action ( ' DELETE from importresults ' )
2013-05-19 05:21:32 +00:00
logger . info ( " Flushing all Import Results and clearing the tables " )
raise cherrypy . HTTPRedirect ( " importResults " )
flushImports . exposed = True
2013-05-06 02:34:01 +00:00
def markImports ( self , action = None , * * args ) :
myDB = db . DBConnection ( )
comicstoimport = [ ]
for ComicName in args :
if action == ' massimport ' :
logger . info ( " initiating mass import mode for " + ComicName )
cid = ComicName . decode ( ' utf-8 ' , ' replace ' )
comicstoimport . append ( cid )
2013-05-19 05:21:32 +00:00
elif action == ' removeimport ' :
logger . info ( " removing " + ComicName + " from the Import list " )
myDB . action ( ' DELETE from importresults WHERE ComicName=? ' , [ ComicName ] )
2013-05-06 02:34:01 +00:00
if len ( comicstoimport ) > 0 :
logger . debug ( " Mass importing the following series: %s " % comicstoimport )
threading . Thread ( target = self . preSearchit , args = [ None , comicstoimport , len ( comicstoimport ) ] ) . start ( )
raise cherrypy . HTTPRedirect ( " importResults " )
markImports . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-18 04:00:43 +00:00
def markComics ( self , action = None , * * args ) :
2012-09-13 15:27:34 +00:00
myDB = db . DBConnection ( )
2012-09-18 04:00:43 +00:00
comicsToAdd = [ ]
for ComicID in args :
2014-06-11 18:39:50 +00:00
if ComicID == ' manage_comic_length ' :
break
2012-09-13 15:27:34 +00:00
if action == ' delete ' :
2012-09-18 04:00:43 +00:00
myDB . action ( ' DELETE from comics WHERE ComicID=? ' , [ ComicID ] )
myDB . action ( ' DELETE from issues WHERE ComicID=? ' , [ ComicID ] )
2012-09-13 15:27:34 +00:00
elif action == ' pause ' :
2012-09-18 04:00:43 +00:00
controlValueDict = { ' ComicID ' : ComicID }
2012-09-13 15:27:34 +00:00
newValueDict = { ' Status ' : ' Paused ' }
2012-09-18 04:00:43 +00:00
myDB . upsert ( " comics " , newValueDict , controlValueDict )
2012-09-13 15:27:34 +00:00
elif action == ' resume ' :
2012-09-18 04:00:43 +00:00
controlValueDict = { ' ComicID ' : ComicID }
2012-09-13 15:27:34 +00:00
newValueDict = { ' Status ' : ' Active ' }
2015-05-22 08:32:51 +00:00
myDB . upsert ( " comics " , newValueDict , controlValueDict )
2012-09-13 15:27:34 +00:00
else :
2012-09-18 04:00:43 +00:00
comicsToAdd . append ( ComicID )
if len ( comicsToAdd ) > 0 :
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
logger . fdebug ( " Refreshing comics: %s " % comicsToAdd )
2013-07-01 05:19:15 +00:00
threading . Thread ( target = updater . dbUpdate , args = [ comicsToAdd ] ) . start ( )
2012-09-13 15:27:34 +00:00
raise cherrypy . HTTPRedirect ( " home " )
2012-09-18 04:00:43 +00:00
markComics . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def forceUpdate ( self ) :
from mylar import updater
threading . Thread ( target = updater . dbUpdate ) . start ( )
raise cherrypy . HTTPRedirect ( " home " )
forceUpdate . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def forceSearch ( self ) :
from mylar import search
threading . Thread ( target = search . searchforissue ) . start ( )
raise cherrypy . HTTPRedirect ( " home " )
forceSearch . exposed = True
def forceRescan ( self , ComicID ) :
threading . Thread ( target = updater . forceRescan , args = [ ComicID ] ) . start ( )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2012-09-13 15:27:34 +00:00
forceRescan . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def checkGithub ( self ) :
from mylar import versioncheck
versioncheck . checkGithub ( )
raise cherrypy . HTTPRedirect ( " home " )
checkGithub . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def history ( self ) :
myDB = db . DBConnection ( )
history = myDB . select ( ''' SELECT * from snatched order by DateAdded DESC ''' )
return serve_template ( templatename = " history.html " , title = " History " , history = history )
return page
history . exposed = True
2013-02-25 15:36:43 +00:00
2013-05-01 18:25:46 +00:00
def reOrder ( request ) :
2013-07-30 04:57:37 +00:00
return request
# return serve_template(templatename="reorder.html", title="ReoRdered!", reorder=request)
2013-05-01 18:25:46 +00:00
reOrder . exposed = True
2013-02-25 15:36:43 +00:00
def readlist ( self ) :
myDB = db . DBConnection ( )
2013-03-06 16:20:09 +00:00
issuelist = myDB . select ( " SELECT * from readlist " )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
#tuple this
readlist = [ ]
counts = [ ]
c_added = 0 #count of issues that have been added to the readlist and remain in that status ( meaning not sent / read )
c_sent = 0 #count of issues that have been sent to a third-party device ( auto-marked after a successful send completion )
c_read = 0 #count of issues that have been marked as read ( manually marked as read - future: read state from xml )
for iss in issuelist :
if iss [ ' Status ' ] == ' Added ' :
statuschange = iss [ ' DateAdded ' ]
c_added + = 1
else :
if iss [ ' Status ' ] == ' Read ' :
c_read + = 1
elif iss [ ' Status ' ] == ' Downloaded ' :
c_sent + = 1
statuschange = iss [ ' StatusChange ' ]
readlist . append ( { " ComicID " : iss [ ' ComicID ' ] ,
" ComicName " : iss [ ' ComicName ' ] ,
" SeriesYear " : iss [ ' SeriesYear ' ] ,
" Issue_Number " : iss [ ' Issue_Number ' ] ,
" IssueDate " : iss [ ' IssueDate ' ] ,
" Status " : iss [ ' Status ' ] ,
" StatusChange " : statuschange ,
" inCacheDIR " : iss [ ' inCacheDIR ' ] ,
" Location " : iss [ ' Location ' ] ,
" IssueID " : iss [ ' IssueID ' ] } )
counts = { " added " : c_added ,
" read " : c_read ,
" sent " : c_sent ,
" total " : ( c_added + c_read + c_sent ) }
return serve_template ( templatename = " readinglist.html " , title = " Reading Lists " , issuelist = readlist , counts = counts )
2013-02-25 15:36:43 +00:00
readlist . exposed = True
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
def storyarc_main ( self ) :
2013-03-02 01:41:45 +00:00
myDB = db . DBConnection ( )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
arclist = [ ]
alist = myDB . select ( " SELECT * from readinglist WHERE ComicName is not Null group by StoryArcID " ) #COLLATE NOCASE")
for al in alist :
totalcnt = myDB . select ( " SELECT * FROM readinglist WHERE StoryArcID=? " , [ al [ ' StoryArcID ' ] ] )
maxyear = 0
for la in totalcnt :
if la [ ' IssueYEAR ' ] != la [ ' SeriesYear ' ] and la [ ' IssueYEAR ' ] > la [ ' SeriesYear ' ] :
maxyear = la [ ' IssueYear ' ]
if maxyear == 0 :
spanyears = la [ ' SeriesYear ' ]
else :
spanyears = la [ ' SeriesYear ' ] + ' - ' + str ( maxyear )
havecnt = myDB . select ( " SELECT COUNT(*) as count FROM readinglist WHERE StoryArcID=? AND (Status= ' Downloaded ' or Status= ' Archived ' ) " , [ al [ ' StoryArcID ' ] ] )
havearc = havecnt [ 0 ] [ 0 ]
totalarc = int ( al [ ' TotalIssues ' ] )
if not havearc :
havearc = 0
try :
2015-05-22 08:32:51 +00:00
percent = ( havearc * 100.0 ) / totalarc
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
if percent > 100 :
percent = 101
except ( ZeroDivisionError , TypeError ) :
percent = 0
totalarc = ' ? '
arclist . append ( { " StoryArcID " : al [ ' StoryArcID ' ] ,
" StoryArc " : al [ ' StoryArc ' ] ,
" TotalIssues " : al [ ' TotalIssues ' ] ,
" SeriesYear " : al [ ' SeriesYear ' ] ,
" Status " : al [ ' Status ' ] ,
" percent " : percent ,
" Have " : havearc ,
" SpanYears " : spanyears ,
" Total " : al [ ' TotalIssues ' ] } )
return serve_template ( templatename = " storyarc.html " , title = " Story Arcs " , arclist = arclist )
storyarc_main . exposed = True
2015-05-22 08:32:51 +00:00
def detailStoryArc ( self , StoryArcID , StoryArcName ) :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
myDB = db . DBConnection ( )
arcinfo = myDB . select ( " SELECT * from readinglist WHERE StoryArcID=? order by ReadingOrder ASC " , [ StoryArcID ] )
return serve_template ( templatename = " storyarc_detail.html " , title = " Detailed Arc list " , readlist = arcinfo , storyarcname = StoryArcName , storyarcid = StoryArcID )
detailStoryArc . exposed = True
def markreads ( self , action = None , * * args ) :
sendtablet_queue = [ ]
myDB = db . DBConnection ( )
for IssueID in args :
if IssueID is None or ' issue_table ' in IssueID or ' issue_table_length ' in IssueID :
continue
else :
2015-05-22 08:32:51 +00:00
mi = myDB . selectone ( " SELECT * FROM readlist WHERE IssueID=? " , [ IssueID ] ) . fetchone ( )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
if mi is None :
continue
else :
comicname = mi [ ' ComicName ' ]
if action == ' Downloaded ' :
logger . fdebug ( u " Marking %s %s as %s " % ( comicname , mi [ ' Issue_Number ' ] , action ) )
read = readinglist . Readinglist ( IssueID )
read . addtoreadlist ( )
elif action == ' Read ' :
logger . fdebug ( u " Marking %s %s as %s " % ( comicname , mi [ ' Issue_Number ' ] , action ) )
markasRead ( IssueID )
elif action == ' Added ' :
logger . fdebug ( u " Marking %s %s as %s " % ( comicname , mi [ ' Issue_Number ' ] , action ) )
read = readinglist . Readinglist ( IssueID )
read . addtoreadlist ( )
elif action == ' Remove ' :
logger . fdebug ( ' Deleting %s %s ' % ( comicname , mi [ ' Issue_Number ' ] ) )
myDB . action ( ' DELETE from readlist WHERE IssueID=? ' , [ IssueID ] )
elif action == ' Send ' :
logger . fdebug ( ' Queuing ' + mi [ ' Location ' ] + ' to send to tablet. ' )
2015-03-28 21:53:18 +00:00
sendtablet_queue . append ( { " filepath " : mi [ ' Location ' ] ,
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
" issueid " : IssueID ,
" comicid " : mi [ ' ComicID ' ] } )
if len ( sendtablet_queue ) > 0 :
read = readinglist . Readinglist ( sendtablet_queue )
threading . Thread ( target = read . syncreading ) . start ( )
markreads . exposed = True
2013-03-02 01:41:45 +00:00
2013-04-22 03:11:12 +00:00
def removefromreadlist ( self , IssueID = None , StoryArcID = None , IssueArcID = None , AllRead = None ) :
2013-03-06 16:20:09 +00:00
myDB = db . DBConnection ( )
if IssueID :
myDB . action ( ' DELETE from readlist WHERE IssueID=? ' , [ IssueID ] )
logger . info ( " Removed " + str ( IssueID ) + " from Reading List " )
elif StoryArcID :
myDB . action ( ' DELETE from readinglist WHERE StoryArcID=? ' , [ StoryArcID ] )
2015-05-22 08:32:51 +00:00
stid = ' S ' + str ( StoryArcID ) + ' _ % '
2015-01-16 19:40:08 +00:00
#delete from the nzblog so it will always find the most current downloads. Nzblog has issueid, but starts with ArcID
myDB . action ( ' DELETE from nzblog WHERE IssueID LIKE ? ' , [ stid ] )
2013-03-06 16:20:09 +00:00
logger . info ( " Removed " + str ( StoryArcID ) + " from Story Arcs. " )
elif IssueArcID :
myDB . action ( ' DELETE from readinglist WHERE IssueArcID=? ' , [ IssueArcID ] )
logger . info ( " Removed " + str ( IssueArcID ) + " from the Story Arc. " )
2013-04-22 03:11:12 +00:00
elif AllRead :
myDB . action ( " DELETE from readlist WHERE Status= ' Read ' " )
logger . info ( " Removed All issues that have been marked as Read from Reading List " )
2013-03-06 16:20:09 +00:00
removefromreadlist . exposed = True
def markasRead ( self , IssueID = None , IssueArcID = None ) :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
read = readinglist . Readinglist ( IssueID , IssueArcID )
read . markasRead ( )
2013-03-06 16:20:09 +00:00
markasRead . exposed = True
2013-02-25 15:36:43 +00:00
def addtoreadlist ( self , IssueID ) :
2015-04-28 15:57:17 +00:00
read = readinglist . Readinglist ( IssueID = IssueID )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
read . addtoreadlist ( )
return
#raise cherrypy.HTTPRedirect("comicDetails?ComicID=%s" % readlist['ComicID'])
2013-02-25 15:36:43 +00:00
addtoreadlist . exposed = True
2013-03-02 01:41:45 +00:00
2015-05-22 08:32:51 +00:00
def importReadlist ( self , filename ) :
2013-03-02 01:41:45 +00:00
from xml . dom . minidom import parseString , Element
import random
myDB = db . DBConnection ( )
2013-07-30 04:57:37 +00:00
file = open ( filename )
2013-03-02 01:41:45 +00:00
data = file . read ( )
file . close ( )
dom = parseString ( data )
# of results
storyarc = dom . getElementsByTagName ( ' Name ' ) [ 0 ] . firstChild . wholeText
tracks = dom . getElementsByTagName ( ' Book ' )
i = 1
node = dom . documentElement
print ( " there are " + str ( len ( tracks ) ) + " issues in the story-arc: " + str ( storyarc ) )
#generate a random number for the ID, and tack on the total issue count to the end as a str :)
2015-05-22 08:32:51 +00:00
storyarcid = str ( random . randint ( 1000 , 9999 ) ) + str ( len ( tracks ) )
2013-03-02 01:41:45 +00:00
i = 1
for book_element in tracks :
2015-05-22 08:32:51 +00:00
st_issueid = str ( storyarcid ) + " _ " + str ( random . randint ( 1000 , 9999 ) )
2013-03-02 01:41:45 +00:00
comicname = book_element . getAttribute ( ' Series ' )
2013-03-08 01:36:36 +00:00
print ( " comic: " + comicname )
2013-03-02 01:41:45 +00:00
comicnumber = book_element . getAttribute ( ' Number ' )
print ( " number: " + str ( comicnumber ) )
comicvolume = book_element . getAttribute ( ' Volume ' )
print ( " volume: " + str ( comicvolume ) )
comicyear = book_element . getAttribute ( ' Year ' )
print ( " year: " + str ( comicyear ) )
CtrlVal = { " IssueArcID " : st_issueid }
NewVals = { " StoryArcID " : storyarcid ,
" ComicName " : comicname ,
" IssueNumber " : comicnumber ,
" SeriesYear " : comicvolume ,
" IssueYear " : comicyear ,
" StoryArc " : storyarc ,
" ReadingOrder " : i ,
" TotalIssues " : len ( tracks ) }
myDB . upsert ( " readinglist " , NewVals , CtrlVal )
i + = 1
2014-08-10 16:50:43 +00:00
# Now we either load in all of the issue data for series' already on the watchlist,
# or we dynamically load them from CV and write to the db.
#this loads in all the series' that have multiple entries in the current story arc.
Arc_MultipleSeries = myDB . select ( " SELECT * FROM readinglist WHERE StoryArcID=? AND IssueID is NULL GROUP BY ComicName HAVING (COUNT(ComicName) > 1) " , [ storyarcid ] )
2015-05-22 08:32:51 +00:00
2014-08-10 16:50:43 +00:00
if Arc_MultipleSeries is None :
logger . info ( ' Detected 0 series that have multiple entries in this Story Arc. Continuing. ' )
else :
AMS = [ ]
for Arc_MS in Arc_MultipleSeries :
2014-11-21 17:16:28 +00:00
print Arc_MS
2014-08-10 16:50:43 +00:00
#the purpose of this loop is to loop through the multiple entries, pulling out the lowest & highest issue numbers
#along with the publication years in order to help the auto-detector attempt to figure out what the series is on CV.
#.schema readinglist
2015-05-22 08:32:51 +00:00
#(StoryArcID TEXT, ComicName TEXT, IssueNumber TEXT, SeriesYear TEXT, IssueYEAR TEXT, StoryArc TEXT, TotalIssues TEXT,
2014-08-10 16:50:43 +00:00
# Status TEXT, inCacheDir TEXT, Location TEXT, IssueArcID TEXT, ReadingOrder INT, IssueID TEXT);
2014-11-21 17:16:28 +00:00
AMS . append ( { " StoryArcID " : Arc_MS [ ' StoryArcID ' ] ,
" ComicName " : Arc_MS [ ' ComicName ' ] ,
" SeriesYear " : Arc_MS [ ' SeriesYear ' ] ,
" IssueYear " : Arc_MS [ ' IssueYear ' ] ,
" IssueID " : Arc_MS [ ' IssueID ' ] ,
" highvalue " : ' 0 ' ,
" lowvalue " : ' 9999 ' ,
" yearRANGE " : [ str ( Arc_MS [ ' SeriesYear ' ] ) ] } ) #Arc_MS['SeriesYear']})
print str ( AMS )
for MSCheck in AMS :
thischk = myDB . select ( ' SELECT * FROM readinglist WHERE ComicName=? AND SeriesYear=? ' , [ MSCheck [ ' ComicName ' ] , MSCheck [ ' SeriesYear ' ] ] )
for tchk in thischk :
if helpers . issuedigits ( tchk [ ' IssueNumber ' ] ) > helpers . issuedigits ( MSCheck [ ' highvalue ' ] ) :
for key in MSCheck . keys ( ) :
2014-09-10 04:54:53 +00:00
if key == " highvalue " :
2014-11-21 17:16:28 +00:00
MSCheck [ key ] = tchk [ ' IssueNumber ' ]
if helpers . issuedigits ( tchk [ ' IssueNumber ' ] ) < helpers . issuedigits ( MSCheck [ ' lowvalue ' ] ) :
for key in MSCheck . keys ( ) :
if key == " lowvalue " :
MSCheck [ key ] = tchk [ ' IssueNumber ' ]
print str ( tchk [ ' IssueYear ' ] )
print str ( MSCheck [ ' yearRANGE ' ] )
if str ( tchk [ ' IssueYear ' ] ) not in str ( MSCheck [ ' yearRANGE ' ] ) :
for key in MSCheck . keys ( ) :
if key == " yearRANGE " :
MSCheck [ key ] . append ( str ( tchk [ ' IssueYear ' ] ) )
2015-05-22 08:32:51 +00:00
#write out here
2014-11-21 17:16:28 +00:00
print MSCheck
#now we load in the list without the multiple entries (ie. series that appear only once in the cbl and don't have an IssueID)
Arc_Issues = myDB . select ( " SELECT * FROM readinglist WHERE StoryArcID=? AND IssueID is NULL GROUP BY ComicName HAVING (COUNT(ComicName) = 1) " , [ storyarcid ] )
if Arc_Issues is None :
logger . fdebug ( ' No individual series detected within the Reading list (series that only appear once). ' )
else :
logger . fdebug ( ' Detected series that occur only once in the Reading List. ' )
for AI in Arc_Issues :
logger . fdebug ( ' Detected ' + AI [ ' ComicName ' ] + ' ( ' + AI [ ' SeriesYear ' ] + ' ) # ' + AI [ ' IssueNumber ' ] )
AMS . append ( { " StoryArcID " : AI [ ' StoryArcID ' ] ,
" ComicName " : AI [ ' ComicName ' ] ,
" SeriesYear " : AI [ ' SeriesYear ' ] ,
" IssueYear " : AI [ ' IssueYear ' ] ,
" IssueID " : AI [ ' IssueID ' ] ,
" highvalue " : AI [ ' IssueNumber ' ] ,
" lowvalue " : AI [ ' IssueNumber ' ] ,
" yearRANGE " : AI [ ' IssueYear ' ] } )
print ' AMS: ' + str ( AMS )
print ( ' I need to now try to populate ' + str ( len ( AMS ) ) + ' series. ' )
Arc_Data = [ ]
for duh in AMS :
mode = ' series '
sresults , explicit = mb . findComic ( duh [ ' ComicName ' ] , mode , issue = duh [ ' highvalue ' ] , limityear = duh [ ' yearRANGE ' ] , explicit = ' all ' )
type = ' comic '
2014-09-10 04:54:53 +00:00
2014-11-21 17:16:28 +00:00
if len ( sresults ) == 1 :
sr = sresults [ 0 ]
logger . info ( ' Only one result...automagik-mode enabled for ' + duh [ ' ComicName ' ] + ' :: ' + str ( sr [ ' comicid ' ] ) + ' :: Publisher : ' + str ( sr [ ' publisher ' ] ) )
2015-05-22 08:32:51 +00:00
issues = mylar . cv . getComic ( sr [ ' comicid ' ] , ' issue ' )
2014-11-21 17:16:28 +00:00
isscnt = len ( issues [ ' issuechoice ' ] )
logger . info ( ' isscnt : ' + str ( isscnt ) )
2015-05-22 08:32:51 +00:00
chklist = myDB . select ( ' SELECT * FROM readinglist WHERE StoryArcID=? AND ComicName=? AND SeriesYear=? ' , [ duh [ ' StoryArcID ' ] , duh [ ' ComicName ' ] , duh [ ' SeriesYear ' ] ] )
2014-11-21 17:16:28 +00:00
if chklist is None :
logger . error ( ' I did not find anything in the Story Arc. Something is probably wrong. ' )
continue
else :
n = 0
while ( n < = isscnt ) :
try :
islval = issues [ ' issuechoice ' ] [ n ]
except IndexError :
break
2014-08-10 16:50:43 +00:00
2014-11-21 17:16:28 +00:00
for d in chklist :
if islval [ ' Issue_Number ' ] == d [ ' IssueNumber ' ] :
logger . info ( ' [ ' + str ( islval [ ' Issue_ID ' ] ) + ' ] matched on Issue Number for ' + duh [ ' ComicName ' ] + ' # ' + str ( d [ ' IssueNumber ' ] ) )
logger . info ( ' I should write these dates: ' + islval [ ' Issue_Date ' ] + ' -- ' + islval [ ' Store_Date ' ] )
Arc_Data . append ( { " StoryArcID " : duh [ ' StoryArcID ' ] ,
" IssueArcID " : d [ ' IssueArcID ' ] ,
" ComicID " : islval [ ' Comic_ID ' ] ,
" IssueID " : islval [ ' Issue_ID ' ] ,
" Issue_Number " : islval [ ' Issue_Number ' ] ,
" Issue_Date " : islval [ ' Issue_Date ' ] ,
" Publisher " : sr [ ' publisher ' ] ,
" Store_Date " : islval [ ' Store_Date ' ] } )
break
n + = 1
#the below cresults will auto-add and cycle through until all are added to watchlist
#cresults = importer.addComictoDB(sr['comicid'],"no",None)
2014-08-10 16:50:43 +00:00
2014-11-21 17:16:28 +00:00
else :
logger . fdebug ( ' Returning results to screen - more than one possibility. ' )
resultset = 0
2014-08-10 16:50:43 +00:00
2014-11-21 17:16:28 +00:00
logger . info ( ' I need to update ' + str ( len ( Arc_Data ) ) + ' issues in this Reading List with CV Issue Data. ' )
if len ( Arc_Data ) > 0 :
for AD in Arc_Data :
newCtrl = { " IssueArcID " : AD [ ' IssueArcID ' ] }
newVals = { " ComicID " : AD [ ' ComicID ' ] ,
" IssueID " : AD [ ' IssueID ' ] ,
" Publisher " : AD [ ' Publisher ' ] ,
" IssueDate " : AD [ ' Issue_Date ' ] ,
" StoreDate " : AD [ ' Store_Date ' ] }
logger . info ( ' CTRLWRITE TO: ' + str ( newCtrl ) )
logger . info ( ' WRITING: ' + str ( newVals ) )
2014-08-10 16:50:43 +00:00
2014-11-21 17:16:28 +00:00
myDB . upsert ( " readinglist " , newVals , newCtrl )
2014-08-10 16:50:43 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
raise cherrypy . HTTPRedirect ( " detailStoryArc?StoryArcID= %s &StoryArcName= %s " % ( storyarcid , storyarc ) )
2013-03-02 01:41:45 +00:00
importReadlist . exposed = True
2013-03-06 16:20:09 +00:00
#Story Arc Ascension...welcome to the next level :)
2015-05-22 08:32:51 +00:00
def ArcWatchlist ( self , StoryArcID = None ) :
2013-03-06 16:20:09 +00:00
myDB = db . DBConnection ( )
2013-04-22 03:11:12 +00:00
if StoryArcID :
ArcWatch = myDB . select ( " SELECT * FROM readinglist WHERE StoryArcID=? " , [ StoryArcID ] )
else :
ArcWatch = myDB . select ( " SELECT * FROM readinglist " )
2013-03-06 16:20:09 +00:00
if ArcWatch is None : logger . info ( " No Story Arcs to search " )
else :
Comics = myDB . select ( " SELECT * FROM comics " )
arc_match = [ ]
2013-04-22 03:11:12 +00:00
wantedlist = [ ]
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
sarc_title = None
2015-05-22 08:32:51 +00:00
showonreadlist = 1 # 0 won't show storyarcissues on readinglist main page, 1 will show
2013-03-06 16:20:09 +00:00
for arc in ArcWatch :
2013-04-22 03:11:12 +00:00
logger . fdebug ( " arc: " + arc [ ' storyarc ' ] + " : " + arc [ ' ComicName ' ] + " : " + arc [ ' IssueNumber ' ] )
2013-03-06 16:20:09 +00:00
#cycle through the story arcs here for matches on the watchlist
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if sarc_title != arc [ ' storyarc ' ] :
2015-01-16 19:40:08 +00:00
if mylar . STORYARCDIR :
dstloc = os . path . join ( mylar . DESTINATION_DIR , ' StoryArcs ' , arc [ ' storyarc ' ] )
else :
dstloc = os . path . join ( mylar . DESTINATION_DIR , mylar . GRABBAG_DIR )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if os . path . isdir ( dstloc ) :
logger . info ( ' Validating Directory ( ' + dstloc + ' ). Already exists! Continuing... ' )
else :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' Updated Directory does not exist! - attempting to create now. ' )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
filechecker . validateAndCreateDirectory ( dstloc , True )
2013-03-06 16:20:09 +00:00
mod_arc = re . sub ( ' [ \ :/, \' \ / \ - \ & \ % \ $ \ # \ @ \ ! \ * \ + \ .] ' , ' ' , arc [ ' ComicName ' ] )
2013-04-22 03:11:12 +00:00
mod_arc = re . sub ( ' \\ bthe \\ b ' , ' ' , mod_arc . lower ( ) )
mod_arc = re . sub ( ' \\ band \\ b ' , ' ' , mod_arc . lower ( ) )
2015-05-22 08:32:51 +00:00
mod_arc = re . sub ( r ' \ s ' , ' ' , mod_arc )
2013-04-22 03:11:12 +00:00
matcheroso = " no "
2013-03-06 16:20:09 +00:00
for comic in Comics :
2013-04-22 03:11:12 +00:00
logger . fdebug ( " comic: " + comic [ ' ComicName ' ] )
2013-03-06 16:20:09 +00:00
mod_watch = re . sub ( ' [ \ : \ , \' \ / \ - \ & \ % \ $ \ # \ @ \ ! \ * \ + \ .] ' , ' ' , comic [ ' ComicName ' ] )
2013-04-22 03:11:12 +00:00
mod_watch = re . sub ( ' \\ bthe \\ b ' , ' ' , mod_watch . lower ( ) )
mod_watch = re . sub ( ' \\ band \\ b ' , ' ' , mod_watch . lower ( ) )
2013-03-06 16:20:09 +00:00
mod_watch = re . sub ( r ' \ s ' , ' ' , mod_watch )
2013-04-22 03:11:12 +00:00
if mod_watch == mod_arc : # and arc['SeriesYear'] == comic['ComicYear']:
2013-07-01 05:19:15 +00:00
logger . fdebug ( " initial name match - confirming issue # is present in series " )
2015-05-22 08:32:51 +00:00
if comic [ ' ComicID ' ] [ : 1 ] == ' G ' :
2013-04-22 03:11:12 +00:00
# if it's a multi-volume series, it's decimalized - let's get rid of the decimal.
GCDissue , whocares = helpers . decimal_issue ( arc [ ' IssueNumber ' ] )
GCDissue = int ( GCDissue ) / 1000
2013-04-26 03:45:02 +00:00
if ' . ' not in str ( GCDissue ) : GCDissue = str ( GCDissue ) + " .00 "
2013-04-22 03:11:12 +00:00
logger . fdebug ( " issue converted to " + str ( GCDissue ) )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
isschk = myDB . selectone ( " SELECT * FROM issues WHERE Issue_Number=? AND ComicID=? " , [ str ( GCDissue ) , comic [ ' ComicID ' ] ] ) . fetchone ( )
2013-04-22 03:11:12 +00:00
else :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issue_int = helpers . issuedigits ( arc [ ' IssueNumber ' ] )
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' int_issue = ' + str ( issue_int ) )
isschk = myDB . selectone ( " SELECT * FROM issues WHERE Int_IssueNumber=? AND ComicID=? AND STATUS != ' Snatched ' " , [ issue_int , comic [ ' ComicID ' ] ] ) . fetchone ( )
2013-04-22 03:11:12 +00:00
if isschk is None :
logger . fdebug ( " we matched on name, but issue " + str ( arc [ ' IssueNumber ' ] ) + " doesn ' t exist for " + comic [ ' ComicName ' ] )
else :
2013-07-01 05:19:15 +00:00
#this gets ugly - if the name matches and the issue, it could still be wrong series
#use series year to break it down further.
2013-09-18 04:49:24 +00:00
logger . fdebug ( ' COMIC-comicyear: ' + str ( int ( comic [ ' ComicYear ' ] ) ) )
logger . fdebug ( ' ARC-seriesyear: ' + str ( int ( arc [ ' SeriesYear ' ] ) ) )
2013-07-01 05:19:15 +00:00
if int ( comic [ ' ComicYear ' ] ) != int ( arc [ ' SeriesYear ' ] ) :
logger . fdebug ( " Series years are different - discarding match. " + str ( comic [ ' ComicYear ' ] ) + " != " + str ( arc [ ' SeriesYear ' ] ) )
2013-09-07 06:05:32 +00:00
else :
logger . fdebug ( " issue #: " + str ( arc [ ' IssueNumber ' ] ) + " is present! " )
2013-09-18 04:49:24 +00:00
logger . fdebug ( ' isschk: ' + str ( isschk ) )
logger . fdebug ( " Comicname: " + arc [ ' ComicName ' ] )
logger . fdebug ( " ComicID: " + str ( isschk [ ' ComicID ' ] ) )
logger . fdebug ( " Issue: " + str ( arc [ ' IssueNumber ' ] ) )
logger . fdebug ( " IssueArcID: " + str ( arc [ ' IssueArcID ' ] ) )
2013-09-07 06:05:32 +00:00
#gather the matches now.
2015-05-22 08:32:51 +00:00
arc_match . append ( {
2013-09-11 18:49:26 +00:00
" match_storyarc " : arc [ ' storyarc ' ] ,
2013-09-07 06:05:32 +00:00
" match_name " : arc [ ' ComicName ' ] ,
" match_id " : isschk [ ' ComicID ' ] ,
" match_issue " : arc [ ' IssueNumber ' ] ,
" match_issuearcid " : arc [ ' IssueArcID ' ] ,
2013-09-11 18:49:26 +00:00
" match_seriesyear " : comic [ ' ComicYear ' ] ,
2013-09-18 04:49:24 +00:00
" match_readingorder " : arc [ ' ReadingOrder ' ] ,
2013-09-11 18:49:26 +00:00
" match_filedirectory " : comic [ ' ComicLocation ' ] } )
2013-09-07 06:05:32 +00:00
matcheroso = " yes "
2013-09-11 18:49:26 +00:00
break
2013-04-22 03:11:12 +00:00
if matcheroso == " no " :
logger . fdebug ( " Unable to find a match for " + arc [ ' ComicName ' ] + " :# " + str ( arc [ ' IssueNumber ' ] ) )
wantedlist . append ( {
" ComicName " : arc [ ' ComicName ' ] ,
" IssueNumber " : arc [ ' IssueNumber ' ] ,
" IssueYear " : arc [ ' IssueYear ' ] } )
2015-01-16 19:40:08 +00:00
if mylar . STORYARCDIR :
dstloc = os . path . join ( mylar . DESTINATION_DIR , ' StoryArcs ' , arc [ ' storyarc ' ] )
else :
dstloc = mylar . GRABBAG_DIR
2013-09-18 04:49:24 +00:00
logger . fdebug ( ' destination location set to : ' + dstloc )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
2014-02-26 19:48:50 +00:00
filechk = filechecker . listFiles ( dstloc , arc [ ' ComicName ' ] , Publisher = None , sarc = ' true ' )
2013-09-18 04:49:24 +00:00
fn = 0
fccnt = filechk [ ' comiccount ' ]
while ( fn < fccnt ) :
haveissue = " no "
issuedupe = " no "
try :
tmpfc = filechk [ ' comiclist ' ] [ fn ]
except IndexError :
break
temploc = tmpfc [ ' JusttheDigits ' ] . replace ( ' _ ' , ' ' )
fcdigit = helpers . issuedigits ( arc [ ' IssueNumber ' ] )
int_iss = helpers . issuedigits ( temploc )
if int_iss == fcdigit :
logger . fdebug ( arc [ ' ComicName ' ] + ' Issue # ' + arc [ ' IssueNumber ' ] + ' already present in StoryArc directory. ' )
#update readinglist db to reflect status.
if mylar . READ2FILENAME :
readorder = helpers . renamefile_readingorder ( arc [ ' ReadingOrder ' ] )
dfilename = str ( readorder ) + " - " + tmpfc [ ' ComicFilename ' ]
else :
dfilename = tmpfc [ ' ComicFilename ' ]
newVal = { " Status " : " Downloaded " ,
" Location " : dfilename } #tmpfc['ComicFilename']}
2015-05-22 08:32:51 +00:00
ctrlVal = { " IssueArcID " : arc [ ' IssueArcID ' ] }
myDB . upsert ( " readinglist " , newVal , ctrlVal )
2013-09-18 04:49:24 +00:00
fn + = 1
2015-05-22 08:32:51 +00:00
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
sarc_title = arc [ ' storyarc ' ]
2015-05-22 08:32:51 +00:00
2013-04-22 03:11:12 +00:00
logger . fdebug ( " we matched on " + str ( len ( arc_match ) ) + " issues " )
2013-03-06 16:20:09 +00:00
for m_arc in arc_match :
#now we cycle through the issues looking for a match.
2015-05-22 08:32:51 +00:00
issue = myDB . selectone ( " SELECT * FROM issues where ComicID=? and Issue_Number=? " , [ m_arc [ ' match_id ' ] , m_arc [ ' match_issue ' ] ] ) . fetchone ( )
2013-04-07 18:06:36 +00:00
if issue is None : pass
else :
2015-05-11 08:14:47 +00:00
2013-04-07 18:06:36 +00:00
logger . fdebug ( " issue: " + str ( issue [ ' Issue_Number ' ] ) + " ... " + str ( m_arc [ ' match_issue ' ] ) )
# if helpers.decimal_issue(issuechk['Issue_Number']) == helpers.decimal_issue(m_arc['match_issue']):
if issue [ ' Issue_Number ' ] == m_arc [ ' match_issue ' ] :
logger . fdebug ( " we matched on " + str ( issue [ ' Issue_Number ' ] ) + " for " + str ( m_arc [ ' match_name ' ] ) )
2013-09-07 06:05:32 +00:00
if issue [ ' Status ' ] == ' Downloaded ' or issue [ ' Status ' ] == ' Archived ' or issue [ ' Status ' ] == ' Snatched ' :
2015-05-22 08:32:51 +00:00
ctrlVal = { " IssueArcID " : m_arc [ ' match_issuearcid ' ] }
2013-04-22 03:11:12 +00:00
newVal = { " Status " : issue [ ' Status ' ] ,
" IssueID " : issue [ ' IssueID ' ] }
if showonreadlist :
showctrlVal = { " IssueID " : issue [ ' IssueID ' ] }
shownewVal = { " ComicName " : issue [ ' ComicName ' ] ,
" Issue_Number " : issue [ ' Issue_Number ' ] ,
" IssueDate " : issue [ ' IssueDate ' ] ,
" SeriesYear " : m_arc [ ' match_seriesyear ' ] ,
" ComicID " : m_arc [ ' match_id ' ] }
myDB . upsert ( " readlist " , shownewVal , showctrlVal )
2015-05-22 08:32:51 +00:00
myDB . upsert ( " readinglist " , newVal , ctrlVal )
2013-04-22 03:11:12 +00:00
logger . info ( " Already have " + issue [ ' ComicName ' ] + " :# " + str ( issue [ ' Issue_Number ' ] ) )
2013-09-11 18:49:26 +00:00
if issue [ ' Status ' ] == ' Downloaded ' :
2013-09-18 04:49:24 +00:00
issloc = os . path . join ( m_arc [ ' match_filedirectory ' ] , issue [ ' Location ' ] )
logger . fdebug ( ' source location set to : ' + issloc )
2015-01-16 19:40:08 +00:00
if mylar . STORYARCDIR :
dstloc = os . path . join ( mylar . DESTINATION_DIR , ' StoryArcs ' , m_arc [ ' match_storyarc ' ] )
else :
dstloc = mylar . GRABBAG_DIR
2013-09-18 04:49:24 +00:00
logger . fdebug ( ' destination location set to : ' + dstloc )
2015-01-16 19:40:08 +00:00
if mylar . COPY2ARCDIR :
logger . fdebug ( ' attempting to copy into StoryArc directory ' )
#copy into StoryArc directory...
if os . path . isfile ( issloc ) :
if not os . path . isfile ( dstloc ) :
if mylar . READ2FILENAME :
readorder = helpers . renamefile_readingorder ( m_arc [ ' match_readingorder ' ] )
dfilename = str ( readorder ) + " - " + issue [ ' Location ' ]
else :
dfilename = issue [ ' Location ' ]
dstloc = os . path . join ( dstloc , dfilename )
logger . fdebug ( ' copying ' + issloc + ' to ' + dstloc )
shutil . copy ( issloc , dstloc )
2013-09-18 04:49:24 +00:00
else :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' destination file exists: ' + dstloc )
2013-09-11 18:49:26 +00:00
else :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' source file does not exist: ' + issloc )
2013-09-11 18:49:26 +00:00
2013-04-22 03:11:12 +00:00
else :
logger . fdebug ( " We don ' t have " + issue [ ' ComicName ' ] + " :# " + str ( issue [ ' Issue_Number ' ] ) )
2015-05-22 08:32:51 +00:00
ctrlVal = { " IssueArcID " : m_arc [ ' match_issuearcid ' ] }
2013-04-22 03:11:12 +00:00
newVal = { " Status " : " Wanted " ,
" IssueID " : issue [ ' IssueID ' ] }
2015-05-22 08:32:51 +00:00
myDB . upsert ( " readinglist " , newVal , ctrlVal )
2013-07-01 05:19:15 +00:00
logger . info ( " Marked " + issue [ ' ComicName ' ] + " :# " + str ( issue [ ' Issue_Number ' ] ) + " as Wanted. " )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
2015-05-22 08:32:51 +00:00
return
2013-04-22 03:11:12 +00:00
2013-03-06 16:20:09 +00:00
ArcWatchlist . exposed = True
2013-04-26 03:45:02 +00:00
def ReadGetWanted ( self , StoryArcID ) :
# this will queue up (ie. make 'Wanted') issues in a given Story Arc that are 'Not Watched'
2015-01-16 19:40:08 +00:00
#print StoryArcID
2013-07-01 05:19:15 +00:00
stupdate = [ ]
2013-09-07 06:05:32 +00:00
mode = ' story_arc '
2013-04-26 03:45:02 +00:00
myDB = db . DBConnection ( )
2013-07-01 05:19:15 +00:00
wantedlist = myDB . select ( " SELECT * FROM readinglist WHERE StoryArcID=? AND Status is Null " , [ StoryArcID ] )
2013-04-26 03:45:02 +00:00
if wantedlist is not None :
for want in wantedlist :
2015-01-16 19:40:08 +00:00
#print want
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issuechk = myDB . selectone ( " SELECT * FROM issues WHERE IssueID=? " , [ want [ ' IssueArcID ' ] ] ) . fetchone ( )
2013-07-01 05:19:15 +00:00
SARC = want [ ' StoryArc ' ]
IssueArcID = want [ ' IssueArcID ' ]
if issuechk is None :
# none means it's not a 'watched' series
2014-11-21 17:16:28 +00:00
s_comicid = want [ ' ComicID ' ] #None
s_issueid = want [ ' IssueID ' ] #None
stdate = want [ ' StoreDate ' ]
issdate = want [ ' IssueDate ' ]
2015-05-11 08:14:47 +00:00
logger . fdebug ( " -- NOT a watched series queue. " )
logger . fdebug ( want [ ' ComicName ' ] + " -- # " + str ( want [ ' IssueNumber ' ] ) )
logger . fdebug ( u " Story Arc : " + str ( SARC ) + " queueing the selected issue... " )
logger . fdebug ( u " IssueArcID : " + str ( IssueArcID ) )
logger . fdebug ( u " ComicID: " + str ( s_comicid ) + " --- IssueID: " + str ( s_issueid ) ) # no comicid in issues table.
logger . fdebug ( u " StoreDate: " + str ( stdate ) + " --- IssueDate: " + str ( issdate ) )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
#logger.info(u'Publisher: ' + want['Publisher']) <-- no publisher in issues table.
2015-05-11 08:14:47 +00:00
issueyear = want [ ' IssueYEAR ' ]
logger . fdebug ( ' IssueYear: ' + str ( issueyear ) )
if issueyear is None or issueyear == ' None ' :
try :
logger . fdebug ( ' issdate: ' + str ( issdate ) )
issueyear = issdate [ : 4 ]
if not issueyear . startswith ( ' 19 ' ) and not issueyear . startswith ( ' 20 ' ) :
issueyear = stdate [ : 4 ]
except :
issueyear = stdate [ : 4 ]
logger . fdebug ( ' ComicYear: ' + str ( want [ ' SeriesYear ' ] ) )
foundcom , prov = search . search_init ( ComicName = want [ ' ComicName ' ] , IssueNumber = want [ ' IssueNumber ' ] , ComicYear = issueyear , SeriesYear = want [ ' SeriesYear ' ] , Publisher = None , IssueDate = issdate , StoreDate = stdate , IssueID = s_issueid , SARC = SARC , IssueArcID = IssueArcID )
2013-07-01 05:19:15 +00:00
else :
# it's a watched series
2013-09-07 06:05:32 +00:00
s_comicid = issuechk [ ' ComicID ' ]
s_issueid = issuechk [ ' IssueID ' ]
2013-07-01 05:19:15 +00:00
logger . fdebug ( " -- watched series queue. " )
logger . fdebug ( issuechk [ ' ComicName ' ] + " -- # " + str ( issuechk [ ' Issue_Number ' ] ) )
2014-02-26 19:48:50 +00:00
foundcom , prov = search . search_init ( ComicName = issuechk [ ' ComicName ' ] , IssueNumber = issuechk [ ' Issue_Number ' ] , ComicYear = issuechk [ ' IssueYear ' ] , SeriesYear = issuechk [ ' SeriesYear ' ] , Publisher = None , IssueDate = None , StoreDate = issuechk [ ' ReleaseDate ' ] , IssueID = issuechk [ ' IssueID ' ] , AlternateSearch = None , UseFuzzy = None , ComicVersion = None , SARC = SARC , IssueArcID = IssueArcID )
2013-09-07 06:05:32 +00:00
2013-07-01 05:19:15 +00:00
if foundcom == " yes " :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' sucessfully found. ' )
2013-09-07 06:05:32 +00:00
#update the status - this is necessary for torrents as they are in 'snatched' status.
updater . foundsearch ( s_comicid , s_issueid , mode = mode , provider = prov , SARC = SARC , IssueArcID = IssueArcID )
2013-07-01 05:19:15 +00:00
else :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' not sucessfully found. ' )
2013-07-01 05:19:15 +00:00
stupdate . append ( { " Status " : " Wanted " ,
" IssueArcID " : IssueArcID ,
2015-05-11 08:14:47 +00:00
" IssueID " : s_issueid } )
2013-07-01 05:19:15 +00:00
watchlistchk = myDB . select ( " SELECT * FROM readinglist WHERE StoryArcID=? AND Status= ' Wanted ' " , [ StoryArcID ] )
if watchlistchk is not None :
for watchchk in watchlistchk :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' Watchlist hit - ' + str ( watchchk [ ' ComicName ' ] ) )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issuechk = myDB . selectone ( " SELECT * FROM issues WHERE IssueID=? " , [ watchchk [ ' IssueArcID ' ] ] ) . fetchone ( )
2013-07-01 05:19:15 +00:00
SARC = watchchk [ ' StoryArc ' ]
IssueArcID = watchchk [ ' IssueArcID ' ]
if issuechk is None :
# none means it's not a 'watched' series
2015-05-11 08:14:47 +00:00
try :
s_comicid = watchchk [ ' ComicID ' ]
except :
s_comicid = None
try :
s_issueid = watchchk [ ' IssueID ' ]
except :
s_issueid = None
2013-07-01 05:19:15 +00:00
logger . fdebug ( " -- NOT a watched series queue. " )
2013-09-07 06:05:32 +00:00
logger . fdebug ( watchchk [ ' ComicName ' ] + " -- # " + str ( watchchk [ ' IssueNumber ' ] ) )
2015-05-11 08:14:47 +00:00
logger . fdebug ( u " Story Arc : " + str ( SARC ) + " queueing up the selected issue... " )
logger . fdebug ( u " IssueArcID : " + str ( IssueArcID ) )
2015-01-16 19:40:08 +00:00
try :
issueyear = watchchk [ ' IssueYEAR ' ]
logger . fdebug ( ' issueYEAR : ' + issueyear )
except :
2015-05-11 08:14:47 +00:00
try :
issueyear = watchchk [ ' IssueDate ' ] [ : 4 ]
except :
issueyear = watchchk [ ' StoreDate ' ] [ : 4 ]
stdate = watchchk [ ' StoreDate ' ]
issdate = watchchk [ ' IssueDate ' ]
logger . fdebug ( ' issueyear : ' + str ( issueyear ) )
logger . fdebug ( ' comicname : ' + watchchk [ ' ComicName ' ] )
logger . fdebug ( ' issuenumber : ' + watchchk [ ' IssueNumber ' ] )
logger . fdebug ( ' comicyear : ' + watchchk [ ' SeriesYear ' ] )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
#logger.info('publisher : ' + watchchk['IssuePublisher']) <-- no publisher in table
2015-05-11 08:14:47 +00:00
logger . fdebug ( ' SARC : ' + SARC )
logger . fdebug ( ' IssueArcID : ' + IssueArcID )
foundcom , prov = search . search_init ( ComicName = watchchk [ ' ComicName ' ] , IssueNumber = watchchk [ ' IssueNumber ' ] , ComicYear = issueyear , SeriesYear = watchchk [ ' SeriesYear ' ] , Publisher = None , IssueDate = issdate , StoreDate = stdate , IssueID = s_issueid , SARC = SARC , IssueArcID = IssueArcID )
2013-07-01 05:19:15 +00:00
else :
# it's a watched series
2013-09-07 06:05:32 +00:00
s_comicid = issuechk [ ' ComicID ' ]
s_issueid = issuechk [ ' IssueID ' ]
2013-07-01 05:19:15 +00:00
logger . fdebug ( " -- watched series queue. " )
logger . fdebug ( issuechk [ ' ComicName ' ] + " -- # " + str ( issuechk [ ' Issue_Number ' ] ) )
2015-05-22 08:32:51 +00:00
foundcom , prov = search . search_init ( ComicName = issuechk [ ' ComicName ' ] , IssueNumber = issuechk [ ' Issue_Number ' ] , ComicYear = issuechk [ ' IssueYear ' ] , SeriesYear = issuechk [ ' SeriesYear ' ] , Publisher = None , IssueDate = None , StoreDate = issuechk [ ' ReleaseDate ' ] , IssueID = issuechk [ ' IssueID ' ] , AlternateSearch = None , UseFuzzy = None , ComicVersion = None , SARC = SARC , IssueArcID = IssueArcID , mode = None , rsscheck = None , ComicID = None )
2013-07-01 05:19:15 +00:00
if foundcom == " yes " :
2013-09-07 06:05:32 +00:00
updater . foundsearch ( s_comicid , s_issueid , mode = mode , provider = prov , SARC = SARC , IssueArcID = IssueArcID )
2013-07-01 05:19:15 +00:00
else :
2015-01-16 19:40:08 +00:00
logger . fdebug ( ' Watchlist issue not sucessfully found ' )
logger . fdebug ( ' issuearcid: ' + str ( IssueArcID ) )
logger . fdebug ( ' issueid: ' + str ( s_issueid ) )
2013-07-01 05:19:15 +00:00
stupdate . append ( { " Status " : " Wanted " ,
" IssueArcID " : IssueArcID ,
2013-09-07 06:05:32 +00:00
" IssueID " : s_issueid } )
2013-07-01 05:19:15 +00:00
if len ( stupdate ) > 0 :
2015-01-16 19:40:08 +00:00
logger . fdebug ( str ( len ( stupdate ) ) + ' issues need to get updated to Wanted Status ' )
2013-07-01 05:19:15 +00:00
for st in stupdate :
ctrlVal = { ' IssueArcID ' : st [ ' IssueArcID ' ] }
newVal = { ' Status ' : st [ ' Status ' ] }
if st [ ' IssueID ' ] :
2015-05-11 08:14:47 +00:00
if st [ ' IssueID ' ] :
logger . fdebug ( ' issueid: ' + str ( st [ ' IssueID ' ] ) )
2013-07-01 05:19:15 +00:00
newVal [ ' IssueID ' ] = st [ ' IssueID ' ]
myDB . upsert ( " readinglist " , newVal , ctrlVal )
2013-05-25 06:18:00 +00:00
ReadGetWanted . exposed = True
2013-04-22 03:11:12 +00:00
def ReadMassCopy ( self , StoryArcID , StoryArcName ) :
#this copies entire story arcs into the /cache/<storyarc> folder
#alternatively, it will copy the issues individually directly to a 3rd party device (ie.tablet)
2015-05-22 08:32:51 +00:00
myDB = db . DBConnection ( )
2013-04-22 03:11:12 +00:00
copylist = myDB . select ( " SELECT * FROM readlist WHERE StoryArcID=? AND Status= ' Downloaded ' " , [ StoryArcID ] )
if copylist is None :
logger . fdebug ( " You don ' t have any issues from " + StoryArcName + " . Aborting Mass Copy. " )
return
else :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
dst = os . path . join ( mylar . CACHE_DIR , StoryArcName )
2013-04-22 03:11:12 +00:00
for files in copylist :
2015-05-22 08:32:51 +00:00
2013-04-22 03:11:12 +00:00
copyloc = files [ ' Location ' ]
ReadMassCopy . exposed = True
2015-01-16 19:40:08 +00:00
def importLog ( self , ComicName , SRID = None ) :
2013-05-25 06:18:00 +00:00
myDB = db . DBConnection ( )
2015-01-16 19:40:08 +00:00
impchk = None
if SRID != ' None ' :
impchk = myDB . selectone ( " SELECT * FROM importresults WHERE SRID=? " , [ SRID ] ) . fetchone ( )
if impchk is None :
logger . error ( ' No associated log found for this ID : ' + SRID )
2013-05-25 06:18:00 +00:00
if impchk is None :
2015-01-16 19:40:08 +00:00
impchk = myDB . selectone ( " SELECT * FROM importresults WHERE ComicName=? " , [ ComicName ] ) . fetchone ( )
if impchk is None :
logger . error ( ' No associated log found for this ComicName : ' + ComicName )
return
2013-05-25 06:18:00 +00:00
2015-05-22 08:32:51 +00:00
implog = impchk [ ' implog ' ] . replace ( " \n " , " <br /> \n " )
2013-05-25 06:18:00 +00:00
return implog
# return serve_template(templatename="importlog.html", title="Log", implog=implog)
importLog . exposed = True
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
def logs ( self , log_level = None ) :
#if mylar.LOG_LEVEL is None or mylar.LOG_LEVEL == '' or log_level is None:
# mylar.LOG_LEVEL = 'INFO'
#else:
# mylar.LOG_LEVEL = log_level
return serve_template ( templatename = " logs.html " , title = " Log " , lineList = mylar . LOG_LIST , loglevel = mylar . LOG_LEVEL )
2012-09-13 15:27:34 +00:00
logs . exposed = True
2013-02-06 19:55:23 +00:00
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
def log_change ( self , log_level ) :
2013-04-22 03:11:12 +00:00
if log_level is not None :
print ( " changing logger to " + str ( log_level ) )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
raise cherrypy . HTTPRedirect ( " logs?log_level= %s " % log_level )
#return serve_template(templatename="logs.html", title="Log", lineList=log_list, log_level=loglevel) #lineList=mylar.LOG_LIST, log_level=log_level)
2013-02-06 19:55:23 +00:00
log_change . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def clearhistory ( self , type = None ) :
myDB = db . DBConnection ( )
if type == ' all ' :
logger . info ( u " Clearing all history " )
myDB . action ( ' DELETE from snatched ' )
else :
logger . info ( u " Clearing history where status is %s " % type )
myDB . action ( ' DELETE from snatched WHERE Status=? ' , [ type ] )
raise cherrypy . HTTPRedirect ( " history " )
clearhistory . exposed = True
2013-02-06 19:55:23 +00:00
2013-05-04 01:57:19 +00:00
def downloadLocal ( self , IssueID = None , IssueArcID = None , ReadOrder = None , dir = None ) :
2013-02-06 19:55:23 +00:00
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
issueDL = myDB . selectone ( " SELECT * FROM issues WHERE IssueID=? " , [ IssueID ] ) . fetchone ( )
2013-05-04 01:57:19 +00:00
comicid = issueDL [ ' ComicID ' ]
#print ("comicid: " + str(comicid))
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
comic = myDB . selectone ( " SELECT * FROM comics WHERE ComicID=? " , [ comicid ] ) . fetchone ( )
2013-05-04 01:57:19 +00:00
#---issue info
comicname = comic [ ' ComicName ' ]
issuenum = issueDL [ ' Issue_Number ' ]
issuedate = issueDL [ ' IssueDate ' ]
seriesyear = comic [ ' ComicYear ' ]
#---
issueLOC = comic [ ' ComicLocation ' ]
#print ("IssueLOC: " + str(issueLOC))
issueFILE = issueDL [ ' Location ' ]
#print ("IssueFILE: "+ str(issueFILE))
2015-05-22 08:32:51 +00:00
issuePATH = os . path . join ( issueLOC , issueFILE )
2013-05-04 01:57:19 +00:00
#print ("IssuePATH: " + str(issuePATH))
# if dir is None, it's a normal copy to cache kinda thing.
# if dir is a path, then it's coming from the pullist as the location to put all the weekly comics
if dir is not None :
dstPATH = dir
else :
2013-04-22 03:11:12 +00:00
dstPATH = os . path . join ( mylar . CACHE_DIR , issueFILE )
2013-05-04 01:57:19 +00:00
#print ("dstPATH: " + str(dstPATH))
if IssueID :
ISnewValueDict = { ' inCacheDIR ' : ' True ' ,
' Location ' : issueFILE }
2013-04-22 03:11:12 +00:00
if IssueArcID :
2015-05-22 08:32:51 +00:00
if mylar . READ2FILENAME :
2013-04-22 03:11:12 +00:00
#if it's coming from a StoryArc, check to see if we're appending the ReadingOrder to the filename
2015-05-22 08:32:51 +00:00
ARCissueFILE = ReadOrder + " - " + issueFILE
dstPATH = os . path . join ( mylar . CACHE_DIR , ARCissueFILE )
2013-05-04 01:57:19 +00:00
ISnewValueDict = { ' inCacheDIR ' : ' True ' ,
' Location ' : issueFILE }
2013-04-22 03:11:12 +00:00
# issueDL = myDB.action("SELECT * FROM readinglist WHERE IssueArcID=?", [IssueArcID]).fetchone()
# storyarcid = issueDL['StoryArcID']
# #print ("comicid: " + str(comicid))
# issueLOC = mylar.DESTINATION_DIR
# #print ("IssueLOC: " + str(issueLOC))
# issueFILE = issueDL['Location']
# #print ("IssueFILE: "+ str(issueFILE))
# issuePATH = os.path.join(issueLOC,issueFILE)
# #print ("IssuePATH: " + str(issuePATH))
# dstPATH = os.path.join(mylar.CACHE_DIR, issueFILE)
# #print ("dstPATH: " + str(dstPATH))
2013-05-04 01:57:19 +00:00
2013-02-17 10:31:18 +00:00
try :
shutil . copy2 ( issuePATH , dstPATH )
except IOError as e :
logger . error ( " Could not copy " + str ( issuePATH ) + " to " + str ( dstPATH ) + " . Copy to Cache terminated. " )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
2013-02-17 10:31:18 +00:00
logger . debug ( " sucessfully copied to cache...Enabling Download link " )
controlValueDict = { ' IssueID ' : IssueID }
2013-05-04 01:57:19 +00:00
RLnewValueDict = { ' inCacheDIR ' : ' True ' ,
' Location ' : issueFILE ,
' ComicID ' : comicid ,
' ComicName ' : comicname ,
' Issue_Number ' : issuenum ,
' SeriesYear ' : seriesyear ,
' IssueDate ' : issuedate }
myDB . upsert ( " readlist " , RLnewValueDict , controlValueDict )
myDB . upsert ( " issues " , ISnewValueDict , controlValueDict )
2013-04-22 03:11:12 +00:00
if IssueArcID :
controlValueD = { ' IssueArcID ' : IssueArcID }
newValueDict = { ' inCacheDIR ' : ' True ' ,
' Location ' : ARCissueFILE }
myDB . upsert ( " readinglist " , newValueDict , controlValueD )
2013-02-17 10:31:18 +00:00
#print("DB updated - Download link now enabled.")
2013-02-06 19:55:23 +00:00
downloadLocal . exposed = True
2013-05-04 01:57:19 +00:00
2014-06-09 07:55:05 +00:00
def MassWeeklyDownload ( self , pulldate , weekfolder = 0 , filename = None ) :
if filename is None :
mylar . WEEKFOLDER = int ( weekfolder )
mylar . config_write ( )
2013-05-04 04:40:32 +00:00
2013-05-04 01:57:19 +00:00
# this will download all downloaded comics from the weekly pull list and throw them
# into a 'weekly' pull folder for those wanting to transfer directly to a 3rd party device.
2015-05-22 08:32:51 +00:00
myDB = db . DBConnection ( )
2013-05-04 04:40:32 +00:00
if mylar . WEEKFOLDER :
desdir = os . path . join ( mylar . DESTINATION_DIR , pulldate )
if os . path . isdir ( desdir ) :
logger . info ( u " Directory ( " + desdir + " ) already exists! Continuing... " )
else :
logger . info ( " Directory doesn ' t exist! " )
try :
os . makedirs ( desdir )
logger . info ( u " Directory successfully created at: " + desdir )
except OSError :
logger . error ( u " Could not create comicdir : " + desdir )
logger . error ( u " Defaulting to : " + mylar . DESTINATION_DIR )
desdir = mylar . DESTINATION_DIR
else :
desdir = mylar . GRABBAG_DIR
2015-05-22 08:32:51 +00:00
2013-05-04 01:57:19 +00:00
clist = myDB . select ( " SELECT * FROM Weekly WHERE Status= ' Downloaded ' " )
if clist is None : # nothing on the list, just go go gone
logger . info ( " There aren ' t any issues downloaded from this week yet. " )
else :
2013-05-04 04:40:32 +00:00
iscount = 0
2013-05-04 01:57:19 +00:00
for cl in clist :
isslist = myDB . select ( " SELECT * FROM Issues WHERE ComicID=? AND Status= ' Downloaded ' " , [ cl [ ' ComicID ' ] ] )
if isslist is None : pass # no issues found for comicid - boo/boo
else :
for iss in isslist :
#go through issues downloaded until found one we want.
if iss [ ' Issue_Number ' ] == cl [ ' ISSUE ' ] :
2013-05-04 04:40:32 +00:00
self . downloadLocal ( iss [ ' IssueID ' ] , dir = desdir )
2015-05-22 08:32:51 +00:00
logger . info ( " Copied " + iss [ ' ComicName ' ] + " # " + str ( iss [ ' Issue_Number ' ] ) + " to " + desdir . encode ( ' utf-8 ' ) . strip ( ) )
2013-05-04 04:40:32 +00:00
iscount + = 1
2013-05-04 01:57:19 +00:00
break
2013-05-04 04:40:32 +00:00
logger . info ( " I have copied " + str ( iscount ) + " issues from this Week ' s pullist as requested. " )
raise cherrypy . HTTPRedirect ( " pullist " )
2013-05-04 01:57:19 +00:00
MassWeeklyDownload . exposed = True
2015-05-22 08:32:51 +00:00
def idirectory ( self ) :
2013-01-28 20:31:43 +00:00
return serve_template ( templatename = " idirectory.html " , title = " Import a Directory " )
idirectory . exposed = True
2015-05-22 08:32:51 +00:00
def confirmResult ( self , comicname , comicid ) :
2013-02-13 01:27:24 +00:00
#print ("here.")
mode = ' series '
2014-06-04 18:53:33 +00:00
sresults , explicit = mb . findComic ( comicname , mode , None , explicit = ' all ' )
2013-02-13 01:27:24 +00:00
#print sresults
type = ' comic '
2015-05-22 08:32:51 +00:00
return serve_template ( templatename = " searchresults.html " , title = ' Import Results for: " ' + comicname + ' " ' , searchresults = sresults , type = type , imported = ' confirm ' , ogcname = comicid , explicit = explicit )
2013-02-13 01:27:24 +00:00
confirmResult . exposed = True
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
def comicScan ( self , path , scan = 0 , libraryscan = 0 , redirect = None , autoadd = 0 , imp_move = 0 , imp_rename = 0 , imp_metadata = 0 ) :
2014-09-10 04:54:53 +00:00
import Queue
queue = Queue . Queue ( )
#save the values so they stick.
2013-01-28 20:31:43 +00:00
mylar . LIBRARYSCAN = libraryscan
mylar . ADD_COMICS = autoadd
mylar . COMIC_DIR = path
mylar . IMP_MOVE = imp_move
mylar . IMP_RENAME = imp_rename
2013-02-06 19:55:23 +00:00
mylar . IMP_METADATA = imp_metadata
2013-01-28 20:31:43 +00:00
mylar . config_write ( )
2014-09-10 04:54:53 +00:00
#thread the scan.
if scan == ' 1 ' : scan = True
else : scan = False
2015-05-22 08:32:51 +00:00
2014-09-10 04:54:53 +00:00
thread_ = threading . Thread ( target = librarysync . scanLibrary , name = " LibraryScan " , args = [ scan , queue ] )
thread_ . start ( )
thread_ . join ( )
chk = queue . get ( )
while True :
if chk [ 0 ] [ ' result ' ] == ' success ' :
2015-05-22 08:32:51 +00:00
yield chk [ 0 ] [ ' result ' ]
IMP: When scanning a folder using the Import a Directory option, upon completion a button to the Import Results Management page will be displayed to allow for easier access / acknowledgement of completion of scan, FIX: Fixed some issues with the search results page displaying too much information, IMP: Improved the ability to see alternate covers within issues when viewing selected issue details via the 'i' icon on the issue details page, IMP: Fixed the problem with issues that had 2015 dates and wouldn't scan in via manual post-processing, IMP: Added duplicate issue detection (beta) - enabled, when post-processing (manually or otherwise), will retain the issue that is bigger in filesize and won't post-process if it's smaller in size, instead of hammering the oldest copy, FIX: bunch of small fixes, and getting groundwork done for other things.
2014-12-18 18:30:57 +00:00
logger . info ( ' Successfully scanned in directory. Enabling the importResults button now. ' )
mylar . IMPORTBUTTON = True #globally set it to ON after the scan so that it will be picked up.
2014-09-10 04:54:53 +00:00
break
IMP: When scanning a folder using the Import a Directory option, upon completion a button to the Import Results Management page will be displayed to allow for easier access / acknowledgement of completion of scan, FIX: Fixed some issues with the search results page displaying too much information, IMP: Improved the ability to see alternate covers within issues when viewing selected issue details via the 'i' icon on the issue details page, IMP: Fixed the problem with issues that had 2015 dates and wouldn't scan in via manual post-processing, IMP: Added duplicate issue detection (beta) - enabled, when post-processing (manually or otherwise), will retain the issue that is bigger in filesize and won't post-process if it's smaller in size, instead of hammering the oldest copy, FIX: bunch of small fixes, and getting groundwork done for other things.
2014-12-18 18:30:57 +00:00
return
2013-01-28 20:31:43 +00:00
comicScan . exposed = True
def importResults ( self ) :
myDB = db . DBConnection ( )
2013-02-13 01:27:24 +00:00
results = myDB . select ( " SELECT * FROM importresults WHERE WatchMatch is Null OR WatchMatch LIKE ' C % ' group by ComicName COLLATE NOCASE " )
2013-02-25 15:36:43 +00:00
#this is to get the count of issues;
2015-01-24 08:33:54 +00:00
res = [ ]
countit = [ ]
2013-02-25 15:36:43 +00:00
for result in results :
2015-01-24 08:33:54 +00:00
res . append ( result )
for x in res :
countthis = myDB . select ( " SELECT count(*) FROM importresults WHERE ComicName=? " , [ x [ ' ComicName ' ] ] )
countit . append ( { " ComicName " : x [ ' ComicName ' ] ,
" IssueCount " : countthis [ 0 ] [ 0 ] } )
for ct in countit :
ctrlVal = { " ComicName " : ct [ ' ComicName ' ] }
newVal = { " IssueCount " : ct [ ' IssueCount ' ] }
2013-02-25 15:36:43 +00:00
myDB . upsert ( " importresults " , newVal , ctrlVal )
2015-01-24 08:33:54 +00:00
#logger.info("counted " + str(countit) + " issues for " + str(result['ComicName']))
2013-02-25 15:36:43 +00:00
#need to reload results now
results = myDB . select ( " SELECT * FROM importresults WHERE WatchMatch is Null OR WatchMatch LIKE ' C % ' group by ComicName COLLATE NOCASE " )
2013-02-13 01:27:24 +00:00
watchresults = myDB . select ( " SELECT * FROM importresults WHERE WatchMatch is not Null AND WatchMatch NOT LIKE ' C % ' group by ComicName COLLATE NOCASE " )
return serve_template ( templatename = " importresults.html " , title = " Import Results " , results = results , watchresults = watchresults )
2013-01-28 20:31:43 +00:00
importResults . exposed = True
2013-02-06 19:55:23 +00:00
2013-02-09 03:34:02 +00:00
def deleteimport ( self , ComicName ) :
myDB = db . DBConnection ( )
2013-03-08 01:36:36 +00:00
logger . info ( " Removing import data for Comic: " + ComicName )
2013-02-09 03:34:02 +00:00
myDB . action ( ' DELETE from importresults WHERE ComicName=? ' , [ ComicName ] )
raise cherrypy . HTTPRedirect ( " importResults " )
deleteimport . exposed = True
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
def preSearchit ( self , ComicName , comiclist = None , mimp = 0 , displaycomic = None ) :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
importlock = threading . Lock ( )
myDB = db . DBConnection ( )
2013-05-06 02:34:01 +00:00
if mimp == 0 :
comiclist = [ ]
2015-05-22 08:32:51 +00:00
comiclist . append ( ComicName )
2013-05-06 02:34:01 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
with importlock :
for cl in comiclist :
implog = ' '
implog = implog + " imp_rename: " + str ( mylar . IMP_RENAME ) + " \n "
implog = implog + " imp_move: " + str ( mylar . IMP_MOVE ) + " \n "
ComicName = cl
logger . info ( ' comicname is : ' + ComicName )
implog = implog + " comicName: " + str ( ComicName ) + " \n "
results = myDB . select ( " SELECT * FROM importresults WHERE ComicName=? " , [ ComicName ] )
if not results :
logger . info ( ' I cannot find any results. ' )
continue
#if results > 0:
# print ("There are " + str(results[7]) + " issues to import of " + str(ComicName))
#build the valid year ranges and the minimum issue# here to pass to search.
yearRANGE = [ ]
yearTOP = 0
minISSUE = 0
startISSUE = 10000000
starttheyear = None
comicstoIMP = [ ]
movealreadyonlist = " no "
movedata = [ ]
for result in results :
if result is None :
break
if result [ ' WatchMatch ' ] :
watchmatched = result [ ' WatchMatch ' ]
2013-05-06 02:34:01 +00:00
else :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
watchmatched = ' '
if watchmatched . startswith ( ' C ' ) :
implog = implog + " Confirmed. ComicID already provided - initiating auto-magik mode for import. \n "
comicid = result [ ' WatchMatch ' ] [ 1 : ]
implog = implog + result [ ' WatchMatch ' ] + " .to. " + str ( comicid ) + " \n "
#since it's already in the watchlist, we just need to move the files and re-run the filechecker.
#self.refreshArtist(comicid=comicid,imported='yes')
if mylar . IMP_MOVE :
implog = implog + " Mass import - Move files \n "
comloc = myDB . selectone ( " SELECT * FROM comics WHERE ComicID=? " , [ comicid ] ) . fetchone ( )
movedata_comicid = comicid
movedata_comiclocation = comloc [ ' ComicLocation ' ]
movedata_comicname = ComicName
movealreadyonlist = " yes "
#mylar.moveit.movefiles(comicid,comloc['ComicLocation'],ComicName)
#check for existing files... (this is already called after move files in importer)
#updater.forceRescan(comicid)
else :
implog = implog + " nothing to do if I ' m not moving. \n "
raise cherrypy . HTTPRedirect ( " importResults " )
else :
comicstoIMP . append ( result [ ' ComicLocation ' ] . decode ( mylar . SYS_ENCODING , ' replace ' ) )
getiss = result [ ' impID ' ] . rfind ( ' - ' )
2015-05-22 08:32:51 +00:00
getiss = result [ ' impID ' ] [ getiss + 1 : ]
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
imlog = implog + " figured issue is : " + str ( getiss ) + " \n "
if ( result [ ' ComicYear ' ] not in yearRANGE ) or ( yearRANGE is None ) :
if result [ ' ComicYear ' ] < > " 0000 " :
implog = implog + " adding... " + str ( result [ ' ComicYear ' ] ) + " \n "
yearRANGE . append ( str ( result [ ' ComicYear ' ] ) )
yearTOP = str ( result [ ' ComicYear ' ] )
getiss_num = helpers . issuedigits ( getiss )
miniss_num = helpers . issuedigits ( str ( minISSUE ) )
startiss_num = helpers . issuedigits ( str ( startISSUE ) )
if int ( getiss_num ) > int ( miniss_num ) :
implog = implog + " issue now set to : " + str ( getiss ) + " ... it was : " + str ( minISSUE ) + " \n "
logger . fdebug ( ' Minimum issue now set to : ' + str ( getiss ) + ' - it was : ' + str ( minISSUE ) )
minISSUE = str ( getiss )
if int ( getiss_num ) < int ( startiss_num ) :
implog = implog + " issue now set to : " + str ( getiss ) + " ... it was : " + str ( startISSUE ) + " \n "
logger . fdebug ( ' Start issue now set to : ' + str ( getiss ) + ' - it was : ' + str ( startISSUE ) )
startISSUE = str ( getiss )
if helpers . issuedigits ( startISSUE ) == 1000 : # if it's an issue #1, get the year and assume that's the start.
startyear = result [ ' ComicYear ' ]
#taking this outside of the transaction in an attempt to stop db locking.
if mylar . IMP_MOVE and movealreadyonlist == " yes " :
# for md in movedata:
mylar . moveit . movefiles ( movedata_comicid , movedata_comiclocation , movedata_comicname )
updater . forceRescan ( comicid )
raise cherrypy . HTTPRedirect ( " importResults " )
#figure out # of issues and the year range allowable
if starttheyear is None :
if yearTOP > 0 :
if helpers . int_num ( minISSUE ) < 1000 :
maxyear = int ( yearTOP )
else :
maxyear = int ( yearTOP ) - ( int ( minISSUE ) / 12 )
if str ( maxyear ) not in yearRANGE :
yearRANGE . append ( str ( maxyear ) )
implog = implog + " there is a " + str ( maxyear ) + " year variation based on the 12 issues/year \n "
2015-01-16 19:40:08 +00:00
else :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
implog = implog + " no year detected in any issues...Nulling the value \n "
yearRANGE = None
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
else :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
implog = implog + " First issue detected as starting in " + str ( starttheyear ) + " . Setting start range to that. \n "
yearRANGE . append ( starttheyear )
#determine a best-guess to # of issues in series
#this needs to be reworked / refined ALOT more.
#minISSUE = highest issue #, startISSUE = lowest issue #
numissues = helpers . int_num ( minISSUE ) - helpers . int_num ( startISSUE ) + 1 # add 1 to account for one issue itself.
#normally minissue would work if the issue #'s started at #1.
implog = implog + " the years involved are : " + str ( yearRANGE ) + " \n "
implog = implog + " highest issue # is : " + str ( minISSUE ) + " \n "
implog = implog + " lowest issue # is : " + str ( startISSUE ) + " \n "
implog = implog + " approximate number of issues : " + str ( numissues ) + " \n "
implog = implog + " issues present on system : " + str ( len ( comicstoIMP ) ) + " \n "
implog = implog + " versioning checking on filenames: \n "
cnsplit = ComicName . split ( )
#cnwords = len(cnsplit)
#cnvers = cnsplit[cnwords-1]
ogcname = ComicName
for splitt in cnsplit :
if ' v ' in str ( splitt ) :
implog = implog + " possible versioning detected. \n "
if splitt [ 1 : ] . isdigit ( ) :
implog = implog + splitt + " - assuming versioning. Removing from initial search pattern. \n "
ComicName = re . sub ( str ( splitt ) , ' ' , ComicName )
implog = implog + " new comicname is : " + ComicName + " \n "
# we need to pass the original comicname here into the entire importer module
# so that we can reference the correct issues later.
2015-05-22 08:32:51 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
mode = ' series '
displaycomic = helpers . filesafe ( ComicName )
logger . fdebug ( ' displaycomic : ' + displaycomic )
logger . fdebug ( ' comicname : ' + ComicName )
if yearRANGE is None :
sresults , explicit = mb . findComic ( displaycomic , mode , issue = numissues , explicit = ' all ' ) #ogcname, mode, issue=numissues, explicit='all') #ComicName, mode, issue=numissues)
else :
sresults , explicit = mb . findComic ( displaycomic , mode , issue = numissues , limityear = yearRANGE , explicit = ' all ' ) #ogcname, mode, issue=numissues, limityear=yearRANGE, explicit='all') #ComicName, mode, issue=numissues, limityear=yearRANGE)
type = ' comic '
2013-02-09 03:34:02 +00:00
2013-05-06 02:34:01 +00:00
if len ( sresults ) == 1 :
sr = sresults [ 0 ]
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
implog = implog + " only one result...automagik-mode enabled for " + displaycomic + " :: " + str ( sr [ ' comicid ' ] ) + " \n "
2015-01-16 19:40:08 +00:00
logger . fdebug ( " only one result...automagik-mode enabled for " + displaycomic + " :: " + str ( sr [ ' comicid ' ] ) )
2013-05-06 02:34:01 +00:00
resultset = 1
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
# #need to move the files here.
elif len ( sresults ) == 0 or len ( sresults ) is None :
implog = implog + " no results, removing the year from the agenda and re-querying. \n "
logger . fdebug ( " no results, removing the year from the agenda and re-querying. " )
sresults , explicit = mb . findComic ( ogcname , mode , issue = numissues , explicit = ' all ' ) #ComicName, mode, issue=numissues)
if len ( sresults ) == 1 :
sr = sresults [ 0 ]
implog = implog + " only one result...automagik-mode enabled for " + displaycomic + " :: " + str ( sr [ ' comicid ' ] ) + " \n "
logger . fdebug ( " only one result...automagik-mode enabled for " + displaycomic + " :: " + str ( sr [ ' comicid ' ] ) )
resultset = 1
2015-05-22 08:32:51 +00:00
else :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
resultset = 0
else :
implog = implog + " returning results to screen - more than one possibility. \n "
logger . fdebug ( " Returning results to Select option - more than one possibility, manual intervention required. " )
2013-05-06 02:34:01 +00:00
resultset = 0
2013-02-09 03:34:02 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
#generate random Search Results ID to allow for easier access for viewing logs / search results.
import random
2015-05-22 08:32:51 +00:00
SRID = str ( random . randint ( 100000 , 999999 ) )
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
#write implog to db here.
ctrlVal = { " ComicName " : ogcname } #{"ComicName": ComicName}
newVal = { " implog " : implog ,
" SRID " : SRID }
myDB . upsert ( " importresults " , newVal , ctrlVal )
# store the search results for series that returned more than one result for user to select later / when they want.
2015-05-22 08:32:51 +00:00
# should probably assign some random numeric for an id to reference back at some point.
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
for sr in sresults :
cVal = { " SRID " : SRID ,
" comicid " : sr [ ' comicid ' ] }
#should store ogcname in here somewhere to account for naming conversions above.
nVal = { " Series " : ComicName ,
" results " : len ( sresults ) ,
" publisher " : sr [ ' publisher ' ] ,
" haveit " : sr [ ' haveit ' ] ,
" name " : sr [ ' name ' ] ,
" deck " : sr [ ' deck ' ] ,
" url " : sr [ ' url ' ] ,
" description " : sr [ ' description ' ] ,
" comicimage " : sr [ ' comicimage ' ] ,
" issues " : sr [ ' issues ' ] ,
" ogcname " : ogcname ,
" comicyear " : sr [ ' comicyear ' ] }
myDB . upsert ( " searchresults " , nVal , cVal )
if resultset == 1 :
self . addbyid ( sr [ ' comicid ' ] , calledby = True , imported = ' yes ' , ogcname = ogcname )
#implog = implog + "ogcname -- " + str(ogcname) + "\n"
#cresults = self.addComic(comicid=sr['comicid'],comicname=sr['name'],comicyear=sr['comicyear'],comicpublisher=sr['publisher'],comicimage=sr['comicimage'],comicissues=sr['issues'],imported='yes',ogcname=ogcname) #imported=comicstoIMP,ogcname=ogcname)
#return serve_template(templatename="searchfix.html", title="Error Check", comicname=sr['name'], comicid=sr['comicid'], comicyear=sr['comicyear'], comicimage=sr['comicimage'], comicissues=sr['issues'], cresults=cresults, imported='yes', ogcname=str(ogcname))
#else:
#return serve_template(templatename="searchresults.html", title='Import Results for: "' + displaycomic + '"',searchresults=sresults, type=type, imported='yes', ogcname=ogcname, name=ogcname, explicit=explicit, serinfo=None) #imported=comicstoIMP, ogcname=ogcname)
#status update.
ctrlVal = { " ComicName " : ComicName }
newVal = { " Status " : ' Imported ' ,
" SRID " : SRID ,
" ComicID " : sr [ ' comicid ' ] }
2015-05-22 08:32:51 +00:00
myDB . upsert ( " importresults " , newVal , ctrlVal )
IMP: When scanning a folder using the Import a Directory option, upon completion a button to the Import Results Management page will be displayed to allow for easier access / acknowledgement of completion of scan, FIX: Fixed some issues with the search results page displaying too much information, IMP: Improved the ability to see alternate covers within issues when viewing selected issue details via the 'i' icon on the issue details page, IMP: Fixed the problem with issues that had 2015 dates and wouldn't scan in via manual post-processing, IMP: Added duplicate issue detection (beta) - enabled, when post-processing (manually or otherwise), will retain the issue that is bigger in filesize and won't post-process if it's smaller in size, instead of hammering the oldest copy, FIX: bunch of small fixes, and getting groundwork done for other things.
2014-12-18 18:30:57 +00:00
2013-02-06 19:55:23 +00:00
preSearchit . exposed = True
2015-05-22 08:32:51 +00:00
def importresults_popup ( self , SRID , ComicName , imported = None , ogcname = None ) :
2015-01-16 19:40:08 +00:00
myDB = db . DBConnection ( )
results = myDB . select ( " SELECT * FROM searchresults WHERE SRID=? " , [ SRID ] )
if results :
return serve_template ( templatename = " importresults_popup.html " , title = " results " , searchtext = ComicName , searchresults = results )
else :
logger . warn ( ' There are no search results to view for this entry ' + ComicName + ' [ ' + str ( SRID ) + ' ]. Something is probably wrong. ' )
return
importresults_popup . exposed = True
2014-01-16 20:25:02 +00:00
def pretty_git ( self , br_history ) :
#in order to 'prettify' the history log for display, we need to break it down so it's line by line.
2015-05-22 08:32:51 +00:00
br_split = br_history . split ( " \n " ) #split it on each commit
2014-01-16 20:25:02 +00:00
for br in br_split :
br_commit_st = br . find ( ' - ' ) #first - will represent end of commit numeric
br_commit = br [ : br_commit_st ] . strip ( )
br_time_en = br . replace ( ' - ' , ' XXX ' , 1 ) . find ( ' - ' ) #2nd - is end of time datestamp
2015-05-22 08:32:51 +00:00
br_time = br [ br_commit_st + 1 : br_time_en ] . strip ( )
2014-01-16 20:25:02 +00:00
print ' COMMIT: ' + str ( br_commit )
print ' TIME: ' + str ( br_time )
commit_split = br . split ( ) #split it by space to break it further down..
tag_chk = False
statline = ' '
commit = [ ]
for cs in commit_split :
if tag_chk == True :
if ' FIX: ' in cs or ' IMP: ' in cs :
commit . append ( { " commit " : br_commit ,
" time " : br_time ,
" stat " : tag_status ,
" line " : statline } )
print commit
tag_chk == False
statline = ' '
else :
2015-05-22 08:32:51 +00:00
statline + = str ( cs ) + ' '
2014-01-16 20:25:02 +00:00
else :
if ' FIX: ' in cs :
tag_status = ' FIX '
tag_chk = True
print ' status: ' + str ( tag_status )
elif ' IMP: ' in cs :
tag_status = ' IMPROVEMENT '
tag_chk = True
print ' status: ' + str ( tag_status )
pretty_git . exposed = True
2013-01-28 20:31:43 +00:00
#---
2012-09-13 15:27:34 +00:00
def config ( self ) :
interface_dir = os . path . join ( mylar . PROG_DIR , ' data/interfaces/ ' )
2015-05-22 08:32:51 +00:00
interface_list = [ name for name in os . listdir ( interface_dir ) if os . path . isdir ( os . path . join ( interface_dir , name ) ) ]
2014-01-16 20:25:02 +00:00
#----
# to be implemented in the future.
2013-01-13 15:59:46 +00:00
# branch_history, err = mylar.versioncheck.runGit("log --oneline --pretty=format:'%h - %ar - %s' -n 4")
2014-01-16 20:25:02 +00:00
# #here we pass the branch_history to the pretty_git module to break it down
2015-05-22 08:32:51 +00:00
# if branch_history:
2014-01-16 20:25:02 +00:00
# self.pretty_git(branch_history)
# br_hist = branch_history.replace("\n", "<br />\n")
# else:
# br_hist = err
#----
2013-02-17 10:31:18 +00:00
myDB = db . DBConnection ( )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
CCOMICS = myDB . select ( " SELECT COUNT(*) FROM comics " )
CHAVES = myDB . select ( " SELECT COUNT(*) FROM issues WHERE Status= ' Downloaded ' OR Status= ' Archived ' " )
CISSUES = myDB . select ( " SELECT COUNT(*) FROM issues " )
CSIZE = myDB . select ( " select SUM(ComicSize) from issues where Status= ' Downloaded ' or Status= ' Archived ' " )
2013-02-17 10:31:18 +00:00
COUNT_COMICS = CCOMICS [ 0 ] [ 0 ]
COUNT_HAVES = CHAVES [ 0 ] [ 0 ]
COUNT_ISSUES = CISSUES [ 0 ] [ 0 ]
2013-02-25 15:36:43 +00:00
COUNT_SIZE = helpers . human_size ( CSIZE [ 0 ] [ 0 ] )
2015-05-22 08:32:51 +00:00
comicinfo = { " COUNT_COMICS " : COUNT_COMICS ,
" COUNT_HAVES " : COUNT_HAVES ,
" COUNT_ISSUES " : COUNT_ISSUES ,
" COUNT_SIZE " : COUNT_SIZE }
config = {
" comicvine_api " : mylar . COMICVINE_API ,
" http_host " : mylar . HTTP_HOST ,
" http_user " : mylar . HTTP_USERNAME ,
" http_port " : mylar . HTTP_PORT ,
" http_pass " : mylar . HTTP_PASSWORD ,
" enable_https " : helpers . checked ( mylar . ENABLE_HTTPS ) ,
" https_cert " : mylar . HTTPS_CERT ,
" https_key " : mylar . HTTPS_KEY ,
" api_enabled " : helpers . checked ( mylar . API_ENABLED ) ,
" api_key " : mylar . API_KEY ,
" launch_browser " : helpers . checked ( mylar . LAUNCH_BROWSER ) ,
" auto_update " : helpers . checked ( mylar . AUTO_UPDATE ) ,
" logverbose " : helpers . checked ( mylar . LOGVERBOSE ) ,
" max_logsize " : mylar . MAX_LOGSIZE ,
" annuals_on " : helpers . checked ( mylar . ANNUALS_ON ) ,
" enable_check_folder " : helpers . checked ( mylar . ENABLE_CHECK_FOLDER ) ,
" check_folder " : mylar . CHECK_FOLDER ,
" download_scan_interval " : mylar . DOWNLOAD_SCAN_INTERVAL ,
" nzb_search_interval " : mylar . SEARCH_INTERVAL ,
" nzb_startup_search " : helpers . checked ( mylar . NZB_STARTUP_SEARCH ) ,
" libraryscan_interval " : mylar . LIBRARYSCAN_INTERVAL ,
" search_delay " : mylar . SEARCH_DELAY ,
" nzb_downloader_sabnzbd " : helpers . radio ( mylar . NZB_DOWNLOADER , 0 ) ,
" nzb_downloader_nzbget " : helpers . radio ( mylar . NZB_DOWNLOADER , 1 ) ,
" nzb_downloader_blackhole " : helpers . radio ( mylar . NZB_DOWNLOADER , 2 ) ,
" sab_host " : mylar . SAB_HOST ,
" sab_user " : mylar . SAB_USERNAME ,
" sab_api " : mylar . SAB_APIKEY ,
" sab_pass " : mylar . SAB_PASSWORD ,
" sab_cat " : mylar . SAB_CATEGORY ,
" sab_priority " : mylar . SAB_PRIORITY ,
" sab_directory " : mylar . SAB_DIRECTORY ,
" nzbget_host " : mylar . NZBGET_HOST ,
" nzbget_port " : mylar . NZBGET_PORT ,
" nzbget_user " : mylar . NZBGET_USERNAME ,
" nzbget_pass " : mylar . NZBGET_PASSWORD ,
" nzbget_cat " : mylar . NZBGET_CATEGORY ,
" nzbget_priority " : mylar . NZBGET_PRIORITY ,
" nzbget_directory " : mylar . NZBGET_DIRECTORY ,
" blackhole_dir " : mylar . BLACKHOLE_DIR ,
" usenet_retention " : mylar . USENET_RETENTION ,
" use_nzbsu " : helpers . checked ( mylar . NZBSU ) ,
" nzbsu_uid " : mylar . NZBSU_UID ,
" nzbsu_api " : mylar . NZBSU_APIKEY ,
" use_dognzb " : helpers . checked ( mylar . DOGNZB ) ,
" dognzb_api " : mylar . DOGNZB_APIKEY ,
" use_experimental " : helpers . checked ( mylar . EXPERIMENTAL ) ,
" use_newznab " : helpers . checked ( mylar . NEWZNAB ) ,
" newznab_host " : mylar . NEWZNAB_HOST ,
" newznab_name " : mylar . NEWZNAB_NAME ,
" newznab_api " : mylar . NEWZNAB_APIKEY ,
" newznab_uid " : mylar . NEWZNAB_UID ,
" newznab_enabled " : helpers . checked ( mylar . NEWZNAB_ENABLED ) ,
" extra_newznabs " : mylar . EXTRA_NEWZNABS ,
" enable_rss " : helpers . checked ( mylar . ENABLE_RSS ) ,
" rss_checkinterval " : mylar . RSS_CHECKINTERVAL ,
" provider_order " : mylar . PROVIDER_ORDER ,
" enable_torrents " : helpers . checked ( mylar . ENABLE_TORRENTS ) ,
" minseeds " : mylar . MINSEEDS ,
" torrent_local " : helpers . checked ( mylar . TORRENT_LOCAL ) ,
" local_watchdir " : mylar . LOCAL_WATCHDIR ,
" torrent_seedbox " : helpers . checked ( mylar . TORRENT_SEEDBOX ) ,
" seedbox_watchdir " : mylar . SEEDBOX_WATCHDIR ,
" seedbox_host " : mylar . SEEDBOX_HOST ,
" seedbox_port " : mylar . SEEDBOX_PORT ,
" seedbox_user " : mylar . SEEDBOX_USER ,
" seedbox_pass " : mylar . SEEDBOX_PASS ,
" enable_torrent_search " : helpers . checked ( mylar . ENABLE_TORRENT_SEARCH ) ,
" enable_kat " : helpers . checked ( mylar . ENABLE_KAT ) ,
" enable_32p " : helpers . checked ( mylar . ENABLE_32P ) ,
" legacymode_32p " : helpers . radio ( mylar . MODE_32P , 0 ) ,
" authmode_32p " : helpers . radio ( mylar . MODE_32P , 1 ) ,
" rssfeed_32p " : mylar . RSSFEED_32P ,
" passkey_32p " : mylar . PASSKEY_32P ,
" username_32p " : mylar . USERNAME_32P ,
" password_32p " : mylar . PASSWORD_32P ,
" snatchedtorrent_notify " : helpers . checked ( mylar . SNATCHEDTORRENT_NOTIFY ) ,
" destination_dir " : mylar . DESTINATION_DIR ,
" create_folders " : helpers . checked ( mylar . CREATE_FOLDERS ) ,
" chmod_dir " : mylar . CHMOD_DIR ,
" chmod_file " : mylar . CHMOD_FILE ,
" replace_spaces " : helpers . checked ( mylar . REPLACE_SPACES ) ,
" replace_char " : mylar . REPLACE_CHAR ,
" use_minsize " : helpers . checked ( mylar . USE_MINSIZE ) ,
" minsize " : mylar . MINSIZE ,
" use_maxsize " : helpers . checked ( mylar . USE_MAXSIZE ) ,
" maxsize " : mylar . MAXSIZE ,
" interface_list " : interface_list ,
" dupeconstraint " : mylar . DUPECONSTRAINT ,
" autowant_all " : helpers . checked ( mylar . AUTOWANT_ALL ) ,
" autowant_upcoming " : helpers . checked ( mylar . AUTOWANT_UPCOMING ) ,
" comic_cover_local " : helpers . checked ( mylar . COMIC_COVER_LOCAL ) ,
" pref_qual_0 " : helpers . radio ( int ( mylar . PREFERRED_QUALITY ) , 0 ) ,
" pref_qual_1 " : helpers . radio ( int ( mylar . PREFERRED_QUALITY ) , 1 ) ,
" pref_qual_2 " : helpers . radio ( int ( mylar . PREFERRED_QUALITY ) , 2 ) ,
" move_files " : helpers . checked ( mylar . MOVE_FILES ) ,
" rename_files " : helpers . checked ( mylar . RENAME_FILES ) ,
" folder_format " : mylar . FOLDER_FORMAT ,
" file_format " : mylar . FILE_FORMAT ,
" zero_level " : helpers . checked ( mylar . ZERO_LEVEL ) ,
" zero_level_n " : mylar . ZERO_LEVEL_N ,
" add_to_csv " : helpers . checked ( mylar . ADD_TO_CSV ) ,
" cvinfo " : helpers . checked ( mylar . CVINFO ) ,
" lowercase_filenames " : helpers . checked ( mylar . LOWERCASE_FILENAMES ) ,
" syno_fix " : helpers . checked ( mylar . SYNO_FIX ) ,
2013-02-18 17:39:00 +00:00
" 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 ) ,
2013-04-22 04:13:56 +00:00
" pushover_enabled " : helpers . checked ( mylar . PUSHOVER_ENABLED ) ,
" pushover_onsnatch " : helpers . checked ( mylar . PUSHOVER_ONSNATCH ) ,
" pushover_apikey " : mylar . PUSHOVER_APIKEY ,
" pushover_userkey " : mylar . PUSHOVER_USERKEY ,
" pushover_priority " : mylar . PUSHOVER_PRIORITY ,
2013-09-07 06:05:32 +00:00
" boxcar_enabled " : helpers . checked ( mylar . BOXCAR_ENABLED ) ,
" boxcar_onsnatch " : helpers . checked ( mylar . BOXCAR_ONSNATCH ) ,
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
" boxcar_token " : mylar . BOXCAR_TOKEN ,
" pushbullet_enabled " : helpers . checked ( mylar . PUSHBULLET_ENABLED ) ,
" pushbullet_onsnatch " : helpers . checked ( mylar . PUSHBULLET_ONSNATCH ) ,
" pushbullet_apikey " : mylar . PUSHBULLET_APIKEY ,
" pushbullet_deviceid " : mylar . PUSHBULLET_DEVICEID ,
2015-05-22 08:32:51 +00:00
" enable_extra_scripts " : helpers . checked ( mylar . ENABLE_EXTRA_SCRIPTS ) ,
" extra_scripts " : mylar . EXTRA_SCRIPTS ,
" post_processing " : helpers . checked ( mylar . POST_PROCESSING ) ,
" enable_meta " : helpers . checked ( mylar . ENABLE_META ) ,
" cmtagger_path " : mylar . CMTAGGER_PATH ,
" ct_tag_cr " : helpers . checked ( mylar . CT_TAG_CR ) ,
" ct_tag_cbl " : helpers . checked ( mylar . CT_TAG_CBL ) ,
" ct_cbz_overwrite " : helpers . checked ( mylar . CT_CBZ_OVERWRITE ) ,
" unrar_cmd " : mylar . UNRAR_CMD ,
" failed_download_handling " : helpers . checked ( mylar . FAILED_DOWNLOAD_HANDLING ) ,
" failed_auto " : helpers . checked ( mylar . FAILED_AUTO ) ,
" branch " : version . MYLAR_VERSION ,
" br_type " : mylar . INSTALL_TYPE ,
" br_version " : mylar . versioncheck . getVersion ( ) ,
" py_version " : platform . python_version ( ) ,
" data_dir " : mylar . DATA_DIR ,
" prog_dir " : mylar . PROG_DIR ,
" cache_dir " : mylar . CACHE_DIR ,
" config_file " : mylar . CONFIG_FILE ,
" branch_history " : ' None ' ,
2014-01-16 20:25:02 +00:00
# "branch_history" : br_hist,
2015-05-22 08:32:51 +00:00
" enable_pre_scripts " : helpers . checked ( mylar . ENABLE_PRE_SCRIPTS ) ,
" pre_scripts " : mylar . PRE_SCRIPTS ,
" log_dir " : mylar . LOG_DIR
2012-09-13 15:27:34 +00:00
}
2015-05-22 08:32:51 +00:00
return serve_template ( templatename = " config.html " , title = " Settings " , config = config , comicinfo = comicinfo )
2012-09-13 15:27:34 +00:00
config . exposed = True
2013-01-11 21:20:51 +00:00
2013-03-29 04:02:35 +00:00
def error_change ( self , comicid , errorgcd , comicname , comicyear , imported = None , mogcname = None ) :
2013-01-29 09:02:23 +00:00
# if comicname contains a "," it will break the exceptions import.
import urllib
b = urllib . unquote_plus ( comicname )
2013-03-06 16:20:09 +00:00
# cname = b.decode("utf-8")
cname = b . encode ( ' utf-8 ' )
2013-01-29 09:02:23 +00:00
cname = re . sub ( " \ , " , " " , cname )
2013-03-30 17:31:13 +00:00
if mogcname != None :
c = urllib . unquote_plus ( mogcname )
ogcname = c . encode ( ' utf-8 ' )
else :
ogcname = None
2013-03-29 04:02:35 +00:00
2013-01-11 21:20:51 +00:00
if errorgcd [ : 5 ] . isdigit ( ) :
2013-03-30 17:31:13 +00:00
logger . info ( " GCD-ID detected : " + str ( errorgcd ) [ : 5 ] )
logger . info ( " ogcname: " + str ( ogcname ) )
logger . info ( " I ' m assuming you know what you ' re doing - going to force-match for " + cname )
2015-05-22 08:32:51 +00:00
self . from_Exceptions ( comicid = comicid , gcdid = errorgcd , comicname = cname , comicyear = comicyear , imported = imported , ogcname = ogcname )
2013-01-11 21:20:51 +00:00
else :
2013-03-30 17:31:13 +00:00
logger . info ( " Assuming rewording of Comic - adjusting to : " + str ( errorgcd ) )
2015-05-22 08:32:51 +00:00
Err_Info = mylar . cv . getComic ( comicid , ' comic ' )
self . addComic ( comicid = comicid , comicname = str ( errorgcd ) , comicyear = Err_Info [ ' ComicYear ' ] , comicissues = Err_Info [ ' ComicIssues ' ] , comicpublisher = Err_Info [ ' ComicPublisher ' ] )
2013-01-11 21:20:51 +00:00
error_change . exposed = True
2014-02-26 19:48:50 +00:00
def manual_annual_add ( self , manual_comicid , comicname , comicyear , comicid , x = None , y = None ) :
import urllib
b = urllib . unquote_plus ( comicname )
cname = b . encode ( ' utf-8 ' )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
logger . fdebug ( ' comicid to be attached : ' + str ( manual_comicid ) )
logger . fdebug ( ' comicname : ' + str ( cname ) )
logger . fdebug ( ' comicyear : ' + str ( comicyear ) )
logger . fdebug ( ' comicid : ' + str ( comicid ) )
2014-02-26 19:48:50 +00:00
issueid = manual_comicid
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
logger . fdebug ( ' I will be adding ' + str ( issueid ) + ' to the Annual list for this series. ' )
threading . Thread ( target = importer . manualAnnual , args = [ manual_comicid , cname , comicyear , comicid ] ) . start ( )
2014-02-26 19:48:50 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % comicid )
manual_annual_add . exposed = True
2015-01-24 08:33:54 +00:00
def comic_config ( self , com_location , ComicID , alt_search = None , fuzzy_year = None , comic_version = None , force_continuing = None , alt_filename = None ) :
2012-09-28 15:39:44 +00:00
myDB = db . DBConnection ( )
2015-01-24 08:33:54 +00:00
#--- this is for multiple search terms............
2013-01-06 08:51:44 +00:00
#--- works, just need to redo search.py to accomodate multiple search terms
2013-07-30 04:57:37 +00:00
ffs_alt = [ ]
if ' ## ' in alt_search :
ffs = alt_search . find ( ' ## ' )
ffs_alt . append ( alt_search [ : ffs ] )
ffs_alt_st = str ( ffs_alt [ 0 ] )
2015-01-24 08:33:54 +00:00
logger . fdebug ( " ffs_alt: " + str ( ffs_alt [ 0 ] ) )
2013-07-30 04:57:37 +00:00
ffs_test = alt_search . split ( ' ## ' )
if len ( ffs_test ) > 0 :
2015-01-24 08:33:54 +00:00
logger . fdebug ( " ffs_test names: " + str ( len ( ffs_test ) ) )
2013-07-30 04:57:37 +00:00
ffs_count = len ( ffs_test )
n = 1
while ( n < ffs_count ) :
ffs_alt . append ( ffs_test [ n ] )
2015-01-24 08:33:54 +00:00
logger . fdebug ( " adding : " + str ( ffs_test [ n ] ) )
2013-07-30 04:57:37 +00:00
#print("ffs_alt : " + str(ffs_alt))
ffs_alt_st = str ( ffs_alt_st ) + " ... " + str ( ffs_test [ n ] )
n + = 1
asearch = ffs_alt
else :
asearch = alt_search
2013-01-06 08:51:44 +00:00
# ffs_alt = []
# if '+' in alt_search:
#find first +
# ffs = alt_search.find('+')
# ffs_alt.append(alt_search[:ffs])
# ffs_alt_st = str(ffs_alt[0])
# print("ffs_alt: " + str(ffs_alt[0]))
2015-05-22 08:32:51 +00:00
# split the entire string by the delimter +
2013-01-06 08:51:44 +00:00
# ffs_test = alt_search.split('+')
# if len(ffs_test) > 0:
# print("ffs_test names: " + str(len(ffs_test)))
# ffs_count = len(ffs_test)
# n=1
# while (n < ffs_count):
# ffs_alt.append(ffs_test[n])
# print("adding : " + str(ffs_test[n]))
#print("ffs_alt : " + str(ffs_alt))
# ffs_alt_st = str(ffs_alt_st) + "..." + str(ffs_test[n])
# n+=1
# asearch = ffs_alt
# else:
# asearch = alt_search
asearch = str ( alt_search )
2012-09-28 15:39:44 +00:00
controlValueDict = { ' ComicID ' : ComicID }
2015-05-22 08:32:51 +00:00
newValues = { " ComicLocation " : com_location }
2012-09-28 15:39:44 +00:00
#"QUALalt_vers": qual_altvers,
#"QUALScanner": qual_scanner,
#"QUALtype": qual_type,
#"QUALquality": qual_quality
#}
2013-01-18 07:32:05 +00:00
if asearch is not None :
2015-05-22 08:32:51 +00:00
if re . sub ( r ' \ s ' , ' ' , asearch ) == ' ' :
2013-01-18 07:32:05 +00:00
newValues [ ' AlternateSearch ' ] = " None "
else :
newValues [ ' AlternateSearch ' ] = str ( asearch )
2013-02-06 19:55:23 +00:00
else :
newValues [ ' AlternateSearch ' ] = " None "
2013-01-06 08:51:44 +00:00
2013-01-15 22:41:00 +00:00
if fuzzy_year is None :
newValues [ ' UseFuzzy ' ] = " 0 "
else :
newValues [ ' UseFuzzy ' ] = str ( fuzzy_year )
2015-05-22 08:32:51 +00:00
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
if comic_version is None or comic_version == ' None ' :
2013-03-08 03:07:14 +00:00
newValues [ ' ComicVersion ' ] = " None "
else :
if comic_version [ 1 : ] . isdigit ( ) and comic_version [ : 1 ] . lower ( ) == ' v ' :
newValues [ ' ComicVersion ' ] = str ( comic_version )
else :
logger . info ( " Invalid Versioning entered - it must be in the format of v# " )
newValues [ ' ComicVersion ' ] = " None "
2013-01-15 22:41:00 +00:00
2013-08-19 06:14:47 +00:00
if force_continuing is None :
newValues [ ' ForceContinuing ' ] = 0
else :
newValues [ ' ForceContinuing ' ] = 1
2015-01-24 08:33:54 +00:00
if alt_filename is None or alt_filename == ' None ' :
newValues [ ' AlternateFileName ' ] = " None "
else :
newValues [ ' AlternateFileName ' ] = str ( alt_filename )
2012-12-20 11:52:21 +00:00
#force the check/creation of directory com_location here
if os . path . isdir ( str ( com_location ) ) :
logger . info ( u " Validating Directory ( " + str ( com_location ) + " ). Already exists! Continuing... " )
else :
logger . fdebug ( " Updated Directory doesn ' t exist! - attempting to create now. " )
2013-04-22 03:43:57 +00:00
#try:
# os.makedirs(str(com_location))
# logger.info(u"Directory successfully created at: " + str(com_location))
#except OSError:
# logger.error(u"Could not create comicdir : " + str(com_location))
filechecker . validateAndCreateDirectory ( com_location , True )
2012-12-20 11:52:21 +00:00
2012-09-28 15:39:44 +00:00
myDB . upsert ( " comics " , newValues , controlValueDict )
2013-07-10 01:45:10 +00:00
raise cherrypy . HTTPRedirect ( " comicDetails?ComicID= %s " % ComicID )
2012-09-28 15:39:44 +00:00
comic_config . exposed = True
2013-05-25 06:18:00 +00:00
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
def readlistOptions ( self , send2read = 0 , tab_enable = 0 , tab_host = None , tab_user = None , tab_pass = None , tab_directory = None ) :
mylar . SEND2READ = int ( send2read )
mylar . TAB_ENABLE = int ( tab_enable )
mylar . TAB_HOST = tab_host
mylar . TAB_USER = tab_user
mylar . TAB_PASS = tab_pass
mylar . TAB_DIRECTORY = tab_directory
mylar . config_write ( )
raise cherrypy . HTTPRedirect ( " readlist " )
readlistOptions . exposed = True
2015-01-16 19:40:08 +00:00
def readOptions ( self , StoryArcID = None , StoryArcName = None , read2filename = 0 , storyarcdir = 0 , copy2arcdir = 0 ) :
2013-05-25 06:18:00 +00:00
mylar . READ2FILENAME = int ( read2filename )
mylar . STORYARCDIR = int ( storyarcdir )
2015-01-16 19:40:08 +00:00
mylar . COPY2ARCDIR = int ( copy2arcdir )
2013-05-25 06:18:00 +00:00
mylar . config_write ( )
#force the check/creation of directory com_location here
if mylar . STORYARCDIR :
arcdir = os . path . join ( mylar . DESTINATION_DIR , ' StoryArcs ' )
if os . path . isdir ( str ( arcdir ) ) :
logger . info ( u " Validating Directory ( " + str ( arcdir ) + " ). Already exists! Continuing... " )
else :
logger . fdebug ( " Updated Directory doesn ' t exist! - attempting to create now. " )
filechecker . validateAndCreateDirectory ( arcdir , True )
2014-11-21 17:16:28 +00:00
if StoryArcID is not None :
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
raise cherrypy . HTTPRedirect ( " detailStoryArc?StoryArcID= %s &StoryArcName= %s " % ( StoryArcID , StoryArcName ) )
2014-11-21 17:16:28 +00:00
else :
raise cherrypy . HTTPRedirect ( " readlist " )
2013-05-25 06:18:00 +00:00
readOptions . exposed = True
2015-05-22 08:32:51 +00:00
2015-01-25 02:26:22 +00:00
def configUpdate ( self , comicvine_api = None , http_host = ' 0.0.0.0 ' , http_username = None , http_port = 8090 , http_password = None , enable_https = 0 , https_cert = None , https_key = None , api_enabled = 0 , api_key = None , launch_browser = 0 , auto_update = 0 , logverbose = 0 , annuals_on = 0 , max_logsize = None , download_scan_interval = None , nzb_search_interval = None , nzb_startup_search = 0 , libraryscan_interval = None ,
2014-02-26 19:48:50 +00:00
nzb_downloader = 0 , 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_dir = None ,
nzbget_host = None , nzbget_port = None , nzbget_username = None , nzbget_password = None , nzbget_category = None , nzbget_priority = None , nzbget_directory = None ,
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
usenet_retention = None , nzbsu = 0 , nzbsu_uid = None , nzbsu_apikey = None , dognzb = 0 , dognzb_apikey = None , newznab = 0 , newznab_host = None , newznab_name = None , newznab_apikey = None , newznab_uid = None , newznab_enabled = 0 ,
2015-05-22 08:32:51 +00:00
raw = 0 , raw_provider = None , raw_username = None , raw_password = None , raw_groups = None , experimental = 0 , check_folder = None , enable_check_folder = 0 ,
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
enable_meta = 0 , cmtagger_path = None , ct_tag_cr = 0 , ct_tag_cbl = 0 , ct_cbz_overwrite = 0 , unrar_cmd = None , enable_rss = 0 , rss_checkinterval = None , failed_download_handling = 0 , failed_auto = 0 , enable_torrent_search = 0 , enable_kat = 0 , enable_32p = 0 , mode_32p = 0 , rssfeed_32p = None , passkey_32p = None , username_32p = None , password_32p = None , snatchedtorrent_notify = 0 ,
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
enable_torrents = 0 , minseeds = 0 , torrent_local = 0 , local_watchdir = None , torrent_seedbox = 0 , seedbox_watchdir = None , seedbox_user = None , seedbox_pass = None , seedbox_host = None , seedbox_port = None ,
prowl_enabled = 0 , prowl_onsnatch = 0 , prowl_keys = None , prowl_priority = None , nma_enabled = 0 , nma_apikey = None , nma_priority = 0 , nma_onsnatch = 0 , pushover_enabled = 0 , pushover_onsnatch = 0 , pushover_apikey = None , pushover_userkey = None , pushover_priority = None , boxcar_enabled = 0 , boxcar_onsnatch = 0 , boxcar_token = None ,
pushbullet_enabled = 0 , pushbullet_apikey = None , pushbullet_deviceid = None , pushbullet_onsnatch = 0 ,
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
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 , syno_fix = 0 , search_delay = None , chmod_dir = 0777 , chmod_file = 0660 ,
2015-01-16 19:40:08 +00:00
tsab = None , destination_dir = None , create_folders = 1 , 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 , dupeconstraint = None , * * kwargs ) :
2014-10-15 00:03:18 +00:00
mylar . COMICVINE_API = comicvine_api
2012-09-13 15:27:34 +00:00
mylar . HTTP_HOST = http_host
mylar . HTTP_PORT = http_port
mylar . HTTP_USERNAME = http_username
mylar . HTTP_PASSWORD = http_password
2015-01-25 02:26:22 +00:00
mylar . ENABLE_HTTPS = enable_https
mylar . HTTPS_CERT = https_cert
mylar . HTTPS_KEY = https_key
2014-02-26 19:48:50 +00:00
mylar . API_ENABLED = api_enabled
mylar . API_KEY = api_key
2012-09-13 15:27:34 +00:00
mylar . LAUNCH_BROWSER = launch_browser
2015-01-25 02:26:22 +00:00
mylar . AUTO_UPDATE = auto_update
2012-12-20 10:39:37 +00:00
mylar . LOGVERBOSE = logverbose
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
mylar . ANNUALS_ON = int ( annuals_on )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
mylar . MAX_LOGSIZE = max_logsize
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
mylar . ENABLE_CHECK_FOLDER = enable_check_folder
mylar . CHECK_FOLDER = check_folder
2012-09-13 15:27:34 +00:00
mylar . DOWNLOAD_SCAN_INTERVAL = download_scan_interval
mylar . SEARCH_INTERVAL = nzb_search_interval
2013-01-15 17:32:08 +00:00
mylar . NZB_STARTUP_SEARCH = nzb_startup_search
2012-09-13 15:27:34 +00:00
mylar . LIBRARYSCAN_INTERVAL = libraryscan_interval
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
mylar . SEARCH_DELAY = search_delay
2014-02-26 19:48:50 +00:00
mylar . NZB_DOWNLOADER = int ( nzb_downloader )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
if tsab :
logger . fdebug ( ' the truth will set you free. ' )
2015-05-22 08:32:51 +00:00
self . SABtest ( sab_host , sab_username , sab_password , sab_apikey )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
else :
logger . fdebug ( ' failure of the truth. ' )
mylar . SAB_HOST = sab_host
mylar . SAB_USERNAME = sab_username
mylar . SAB_PASSWORD = sab_password
mylar . SAB_APIKEY = sab_apikey
2012-09-13 15:27:34 +00:00
mylar . SAB_CATEGORY = sab_category
2012-09-28 15:39:44 +00:00
mylar . SAB_PRIORITY = sab_priority
2013-02-09 03:34:02 +00:00
mylar . SAB_DIRECTORY = sab_directory
2013-02-20 03:03:51 +00:00
mylar . NZBGET_HOST = nzbget_host
mylar . NZBGET_USERNAME = nzbget_username
mylar . NZBGET_PASSWORD = nzbget_password
mylar . NZBGET_PORT = nzbget_port
mylar . NZBGET_CATEGORY = nzbget_category
mylar . NZBGET_PRIORITY = nzbget_priority
2014-02-26 19:48:50 +00:00
mylar . NZBGET_DIRECTORY = nzbget_directory
2012-09-13 15:27:34 +00:00
mylar . BLACKHOLE_DIR = blackhole_dir
mylar . USENET_RETENTION = usenet_retention
mylar . NZBSU = nzbsu
2013-08-04 05:57:21 +00:00
mylar . NZBSU_UID = nzbsu_uid
2012-09-13 15:27:34 +00:00
mylar . NZBSU_APIKEY = nzbsu_apikey
mylar . DOGNZB = dognzb
mylar . DOGNZB_APIKEY = dognzb_apikey
mylar . RAW = raw
mylar . RAW_PROVIDER = raw_provider
mylar . RAW_USERNAME = raw_username
mylar . RAW_PASSWORD = raw_password
mylar . RAW_GROUPS = raw_groups
mylar . EXPERIMENTAL = experimental
2012-12-16 17:57:02 +00:00
mylar . NEWZNAB = newznab
2013-05-19 04:07:18 +00:00
#mylar.NEWZNAB_HOST = newznab_host
#mylar.NEWZNAB_APIKEY = newznab_apikey
#mylar.NEWZNAB_ENABLED = newznab_enabled
2013-07-30 04:57:37 +00:00
mylar . ENABLE_RSS = int ( enable_rss )
mylar . RSS_CHECKINTERVAL = rss_checkinterval
mylar . ENABLE_TORRENTS = int ( enable_torrents )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
mylar . MINSEEDS = int ( minseeds )
2013-07-30 04:57:37 +00:00
mylar . TORRENT_LOCAL = int ( torrent_local )
mylar . LOCAL_WATCHDIR = local_watchdir
mylar . TORRENT_SEEDBOX = int ( torrent_seedbox )
mylar . SEEDBOX_WATCHDIR = seedbox_watchdir
mylar . SEEDBOX_HOST = seedbox_host
mylar . SEEDBOX_PORT = seedbox_port
mylar . SEEDBOX_USER = seedbox_user
mylar . SEEDBOX_PASS = seedbox_pass
mylar . ENABLE_TORRENT_SEARCH = int ( enable_torrent_search )
mylar . ENABLE_KAT = int ( enable_kat )
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
mylar . ENABLE_32P = int ( enable_32p )
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
mylar . MODE_32P = int ( mode_32p )
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
mylar . RSSFEED_32P = rssfeed_32p
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
mylar . PASSKEY_32P = passkey_32p
mylar . USERNAME_32P = username_32p
mylar . PASSWORD_32P = password_32p
2014-06-02 19:02:28 +00:00
mylar . SNATCHEDTORRENT_NOTIFY = int ( snatchedtorrent_notify )
2012-09-13 15:27:34 +00:00
mylar . PREFERRED_QUALITY = int ( preferred_quality )
mylar . MOVE_FILES = move_files
mylar . RENAME_FILES = rename_files
2012-09-14 17:29:01 +00:00
mylar . REPLACE_SPACES = replace_spaces
mylar . REPLACE_CHAR = replace_char
2012-10-30 10:43:01 +00:00
mylar . ZERO_LEVEL = zero_level
mylar . ZERO_LEVEL_N = zero_level_n
2013-01-15 17:32:08 +00:00
mylar . ADD_TO_CSV = add_to_csv
2013-01-23 08:22:22 +00:00
mylar . CVINFO = cvinfo
2013-01-14 05:12:59 +00:00
mylar . LOWERCASE_FILENAMES = lowercase_filenames
2013-03-06 16:20:09 +00:00
mylar . SYNO_FIX = syno_fix
2013-02-18 17:39:00 +00:00
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
2013-04-22 04:13:56 +00:00
mylar . PUSHOVER_ENABLED = pushover_enabled
mylar . PUSHOVER_APIKEY = pushover_apikey
mylar . PUSHOVER_USERKEY = pushover_userkey
mylar . PUSHOVER_PRIORITY = pushover_priority
mylar . PUSHOVER_ONSNATCH = pushover_onsnatch
2013-09-07 06:05:32 +00:00
mylar . BOXCAR_ENABLED = boxcar_enabled
mylar . BOXCAR_ONSNATCH = boxcar_onsnatch
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
mylar . BOXCAR_TOKEN = boxcar_token
mylar . PUSHBULLET_ENABLED = pushbullet_enabled
mylar . PUSHBULLET_APIKEY = pushbullet_apikey
mylar . PUSHBULLET_DEVICEID = pushbullet_deviceid
mylar . PUSHBULLET_ONSNATCH = pushbullet_onsnatch
2013-01-13 15:59:46 +00:00
mylar . USE_MINSIZE = use_minsize
mylar . MINSIZE = minsize
mylar . USE_MAXSIZE = use_maxsize
mylar . MAXSIZE = maxsize
2015-05-22 08:32:51 +00:00
if folder_format . startswith ( ' / ' ) :
2015-04-28 02:15:53 +00:00
folder_format = re . sub ( ' / ' , ' ' , folder_format ) . strip ( )
2012-09-13 15:27:34 +00:00
mylar . FOLDER_FORMAT = folder_format
mylar . FILE_FORMAT = file_format
mylar . DESTINATION_DIR = destination_dir
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
mylar . CREATE_FOLDERS = create_folders
2012-09-13 15:27:34 +00:00
mylar . AUTOWANT_ALL = autowant_all
mylar . AUTOWANT_UPCOMING = autowant_upcoming
2012-12-27 15:04:03 +00:00
mylar . COMIC_COVER_LOCAL = comic_cover_local
2012-09-13 15:27:34 +00:00
mylar . INTERFACE = interface
2015-01-16 19:40:08 +00:00
mylar . DUPECONSTRAINT = dupeconstraint
2012-12-27 15:04:03 +00:00
mylar . ENABLE_EXTRA_SCRIPTS = enable_extra_scripts
mylar . EXTRA_SCRIPTS = extra_scripts
2013-01-13 17:10:41 +00:00
mylar . ENABLE_PRE_SCRIPTS = enable_pre_scripts
2013-02-13 01:27:24 +00:00
mylar . POST_PROCESSING = post_processing
2013-01-13 17:10:41 +00:00
mylar . PRE_SCRIPTS = pre_scripts
2013-07-01 05:19:15 +00:00
mylar . ENABLE_META = enable_meta
mylar . CMTAGGER_PATH = cmtagger_path
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
mylar . CT_TAG_CR = ct_tag_cr
mylar . CT_TAG_CBL = ct_tag_cbl
IMP:(#753) Better handling of cbz files when using metatagging option, IMP: Added option for MetaTagging to enable/disable overwriting of existing metadata on cbz files, IMP: Post-Processing will now delete folders that are identical to filenames after successful post-processing, FIX:(#756) Fix for Manual Search for an Issue which resulted in traceback errors upon not finding any matches (Windows), IMP: Added module-name to logging for some modules to help troubleshooting (eventually all will be done), IMP: If a filename contained repeated characters for spaces (ie. ___ or ...), it would fail on post-processing due to the nzbname being off, IMP: Monitoring of CV API will now be persitent on restarts/shutdowns/etc, IMP: Added a maximum CV API global so that it can be adjusted for monitoring more easily should API requirements change, IMP: When Adding new series, will now only mark issues that are actually upcoming as Wanted (based on Store Date)
2014-06-22 08:32:45 +00:00
mylar . CT_CBZ_OVERWRITE = ct_cbz_overwrite
2014-10-14 07:31:49 +00:00
mylar . UNRAR_CMD = unrar_cmd
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
mylar . FAILED_DOWNLOAD_HANDLING = failed_download_handling
mylar . FAILED_AUTO = failed_auto
2012-09-13 15:27:34 +00:00
mylar . LOG_DIR = log_dir
2013-02-06 19:55:23 +00:00
mylar . LOG_LEVEL = log_level
2013-04-22 03:43:57 +00:00
mylar . CHMOD_DIR = chmod_dir
mylar . CHMOD_FILE = chmod_file
2012-12-16 17:57:02 +00:00
# Handle the variable config options. Note - keys with False values aren't getting passed
mylar . EXTRA_NEWZNABS = [ ]
2013-05-19 04:07:18 +00:00
#changing this for simplicty - adding all newznabs into extra_newznabs
if newznab_host is not None :
#this
2013-08-04 05:57:21 +00:00
mylar . EXTRA_NEWZNABS . append ( ( newznab_name , newznab_host , newznab_apikey , newznab_uid , int ( newznab_enabled ) ) )
2012-12-16 18:41:01 +00:00
2012-12-16 17:57:02 +00:00
for kwarg in kwargs :
2013-07-30 04:57:37 +00:00
if kwarg . startswith ( ' newznab_name ' ) :
2012-12-16 17:57:02 +00:00
newznab_number = kwarg [ 12 : ]
2013-07-30 04:57:37 +00:00
newznab_name = kwargs [ ' newznab_name ' + newznab_number ]
2015-04-23 07:39:13 +00:00
if newznab_name == " " :
newznab_name = kwargs [ ' newznab_host ' + newznab_number ]
if newznab_name == " " :
logger . fdebug ( ' Blank newznab provider has been entered - removing. ' )
continue
2012-12-16 17:57:02 +00:00
newznab_host = kwargs [ ' newznab_host ' + newznab_number ]
newznab_api = kwargs [ ' newznab_api ' + newznab_number ]
2013-08-04 05:57:21 +00:00
newznab_uid = kwargs [ ' newznab_uid ' + newznab_number ]
2012-12-16 17:57:02 +00:00
try :
newznab_enabled = int ( kwargs [ ' newznab_enabled ' + newznab_number ] )
except KeyError :
newznab_enabled = 0
2013-08-04 05:57:21 +00:00
mylar . EXTRA_NEWZNABS . append ( ( newznab_name , newznab_host , newznab_api , newznab_uid , newznab_enabled ) )
2012-12-16 18:41:01 +00:00
2012-12-16 17:57:02 +00:00
# Sanity checking
2014-06-09 07:55:05 +00:00
if mylar . COMICVINE_API == ' None ' or mylar . COMICVINE_API == ' ' or mylar . COMICVINE_API == mylar . DEFAULT_CVAPI :
logger . info ( ' Personal Comicvine API key not provided. This will severely impact the usage of Mylar - you have been warned. ' )
mylar . COMICVINE_API = None
2012-12-16 17:57:02 +00:00
if mylar . SEARCH_INTERVAL < 360 :
logger . info ( " Search interval too low. Resetting to 6 hour minimum " )
mylar . SEARCH_INTERVAL = 360
2012-12-16 18:41:01 +00:00
FIX:(#304) Index out of range on recheck, FIX:(#303) Comicvine link updated on details page, FIX:(#302) Query rate (Search Delay) Added as a configuration option, FIX:(#300) Version number error on searching when no version number, FIX:(#297) Manual Rename of Files working, FIX:(#294) 'AU' issue problems should be resolved now, FIX:(#290) V#(year) and Vol#(year) added to filechecking, IMP: ComicVine data use only now as a hidden option (cv_only = 1 in config.ini), IMP: added as options for file naming, IMP: Rough drafting of Annuals (annuals_on = 1 in config.ini), Other fixes..
2013-04-06 09:43:18 +00:00
if mylar . SEARCH_DELAY < 1 :
logger . info ( " Minimum search delay set for 1 minute to avoid hammering. " )
mylar . SEARCH_DELAY = 1
2013-07-30 04:57:37 +00:00
if mylar . RSS_CHECKINTERVAL < 20 :
logger . info ( " Minimum RSS Interval Check delay set for 20 minutes to avoid hammering. " )
mylar . RSS_CHECKINTERVAL = 20
2013-04-22 03:43:57 +00:00
if not helpers . is_number ( mylar . CHMOD_DIR ) :
logger . info ( " CHMOD Directory value is not a valid numeric - please correct. Defaulting to 0777 " )
mylar . CHMOD_DIR = ' 0777 '
if not helpers . is_number ( mylar . CHMOD_FILE ) :
logger . info ( " CHMOD File value is not a valid numeric - please correct. Defaulting to 0660 " )
mylar . CHMOD_FILE = ' 0660 '
2014-01-16 20:25:02 +00:00
if mylar . SAB_HOST . endswith ( ' / ' ) :
logger . info ( " Auto-correcting trailing slash in SABnzbd url (not required) " )
mylar . SAB_HOST = mylar . SAB_HOST [ : - 1 ]
2013-07-01 05:19:15 +00:00
if mylar . ENABLE_META :
if mylar . CMTAGGER_PATH is None or mylar . CMTAGGER_PATH == ' ' :
logger . info ( " ComicTagger Path not set - defaulting to Mylar Program Directory : " + mylar . PROG_DIR )
mylar . CMTAGGER_PATH = mylar . PROG_DIR
2013-09-18 04:49:24 +00:00
if ' comictagger.exe ' in mylar . CMTAGGER_PATH . lower ( ) or ' comictagger.py ' in mylar . CMTAGGER_PATH . lower ( ) :
2015-05-22 08:32:51 +00:00
mylar . CMTAGGER_PATH = re . sub ( os . path . basename ( mylar . CMTAGGER_PATH ) , ' ' , mylar . CMTAGGER_PATH )
2013-09-18 04:49:24 +00:00
logger . fdebug ( " Removed application name from ComicTagger path " )
2013-07-01 05:19:15 +00:00
2014-02-26 19:48:50 +00:00
#legacy support of older config - reload into old values for consistency.
if mylar . NZB_DOWNLOADER == 0 : mylar . USE_SABNZBD = True
elif mylar . NZB_DOWNLOADER == 1 : mylar . USE_NZBGET = True
elif mylar . NZB_DOWNLOADER == 2 : mylar . USE_BLACKHOLE = True
2012-12-16 17:57:02 +00:00
# Write the config
2012-09-13 15:27:34 +00:00
mylar . config_write ( )
raise cherrypy . HTTPRedirect ( " config " )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
2012-09-13 15:27:34 +00:00
configUpdate . exposed = True
FIX:(#663) Weekly pull list would crash on issues with decimal places if series on watchlist, FIX: Error logging when performing search, FIX:(#662) Removed 'Test SABnzbd button' as was causing configuration saving issues. Can still be used by url : /SABtest, IMP: Added more logic checking to weeklypull list when comparing series for matches (to ensure an issue is part of a given series), IMP: Removed dead references to nzbx as a provider, FIX: If issue had no leading 0 in a decimal issue, mylar would crash, FIX: None status would occur when refreshing a series and more than one issue was being pulled in for data, IMP: When using manual post-processing, if issue date was near end/start of year issue comparison would fail. Comparison by month now added, FIX: file checking - if decimal in issue and no year present, would skip issue, FIX: manual post-processing - would fail/skip if no year provided for issue within filename, FIX: Manual Annual Add option will only be available if annuals_on=1 within the config.ini now
2014-04-07 16:20:05 +00:00
def SABtest ( self ) :
sab_host = mylar . SAB_HOST
sab_username = mylar . SAB_USERNAME
sab_password = mylar . SAB_PASSWORD
sab_apikey = mylar . SAB_APIKEY
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
logger . fdebug ( ' testing SABnzbd connection ' )
FIX:(#663) Weekly pull list would crash on issues with decimal places if series on watchlist, FIX: Error logging when performing search, FIX:(#662) Removed 'Test SABnzbd button' as was causing configuration saving issues. Can still be used by url : /SABtest, IMP: Added more logic checking to weeklypull list when comparing series for matches (to ensure an issue is part of a given series), IMP: Removed dead references to nzbx as a provider, FIX: If issue had no leading 0 in a decimal issue, mylar would crash, FIX: None status would occur when refreshing a series and more than one issue was being pulled in for data, IMP: When using manual post-processing, if issue date was near end/start of year issue comparison would fail. Comparison by month now added, FIX: file checking - if decimal in issue and no year present, would skip issue, FIX: manual post-processing - would fail/skip if no year provided for issue within filename, FIX: Manual Annual Add option will only be available if annuals_on=1 within the config.ini now
2014-04-07 16:20:05 +00:00
logger . fdebug ( ' sabhost: ' + str ( sab_host ) )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
logger . fdebug ( ' sab_username: ' + str ( sab_username ) )
logger . fdebug ( ' sab_password: ' + str ( sab_password ) )
logger . fdebug ( ' sab_apikey: ' + str ( sab_apikey ) )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
if mylar . USE_SABNZBD :
import urllib2
from xml . dom . minidom import parseString
#if user/pass given, we can auto-fill the API ;)
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
if sab_username is None or sab_password is None :
logger . error ( ' No Username / Password provided for SABnzbd credentials. Unable to test API key ' )
return
logger . fdebug ( ' testing connection to SABnzbd @ ' + sab_host )
logger . fdebug ( ' SAB API Key : ' + sab_apikey )
if sab_host . endswith ( ' / ' ) :
sabhost = sab_host
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
else :
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
sabhost = sab_host + ' / '
querysab = sabhost + " api?mode=get_config§ion=misc&output=xml&apikey= " + sab_apikey
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
file = urllib2 . urlopen ( querysab )
data = file . read ( )
file . close ( )
dom = parseString ( data )
try :
q_sabhost = dom . getElementsByTagName ( ' host ' ) [ 0 ] . firstChild . wholeText
q_nzbkey = dom . getElementsByTagName ( ' nzb_key ' ) [ 0 ] . firstChild . wholeText
q_apikey = dom . getElementsByTagName ( ' api_key ' ) [ 0 ] . firstChild . wholeText
except :
errorm = dom . getElementsByTagName ( ' error ' ) [ 0 ] . firstChild . wholeText
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
logger . error ( u " Error detected attempting to retrieve SAB data using FULL APIKey: " + errorm )
if errorm == ' API Key Incorrect ' :
logger . fdebug ( ' You may have given me just the right amount of power (NZBKey), will test SABnzbd against the NZBkey now ' )
querysab = sabhost + " api?mode=addurl&name=http://www.example.com/example.nzb&nzbname=NiceName&output=xml&apikey= " + mylar . SAB_APIKEY
file = urllib2 . urlopen ( querysab )
data = file . read ( )
file . close ( )
dom = parseString ( data )
qdata = dom . getElementsByTagName ( ' status ' ) [ 0 ] . firstChild . wholeText
2015-05-22 08:32:51 +00:00
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
if str ( qdata ) == ' True ' :
q_nzbkey = mylar . SAB_APIKEY
q_apikey = None
qd = True
else :
qerror = dom . getElementsByTagName ( ' error ' ) [ 0 ] . firstChild . wholeText
2014-04-02 19:14:30 +00:00
logger . error ( str ( qerror ) + ' - check that the API (NZBkey) is correct, use the auto-detect option AND/OR check host:port settings ' )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
qd = False
if qd == False : return
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
#test which apikey provided
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
if q_nzbkey != sab_apikey :
if q_apikey != sab_apikey :
2014-04-02 19:14:30 +00:00
logger . error ( ' APIKey provided does not match with SABnzbd ' )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
return
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
else :
2014-04-02 19:14:30 +00:00
logger . info ( ' APIKey provided is FULL APIKey which is too much power - changing to NZBKey ' )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
mylar . SAB_APIKEY = q_nzbkey
mylar . config_write ( )
2014-04-02 19:14:30 +00:00
logger . info ( ' Succcessfully changed to NZBKey. Thanks for shopping S-MART! ' )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
else :
2014-04-02 19:14:30 +00:00
logger . info ( ' APIKey provided is NZBKey which is the correct key. ' )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
2014-04-02 19:14:30 +00:00
logger . info ( ' Connection to SABnzbd tested sucessfully ' )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
else :
2014-04-02 19:14:30 +00:00
logger . error ( ' You do not have anything stated for SAB Host. Please correct and try again. ' )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
return
SABtest . exposed = True
2012-09-13 15:27:34 +00:00
def shutdown ( self ) :
mylar . SIGNAL = ' shutdown '
message = ' Shutting Down... '
return serve_template ( templatename = " shutdown.html " , title = " Shutting Down " , message = message , timer = 15 )
return page
shutdown . exposed = True
def restart ( self ) :
mylar . SIGNAL = ' restart '
message = ' Restarting... '
return serve_template ( templatename = " shutdown.html " , title = " Restarting " , message = message , timer = 30 )
restart . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def update ( self ) :
mylar . SIGNAL = ' update '
2012-09-17 05:12:40 +00:00
message = ' Updating...<br/><small>Main screen will appear in 60s</small> '
2012-09-13 15:27:34 +00:00
return serve_template ( templatename = " shutdown.html " , title = " Updating " , message = message , timer = 30 )
return page
update . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def getInfo ( self , ComicID = None , IssueID = None ) :
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
from mylar import cache
info_dict = cache . getInfo ( ComicID , IssueID )
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
return simplejson . dumps ( info_dict )
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
getInfo . exposed = True
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
def getComicArtwork ( self , ComicID = None , imageURL = None ) :
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
from mylar import cache
logger . info ( u " Retrieving image for : " + comicID )
return cache . getArtwork ( ComicID , imageURL )
2015-05-22 08:32:51 +00:00
2012-09-13 15:27:34 +00:00
getComicArtwork . exposed = True
2014-02-26 19:48:50 +00:00
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
def findsabAPI ( self ) :
import sabparse
sabapi = sabparse . sabnzbd ( )
FIX:(#663) Weekly pull list would crash on issues with decimal places if series on watchlist, FIX: Error logging when performing search, FIX:(#662) Removed 'Test SABnzbd button' as was causing configuration saving issues. Can still be used by url : /SABtest, IMP: Added more logic checking to weeklypull list when comparing series for matches (to ensure an issue is part of a given series), IMP: Removed dead references to nzbx as a provider, FIX: If issue had no leading 0 in a decimal issue, mylar would crash, FIX: None status would occur when refreshing a series and more than one issue was being pulled in for data, IMP: When using manual post-processing, if issue date was near end/start of year issue comparison would fail. Comparison by month now added, FIX: file checking - if decimal in issue and no year present, would skip issue, FIX: manual post-processing - would fail/skip if no year provided for issue within filename, FIX: Manual Annual Add option will only be available if annuals_on=1 within the config.ini now
2014-04-07 16:20:05 +00:00
logger . info ( ' SAB NZBKey found as : ' + str ( sabapi ) + ' . You still have to save the config to retain this setting. ' )
IMP: Removed unneeded code from several modules, IMP:(#659) Subdirectories now will be scanned in properly when in series directories, FIX:(#635)(#658) Moved code from html into module to allow for better integration and further templating needs, IMP: Added ability for mylar to auto-grab SABnzbd API when provided with user/pass, IMP: Test SABnzbd button works again - will auto-rollback to NZBKey usage, IMP: Added counts to Upcoming page, IMP: Added some more detailed parsing to the ImportResults, IMP: ImportResults will now show proper series title, IMP: Improved some logic when determining if a new weekly issue is on a watchlist if a rebooted series, IMP: A bunch of smaller fixes, and some various code tweaks...
2014-04-02 19:08:59 +00:00
mylar . SAB_APIKEY = sabapi
return sabapi
findsabAPI . exposed = True
2014-02-26 19:48:50 +00:00
def generateAPI ( self ) :
import hashlib , random
2015-05-22 08:32:51 +00:00
apikey = hashlib . sha224 ( str ( random . getrandbits ( 256 ) ) ) . hexdigest ( ) [ 0 : 32 ]
2014-02-26 19:48:50 +00:00
logger . info ( " New API generated " )
mylar . API_KEY = apikey
return apikey
generateAPI . exposed = True
2015-05-22 08:32:51 +00:00
2014-02-26 19:48:50 +00:00
def api ( self , * args , * * kwargs ) :
from mylar . api import Api
a = Api ( )
a . checkParams ( * args , * * kwargs )
data = a . fetchData ( )
return data
api . exposed = True
2015-05-22 08:32:51 +00:00
def downloadthis ( self , pathfile = None ) :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
#pathfile should be escaped via the |u tag from within the html call already.
logger . fdebug ( ' filepath to retrieve file from is : ' + pathfile )
2014-04-23 04:00:21 +00:00
from cherrypy . lib . static import serve_download
return serve_download ( pathfile )
downloadthis . exposed = True
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
def IssueInfo ( self , filelocation ) :
2015-01-19 05:10:46 +00:00
filelocation = filelocation . encode ( ' ASCII ' )
filelocation = urllib . unquote_plus ( filelocation ) . decode ( ' utf8 ' )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issuedetails = helpers . IssueDetails ( filelocation )
IMP: When scanning a folder using the Import a Directory option, upon completion a button to the Import Results Management page will be displayed to allow for easier access / acknowledgement of completion of scan, FIX: Fixed some issues with the search results page displaying too much information, IMP: Improved the ability to see alternate covers within issues when viewing selected issue details via the 'i' icon on the issue details page, IMP: Fixed the problem with issues that had 2015 dates and wouldn't scan in via manual post-processing, IMP: Added duplicate issue detection (beta) - enabled, when post-processing (manually or otherwise), will retain the issue that is bigger in filesize and won't post-process if it's smaller in size, instead of hammering the oldest copy, FIX: bunch of small fixes, and getting groundwork done for other things.
2014-12-18 18:30:57 +00:00
#print str(issuedetails)
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo = ' <table width= " 500 " ><tr><td> '
issueinfo + = ' <img style= " float: left; padding-right: 10px " src= ' + issuedetails [ 0 ] [ ' IssueImage ' ] + ' height= " 400 " width= " 263 " > '
issueinfo + = ' <h1><center><b> ' + issuedetails [ 0 ] [ ' series ' ] + ' </br>[# ' + issuedetails [ 0 ] [ ' issue_number ' ] + ' ]</b></center></h1> '
issueinfo + = ' <center> " ' + issuedetails [ 0 ] [ ' title ' ] + ' " </center></br> '
issueinfo + = ' </br><p class= " alignleft " > ' + str ( issuedetails [ 0 ] [ ' pagecount ' ] ) + ' pages</p> '
if issuedetails [ 0 ] [ ' day ' ] is None :
issueinfo + = ' <p class= " alignright " >( ' + str ( issuedetails [ 0 ] [ ' year ' ] ) + ' - ' + str ( issuedetails [ 0 ] [ ' month ' ] ) + ' )</p></br> '
else :
issueinfo + = ' <p class= " alignright " >( ' + str ( issuedetails [ 0 ] [ ' year ' ] ) + ' - ' + str ( issuedetails [ 0 ] [ ' month ' ] ) + ' - ' + str ( issuedetails [ 0 ] [ ' day ' ] ) + ' )</p></br> '
2015-05-22 08:32:51 +00:00
if not issuedetails [ 0 ] [ ' writer ' ] == ' None ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' Writer: ' + issuedetails [ 0 ] [ ' writer ' ] + ' </br> '
2015-05-22 08:32:51 +00:00
if not issuedetails [ 0 ] [ ' penciller ' ] == ' None ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' Penciller: ' + issuedetails [ 0 ] [ ' penciller ' ] + ' </br> '
2015-05-22 08:32:51 +00:00
if not issuedetails [ 0 ] [ ' inker ' ] == ' None ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' Inker: ' + issuedetails [ 0 ] [ ' inker ' ] + ' </br> '
2015-05-22 08:32:51 +00:00
if not issuedetails [ 0 ] [ ' colorist ' ] == ' None ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' Colorist: ' + issuedetails [ 0 ] [ ' colorist ' ] + ' </br> '
2015-05-22 08:32:51 +00:00
if not issuedetails [ 0 ] [ ' letterer ' ] == ' None ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' Letterer: ' + issuedetails [ 0 ] [ ' letterer ' ] + ' </br> '
2015-05-22 08:32:51 +00:00
if not issuedetails [ 0 ] [ ' editor ' ] == ' None ' :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' Editor: ' + issuedetails [ 0 ] [ ' editor ' ] + ' </br> '
issueinfo + = ' </td></tr> '
#issueinfo += '<img src="interfaces/default/images/rename.png" height="25" width="25"></td></tr>'
2015-01-20 05:41:29 +00:00
if len ( issuedetails [ 0 ] [ ' summary ' ] ) > 1000 :
issuesumm = issuedetails [ 0 ] [ ' summary ' ] [ : 1000 ] + ' ... '
else :
issuesumm = issuedetails [ 0 ] [ ' summary ' ]
issueinfo + = ' <tr><td>Summary: ' + issuesumm + ' </br></td></tr> '
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
issueinfo + = ' <tr><td><center> ' + os . path . split ( filelocation ) [ 1 ] + ' </center> '
issueinfo + = ' </td></tr></table> '
return issueinfo
#import json
#json_dump = json.dumps(issuedetails)
#json_dump = json_dump.replace("\\","\\\\")
#print 'json_dump:' + str(json_dump)
#return json_dump
IssueInfo . exposed = True
2015-01-20 05:41:29 +00:00
def manual_metatag ( self , dirName , issueid , filename , comicid , comversion ) :
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
module = ' [MANUAL META-TAGGING] '
try :
import cmtagmylar
2015-01-20 05:41:29 +00:00
metaresponse = cmtagmylar . run ( dirName , issueid = issueid , filename = filename , comversion = comversion )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
except ImportError :
logger . warn ( module + ' comictaggerlib not found on system. Ensure the ENTIRE lib directory is located within mylar/lib/comictaggerlib/ directory. ' )
metaresponse = " fail "
if metaresponse == " fail " :
logger . fdebug ( module + ' Unable to write metadata successfully - check mylar.log file. ' )
elif metaresponse == " unrar error " :
logger . error ( module + ' This is a corrupt archive - whether CRC errors or it is incomplete. Marking as BAD, and retrying a different copy. ' )
#launch failed download handling here.
else :
logger . info ( module + ' Sucessfully wrote metadata to .cbz ( ' + os . path . split ( metaresponse ) [ 1 ] + ' ) - Continuing.. ' )
updater . forceRescan ( comicid )
manual_metatag . exposed = True
def group_metatag ( self , dirName , ComicID ) :
myDB = db . DBConnection ( )
2015-01-20 05:41:29 +00:00
cinfo = myDB . selectone ( ' SELECT ComicVersion FROM comics WHERE ComicID=? ' , [ ComicID ] ) . fetchone ( )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
groupinfo = myDB . select ( ' SELECT * FROM issues WHERE ComicID=? and Location is not NULL ' , [ ComicID ] )
if groupinfo is None :
logger . warn ( ' No issues physically exist within the series directory for me to (re)-tag. ' )
return
for ginfo in groupinfo :
2014-08-18 19:54:34 +00:00
logger . info ( ' tagging : ' + str ( ginfo ) )
2015-01-20 05:41:29 +00:00
self . manual_metatag ( dirName , ginfo [ ' IssueID ' ] , os . path . join ( dirName , ginfo [ ' Location ' ] ) , ComicID , comversion = cinfo [ ' ComicVersion ' ] )
FIX: undefined on filter box on startup, IMP: Added Meta-Tagging options on a series / issue basis on comic details screen, IMP: Issue Information is now available per issue and is extracted currently from the cbz file to display (if no cbz is present, the option isn't available), IMP: Failed Download handling is implemented and available in GUI - required to replace existing autoProcessComics.py and ComicRN.py scripts, IMP: Added ability to specify post-processing script instead of ComicRN.py, IMP: Added abilty to edit the issue date for a given issue by simply clicking on it - this will help to avoid dates that have incorrect or 0000-00-00, IMP: Story Arc searching is working (not adding yet), IMP: Added Archived/Ignored options to Upcoming/Wanted tab, IMP: Fixed some alignment and display issues on the Upcoming section, IMP: Added better directory handling for Updating Comic Location when it needs to get changed for all existing series (locmove in config.ini), IMP: Added better handling for unicode characters in series titles when searching / filechecking, IMP: When adding a new series with no data, Mylar would error out (now will add and just retain 0 issues), FIX: When year was fuzzied, search would still attempt to do a date-check comparison and say everything failed, IMP: Better handling of nzb names when retaining for post-processing comparisons, IMP: Future Upcoming now will use actual shipping date of issue if available in order to see if issue is available, FIX: If annuals were enabled, refreshing a series would put some issues into an Archived status because the actual counts would be off, IMP: When file checking, Alternate Naming would be searched last which resulted in matching incorrectly to the series title or other alternate naming for the given series, now will check the Alternate Naming first for a match, then drop back down to the series name itself otherwise, IMP: Improved Annual detection when integrated with a given series, IMP: Improved the checking of the future Upcoming list for issues marked as Wanted but not available yet and then auto-adding, IMP: Improved upon story arc checking for missing issues / searching for wanted, IMP: Enabling Annuals support now within Configuration GUI, bunch of other things....
2014-07-28 19:28:09 +00:00
logger . info ( ' Finished doing a complete series (re)tagging of metadata. ' )
group_metatag . exposed = True
def CreateFolders ( self , createfolders = None ) :
print ' createfolders is ' + str ( createfolders )
if createfolders :
mylar . CREATE_FOLDERS = int ( createfolders )
mylar . config_write ( )
CreateFolders . exposed = True
2014-09-10 04:54:53 +00:00
def getPushbulletDevices ( self , api = None ) :
notifythis = notifiers . pushbullet
result = notifythis . get_devices ( api )
if result :
return result
else :
return ' Error sending Pushbullet notifications. '
getPushbulletDevices . exposed = True
IMP: Cleaned up interface for StoryArcs / Story Arc Details, IMP: Cleaned up interface for Reading list Management, IMP: Added better reading list management - new status (added, downloaded, read), IMP: Added sync option for use with another device for reading list transfer (ie. tablet) Android only, IMP: Autopopulate new weekly pull releases to reading list, IMP: 'Watch' option in weekly pull list now fully functional. Will watch CV for series' that do not have any series data yet as they are new starting series. Will auto-add once available, IMP: Auto-watch check is run after every refresh/recreate of the weeklypull list, IMP: Improved the Add a Series option where it will now look for issues that are 'new' or 'wanted' during add sequence, IMP: Main page interface now has coloured have/total bars to denote series completion, IMP: New scheduler / threading locks in place in an attempt to avoid database locks, FIX: Removed some erroneous locking that was going on when importing a directory was being run, IMP: Stat counter now present when post-processing multiple issues in sequence, FIX: for issue number error when post-processing and issue number was a non-alphanumeric, FIX: for metatagging: when original file was .cbz, would try to convert and fail, FIX: for issues that were negative and were preceeded by a # in the filename (filechecker), FIX: for publisher having non-alphanumeric character in name when attempting to determine publisher, FIX: if annuals enabled, would incorrectly show as being 'already in library' when viewing search results if results constained annuals, FIX:(#944) for incorrect nzbname being used when post-processing was being performed from an nzb client (experimental mainly), IMP: Turned off logging for ComicVine API counter, FIX: Added retry attempts when connecting to ComicVine in order to avoid errors when adding a series, IMP:(#963) Added ability to add snatched to filter when viewing Wanted issues on Wanted tab, FIX: When importing and then selecting a series to import via the select screen, will now flip back to the importresults and add the selected series in the background, IMP:(#952) Main page is now sorted in ascending order by Continuing/Ended status (and subbed by whether is Active/Paused).Custom sorting is still available, FIX: Dupecheck will now automatically assume existing 0-byte files are to be overwritten when performing post-processing, FIX: If publication date for series contained a '?' (usually with brand new series) will force to 'Present' to allow for pull-list comparisons to take place, FIX: Mylar will now disallow search results which have 'covers only' or 'variant' in the filename, IMP: Better nzbname generation/retrieval (will check inside nzb for possible names) to be used when post-processing, IMP: DB Update will now perform update to all active comics in descending order by Latest Date (instead of random order), FIX: Enforce the 5hr limit rule when running DB update (will only update series that haven't been updated in >5 hours), FIX: Annuals will now have/retain the proper status upon doing DB Update, FIX: Have totals will now be updated when doing a recheck files (sometimes wouldn't get updated depending on various states of status'), FIX:(#966) Added urllib2.URLError exeception trap when attempting to check Git for updates, IMP: Removed the individual sqlite calls for weeklypull, and brought them into line with using the db module (which will minimize concurrent access, which seemed to be causing db locks), IMP: Cleaned up some code and shuffled some functions so they are in more appropriate locations
2015-03-27 17:27:59 +00:00
def syncfiles ( self ) :
#3 status' exist for the readlist.
# Added (Not Read) - Issue is added to the readlist and is awaiting to be 'sent' to your reading client.
# Read - Issue has been read
# Not Read - Issue has been downloaded to your reading client after the syncfiles has taken place.
read = readinglist . Readinglist ( )
threading . Thread ( target = read . syncreading ) . start ( )
syncfiles . exposed = True
2015-05-11 08:14:47 +00:00
def search_32p ( self , search = None ) :
mylar . rsscheck . torrents ( pickfeed = ' 4 ' , seriesname = search )
search_32p . exposed = True