2012-09-13 15:27:34 +00:00
|
|
|
# This file is part of Mylar.
|
|
|
|
#
|
|
|
|
# Mylar is free software: you can redistribute it and/or modify
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# Mylar is distributed in the hope that it will be useful,
|
|
|
|
# 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
|
|
|
|
# along with Mylar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
import time
|
2012-10-16 08:16:29 +00:00
|
|
|
import os, errno
|
2012-09-13 15:27:34 +00:00
|
|
|
import sys
|
|
|
|
import shlex
|
|
|
|
import datetime
|
2012-09-18 20:33:09 +00:00
|
|
|
import re
|
2012-10-16 08:16:29 +00:00
|
|
|
import urllib
|
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
|
|
|
import urllib2
|
2012-12-27 15:04:03 +00:00
|
|
|
import shutil
|
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 imghdr
|
2013-02-22 08:35:51 +00:00
|
|
|
import sqlite3
|
|
|
|
import cherrypy
|
2012-09-13 15:27:34 +00:00
|
|
|
|
|
|
|
import mylar
|
2013-03-21 17:09:10 +00:00
|
|
|
from mylar import logger, helpers, db, mb, albumart, cv, parseit, filechecker, search, updater, moveit, comicbookdb
|
2012-09-13 15:27:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
def is_exists(comicid):
|
|
|
|
|
|
|
|
myDB = db.DBConnection()
|
|
|
|
|
|
|
|
# See if the artist is already in the database
|
|
|
|
comiclist = myDB.select('SELECT ComicID, ComicName from comics WHERE ComicID=?', [comicid])
|
|
|
|
|
|
|
|
if any(comicid in x for x in comiclist):
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info(comiclist[0][1] + ' is already in the database.')
|
2012-09-13 15:27:34 +00:00
|
|
|
return False
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
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 addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None,calledfrom=None,annload=None,chkwant=None,issuechk=None,issuetype=None,latestissueinfo=None):
|
2012-09-13 15:27:34 +00:00
|
|
|
# Putting this here to get around the circular import. Will try to use this to update images at later date.
|
2013-01-17 16:22:51 +00:00
|
|
|
# from mylar import cache
|
2012-09-13 15:27:34 +00:00
|
|
|
|
|
|
|
myDB = db.DBConnection()
|
|
|
|
|
|
|
|
# We need the current minimal info in the database instantly
|
|
|
|
# so we don't throw a 500 error when we redirect to the artistPage
|
|
|
|
|
|
|
|
controlValueDict = {"ComicID": 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
|
|
|
dbcomic = myDB.selectone('SELECT * FROM comics WHERE ComicID=?', [comicid]).fetchone()
|
2012-09-13 15:27:34 +00:00
|
|
|
if dbcomic is None:
|
|
|
|
newValueDict = {"ComicName": "Comic ID: %s" % (comicid),
|
|
|
|
"Status": "Loading"}
|
2012-10-16 08:16:29 +00:00
|
|
|
comlocation = None
|
2013-05-27 06:47:44 +00:00
|
|
|
oldcomversion = None
|
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
|
|
|
series_status = 'Loading'
|
2012-09-13 15:27:34 +00:00
|
|
|
else:
|
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 chkwant is not None:
|
|
|
|
logger.fdebug('ComicID: ' + str(comicid) + ' already exists. Not adding from the future pull list at this time.')
|
|
|
|
return 'Exists'
|
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 dbcomic['Status'] == 'Active':
|
|
|
|
series_status = 'Active'
|
|
|
|
elif dbcomic['Status'] == 'Paused':
|
|
|
|
series_status = 'Paused'
|
|
|
|
else:
|
|
|
|
series_status = 'Loading'
|
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
newValueDict = {"Status": "Loading"}
|
2012-10-16 08:16:29 +00:00
|
|
|
comlocation = dbcomic['ComicLocation']
|
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 not latestissueinfo:
|
|
|
|
latestissueinfo = []
|
|
|
|
latestissueinfo.append({"latestiss": dbcomic['LatestIssue'],
|
|
|
|
"latestdate": dbcomic['LatestDate']})
|
|
|
|
|
2013-04-22 03:43:57 +00:00
|
|
|
filechecker.validateAndCreateDirectory(comlocation, True)
|
2013-05-26 03:18:29 +00:00
|
|
|
oldcomversion = dbcomic['ComicVersion'] #store the comicversion and chk if it exists before hammering.
|
2012-09-13 15:27:34 +00:00
|
|
|
myDB.upsert("comics", newValueDict, controlValueDict)
|
|
|
|
|
2013-03-14 08:33:16 +00:00
|
|
|
#run the re-sortorder here in order to properly display the page
|
2013-03-21 17:09:10 +00:00
|
|
|
if pullupd is None:
|
|
|
|
helpers.ComicSort(comicorder=mylar.COMICSORT, imported=comicid)
|
2013-03-14 08:33:16 +00:00
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
# we need to lookup the info for the requested ComicID in full now
|
|
|
|
comic = cv.getComic(comicid,'comic')
|
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
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
if not comic:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.warn('Error fetching comic. ID for : ' + comicid)
|
2012-09-13 15:27:34 +00:00
|
|
|
if dbcomic is None:
|
|
|
|
newValueDict = {"ComicName": "Fetch failed, try refreshing. (%s)" % (comicid),
|
|
|
|
"Status": "Active"}
|
|
|
|
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
|
|
|
if series_status == 'Active' or series_status == 'Loading':
|
|
|
|
newValueDict = {"Status": "Active"}
|
2012-09-13 15:27:34 +00:00
|
|
|
myDB.upsert("comics", newValueDict, controlValueDict)
|
|
|
|
return
|
|
|
|
|
|
|
|
if comic['ComicName'].startswith('The '):
|
|
|
|
sortname = comic['ComicName'][4:]
|
|
|
|
else:
|
|
|
|
sortname = comic['ComicName']
|
|
|
|
|
|
|
|
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Now adding/updating: ' + comic['ComicName'])
|
2012-09-13 15:27:34 +00:00
|
|
|
#--Now that we know ComicName, let's try some scraping
|
|
|
|
#--Start
|
|
|
|
# gcd will return issue details (most importantly publishing date)
|
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:
|
|
|
|
if mismatch == "no" or mismatch is None:
|
|
|
|
gcdinfo=parseit.GCDScraper(comic['ComicName'], comic['ComicYear'], comic['ComicIssues'], comicid)
|
|
|
|
#print ("gcdinfo: " + str(gcdinfo))
|
|
|
|
mismatch_com = "no"
|
|
|
|
if gcdinfo == "No Match":
|
|
|
|
updater.no_searchresults(comicid)
|
|
|
|
nomatch = "true"
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('There was an error when trying to add ' + comic['ComicName'] + ' (' + comic['ComicYear'] + ')' )
|
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 nomatch
|
|
|
|
else:
|
|
|
|
mismatch_com = "yes"
|
|
|
|
#print ("gcdinfo:" + str(gcdinfo))
|
2012-10-16 08:16:29 +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
|
|
|
elif mismatch == "yes":
|
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])
|
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'] is None: pass
|
|
|
|
else:
|
|
|
|
vari_loop = CV_EXcomicid['variloop']
|
|
|
|
NewComicID = CV_EXcomicid['NewComicID']
|
|
|
|
gcomicid = CV_EXcomicid['GComicID']
|
|
|
|
resultURL = "/series/" + str(NewComicID) + "/"
|
|
|
|
#print ("variloop" + str(CV_EXcomicid['variloop']))
|
|
|
|
#if vari_loop == '99':
|
|
|
|
gcdinfo = parseit.GCDdetails(comseries=None, resultURL=resultURL, vari_loop=0, ComicID=comicid, TotalIssues=0, issvariation="no", resultPublished=None)
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
# print ("Series Published" + parseit.resultPublished)
|
|
|
|
|
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
|
|
|
CV_NoYearGiven = "no"
|
2013-03-12 16:13:43 +00:00
|
|
|
#if the SeriesYear returned by CV is blank or none (0000), let's use the gcd one.
|
|
|
|
if comic['ComicYear'] is None or comic['ComicYear'] == '0000':
|
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.CV_ONLY:
|
|
|
|
#we'll defer this until later when we grab all the issues and then figure it out
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Uh-oh. I cannot find a Series Year for this series. I am going to try analyzing deeper.')
|
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
|
|
|
SeriesYear = cv.getComic(comicid,'firstissue',comic['FirstIssueID'])
|
|
|
|
if SeriesYear == '0000':
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Ok - I could not find a Series Year at all. Loading in the issue data now and will figure out the Series Year.')
|
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
|
|
|
CV_NoYearGiven = "yes"
|
|
|
|
issued = cv.getComic(comicid,'issue')
|
|
|
|
SeriesYear = issued['firstdate'][:4]
|
|
|
|
else:
|
|
|
|
SeriesYear = gcdinfo['SeriesYear']
|
2013-03-12 16:13:43 +00:00
|
|
|
else:
|
|
|
|
SeriesYear = comic['ComicYear']
|
|
|
|
|
2014-06-09 07:55:05 +00:00
|
|
|
logger.info('Sucessfully retrieved details for ' + comic['ComicName'] )
|
|
|
|
|
2014-03-19 19:07:25 +00:00
|
|
|
#since the weekly issue check could return either annuals or issues, let's initialize it here so it carries through properly.
|
|
|
|
weeklyissue_check = []
|
|
|
|
|
2013-03-21 17:09:10 +00:00
|
|
|
#let's do the Annual check here.
|
|
|
|
if mylar.ANNUALS_ON:
|
2014-02-26 19:48:50 +00:00
|
|
|
#we need to check first to see if there are pre-existing annuals that have been manually added, or else they'll get
|
|
|
|
#wiped out.
|
|
|
|
annualids = [] #to be used to make sure an ID isn't double-loaded
|
|
|
|
|
|
|
|
if annload is None:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
for manchk in annload:
|
|
|
|
if manchk['ReleaseComicID'] is not None or manchk['ReleaseComicID'] is not None: #if it exists, then it's a pre-existing add.
|
|
|
|
#print str(manchk['ReleaseComicID']), comic['ComicName'], str(SeriesYear), str(comicid)
|
|
|
|
manualAnnual(manchk['ReleaseComicID'], comic['ComicName'], SeriesYear, comicid)
|
|
|
|
annualids.append(manchk['ReleaseComicID'])
|
|
|
|
|
2013-05-15 09:04:26 +00:00
|
|
|
annualcomicname = re.sub('[\,\:]', '', comic['ComicName'])
|
2013-07-01 05:19:15 +00:00
|
|
|
|
|
|
|
#----- CBDB (outdated)
|
|
|
|
# annuals = comicbookdb.cbdb(annualcomicname, SeriesYear)
|
|
|
|
# print ("Number of Annuals returned: " + str(annuals['totalissues']))
|
|
|
|
# nb = 0
|
|
|
|
# while (nb <= int(annuals['totalissues'])):
|
|
|
|
# try:
|
|
|
|
# annualval = annuals['annualslist'][nb]
|
|
|
|
# except IndexError:
|
|
|
|
# break
|
|
|
|
#----
|
|
|
|
#this issueid doesn't exist at this point since we got the data from cbdb...let's try and figure out
|
|
|
|
#the issueID for CV based on what we know so we can use that ID (and thereby the metadata too)
|
|
|
|
|
|
|
|
#other inherit issue - results below will return the ID for the Series of Annuals, not the series itself.
|
|
|
|
#sr['comicid'] not the same as comicid for series.
|
|
|
|
annComicName = annualcomicname + ' annual'
|
|
|
|
mode = 'series'
|
|
|
|
#if annuals['totalissues'] is None:
|
|
|
|
# annissues = 0
|
|
|
|
#else:
|
|
|
|
# annissues = annuals['totalissues']
|
|
|
|
#print "annissues :" + str(annissues)
|
|
|
|
|
|
|
|
# annuals happen once / year. determine how many.
|
|
|
|
annualyear = SeriesYear # no matter what, the year won't be less than this.
|
|
|
|
#if annualval['AnnualYear'] is None:
|
|
|
|
# sresults = mb.findComic(annComicName, mode, issue=annissues)
|
|
|
|
#else:
|
|
|
|
#sresults = mb.findComic(annComicName, mode, issue=annissues, limityear=annualval['AnnualYear'])
|
|
|
|
#print "annualyear: " + str(annualval['AnnualYear'])
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - Annual Year:' + str(annualyear))
|
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
|
|
|
sresults, explicit = mb.findComic(annComicName, mode, issue=None, explicit='all')#,explicit=True)
|
2013-07-01 05:19:15 +00:00
|
|
|
|
|
|
|
type='comic'
|
|
|
|
|
|
|
|
if len(sresults) == 1:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - 1 result')
|
2013-07-01 05:19:15 +00:00
|
|
|
if len(sresults) > 0:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - there are ' + str(len(sresults)) + ' results.')
|
2013-07-01 05:19:15 +00:00
|
|
|
num_res = 0
|
|
|
|
while (num_res < len(sresults)):
|
|
|
|
sr = sresults[num_res]
|
2014-02-26 19:48:50 +00:00
|
|
|
logger.fdebug("description:" + sr['description'])
|
2013-07-11 03:37:52 +00:00
|
|
|
if 'paperback' in sr['description'] or 'collecting' in sr['description'] or 'reprints' in sr['description'] or 'collected' in sr['description']:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - tradeback/collected edition detected - skipping ' + str(sr['comicid']))
|
2013-07-01 05:19:15 +00:00
|
|
|
else:
|
|
|
|
if comicid in sr['description']:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(comicid) + ' found. Assuming it is part of the greater collection.')
|
2013-07-01 05:19:15 +00:00
|
|
|
issueid = sr['comicid']
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(issueid) + ' added to series list as an Annual')
|
2014-02-26 19:48:50 +00:00
|
|
|
if issueid in annualids:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(issueid) + ' already exists & was refreshed.')
|
2014-02-26 19:48:50 +00:00
|
|
|
num_res+=1 # need to manually increment since not a for-next loop
|
|
|
|
continue
|
2013-07-01 05:19:15 +00:00
|
|
|
issued = cv.getComic(issueid,'issue')
|
|
|
|
if len(issued) is None or len(issued) == 0:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - Could not find any annual information...')
|
2013-07-01 05:19:15 +00:00
|
|
|
pass
|
|
|
|
else:
|
|
|
|
n = 0
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - There are ' + str(sr['issues']) + ' annuals in this series.')
|
2013-07-01 05:19:15 +00:00
|
|
|
while (n < int(sr['issues'])):
|
|
|
|
try:
|
|
|
|
firstval = issued['issuechoice'][n]
|
|
|
|
except IndexError:
|
|
|
|
break
|
|
|
|
cleanname = helpers.cleanName(firstval['Issue_Name'])
|
|
|
|
issid = str(firstval['Issue_ID'])
|
|
|
|
issnum = str(firstval['Issue_Number'])
|
|
|
|
issname = cleanname
|
|
|
|
issdate = str(firstval['Issue_Date'])
|
2014-02-26 19:48:50 +00:00
|
|
|
stdate = str(firstval['Store_Date'])
|
2014-03-19 19:07:25 +00:00
|
|
|
int_issnum = helpers.issuedigits(issnum)
|
2013-07-01 05:19:15 +00:00
|
|
|
newCtrl = {"IssueID": issid}
|
2014-02-26 19:48:50 +00:00
|
|
|
newVals = {"Issue_Number": issnum,
|
2014-03-19 19:07:25 +00:00
|
|
|
"Int_IssueNumber": int_issnum,
|
2014-02-26 19:48:50 +00:00
|
|
|
"IssueDate": issdate,
|
|
|
|
"ReleaseDate": stdate,
|
|
|
|
"IssueName": issname,
|
|
|
|
"ComicID": comicid,
|
|
|
|
"ComicName": comic['ComicName'],
|
|
|
|
"ReleaseComicID": re.sub('4050-','',firstval['Comic_ID']).strip(),
|
|
|
|
"ReleaseComicName": sr['name'],
|
|
|
|
"Status": "Skipped"}
|
2013-07-01 05:19:15 +00:00
|
|
|
myDB.upsert("annuals", newVals, newCtrl)
|
2014-03-19 19:07:25 +00:00
|
|
|
|
|
|
|
if issuechk is not None and issuetype == 'annual':
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - Comparing annual ' + str(issuechk) + ' .. to .. ' + str(int_issnum))
|
2014-03-19 19:07:25 +00:00
|
|
|
if issuechk == int_issnum:
|
|
|
|
weeklyissue_check.append({"Int_IssueNumber": int_issnum,
|
|
|
|
"Issue_Number": issnum,
|
|
|
|
"IssueDate": issdate,
|
|
|
|
"ReleaseDate": stdate})
|
|
|
|
|
2013-07-01 05:19:15 +00:00
|
|
|
n+=1
|
|
|
|
num_res+=1
|
|
|
|
|
|
|
|
elif len(sresults) == 0 or len(sresults) is None:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - No results, removing the year from the agenda and re-querying.')
|
|
|
|
sresults, explicit = mb.findComic(annComicName, mode, issue=None)#, explicit=True)
|
2013-07-01 05:19:15 +00:00
|
|
|
if len(sresults) == 1:
|
|
|
|
sr = sresults[0]
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(comicid) + ' found. Assuming it is part of the greater collection.')
|
2013-07-01 05:19:15 +00:00
|
|
|
else:
|
|
|
|
resultset = 0
|
|
|
|
else:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - Returning results to screen - more than one possibility')
|
2013-07-01 05:19:15 +00:00
|
|
|
for sr in sresults:
|
|
|
|
if annualyear < sr['comicyear']:
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(annualyear) + ' is less than ' + str(sr['comicyear']))
|
2013-07-01 05:19:15 +00:00
|
|
|
if int(sr['issues']) > (2013 - int(sr['comicyear'])):
|
2014-06-04 18:53:33 +00:00
|
|
|
logger.fdebug('[IMPORTER-ANNUAL] - Issue count is wrong')
|
2013-07-01 05:19:15 +00:00
|
|
|
|
|
|
|
#newCtrl = {"IssueID": issueid}
|
|
|
|
#newVals = {"Issue_Number": annualval['AnnualIssue'],
|
|
|
|
# "IssueDate": annualval['AnnualDate'],
|
|
|
|
# "IssueName": annualval['AnnualTitle'],
|
|
|
|
# "ComicID": comicid,
|
|
|
|
# "Status": "Skipped"}
|
|
|
|
#myDB.upsert("annuals", newVals, newCtrl)
|
|
|
|
#nb+=1
|
2013-03-21 17:09:10 +00:00
|
|
|
|
|
|
|
#parseit.annualCheck(gcomicid=gcdinfo['GCDComicID'], comicid=comicid, comicname=comic['ComicName'], comicyear=SeriesYear)
|
2012-09-13 15:27:34 +00:00
|
|
|
#comic book location on machine
|
|
|
|
# setup default location here
|
2012-10-16 08:16:29 +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
|
|
|
u_comicnm = comic['ComicName']
|
|
|
|
# let's remove the non-standard characters here that will break filenaming / searching.
|
|
|
|
comicname_filesafe = helpers.filesafe(u_comicnm)
|
2012-10-20 16:14:32 +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
|
|
|
if comlocation is None:
|
|
|
|
comicdir = comicname_filesafe
|
2012-10-30 10:43:01 +00:00
|
|
|
series = comicdir
|
2013-05-25 06:18:00 +00:00
|
|
|
publisher = re.sub('!','',comic['ComicPublisher']) # thanks Boom!
|
2013-03-12 16:13:43 +00:00
|
|
|
year = SeriesYear
|
2013-05-25 06:18:00 +00:00
|
|
|
comversion = comic['ComicVersion']
|
|
|
|
if comversion is None:
|
|
|
|
comversion = 'None'
|
|
|
|
#if comversion is None, remove it so it doesn't populate with 'None'
|
|
|
|
if comversion == 'None':
|
|
|
|
chunk_f_f = re.sub('\$VolumeN','',mylar.FILE_FORMAT)
|
|
|
|
chunk_f = re.compile(r'\s+')
|
|
|
|
mylar.FILE_FORMAT = chunk_f.sub(' ', chunk_f_f)
|
|
|
|
|
2012-10-30 10:43:01 +00:00
|
|
|
#do work to generate folder path
|
|
|
|
|
|
|
|
values = {'$Series': series,
|
2013-01-14 05:12:59 +00:00
|
|
|
'$Publisher': publisher,
|
|
|
|
'$Year': year,
|
|
|
|
'$series': series.lower(),
|
|
|
|
'$publisher': publisher.lower(),
|
2013-05-25 06:18:00 +00:00
|
|
|
'$VolumeY': 'V' + str(year),
|
2014-01-16 20:25:02 +00:00
|
|
|
'$VolumeN': comversion,
|
|
|
|
'$Annual': 'Annual'
|
2012-10-30 10:43:01 +00:00
|
|
|
}
|
|
|
|
|
2013-05-25 06:18:00 +00:00
|
|
|
|
|
|
|
|
2012-10-30 10:43:01 +00:00
|
|
|
#print mylar.FOLDER_FORMAT
|
|
|
|
#print 'working dir:'
|
|
|
|
#print helpers.replace_all(mylar.FOLDER_FORMAT, values)
|
|
|
|
|
|
|
|
if mylar.FOLDER_FORMAT == '':
|
2013-07-31 06:34:07 +00:00
|
|
|
comlocation = os.path.join(mylar.DESTINATION_DIR, comicdir, " (" + SeriesYear + ")")
|
2012-10-30 10:43:01 +00:00
|
|
|
else:
|
2013-07-31 06:34:07 +00:00
|
|
|
comlocation = os.path.join(mylar.DESTINATION_DIR, helpers.replace_all(mylar.FOLDER_FORMAT, values))
|
2012-10-30 10:43:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
#comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + comic['ComicYear'] + ")"
|
2012-10-16 08:16:29 +00:00
|
|
|
if mylar.DESTINATION_DIR == "":
|
2013-09-18 04:49:24 +00:00
|
|
|
logger.error('There is no Comic Location Path specified - please specify one in Config/Web Interface.')
|
2012-10-16 08:16:29 +00:00
|
|
|
return
|
|
|
|
if mylar.REPLACE_SPACES:
|
|
|
|
#mylar.REPLACE_CHAR ...determines what to replace spaces with underscore or dot
|
|
|
|
comlocation = comlocation.replace(' ', mylar.REPLACE_CHAR)
|
2013-03-21 17:09:10 +00:00
|
|
|
|
|
|
|
#moved this out of the above loop so it will chk for existance of comlocation in case moved
|
|
|
|
#if it doesn't exist - create it (otherwise will bugger up later on)
|
2013-08-19 06:14:47 +00:00
|
|
|
if os.path.isdir(comlocation):
|
|
|
|
logger.info('Directory (' + comlocation + ') already exists! Continuing...')
|
2013-03-21 17:09:10 +00:00
|
|
|
else:
|
|
|
|
#print ("Directory doesn't exist!")
|
2013-04-22 03:43:57 +00:00
|
|
|
#try:
|
|
|
|
# os.makedirs(str(comlocation))
|
|
|
|
# logger.info(u"Directory successfully created at: " + str(comlocation))
|
|
|
|
#except OSError:
|
|
|
|
# logger.error(u"Could not create comicdir : " + str(comlocation))
|
|
|
|
filechecker.validateAndCreateDirectory(comlocation, True)
|
2012-09-13 15:27:34 +00:00
|
|
|
|
|
|
|
#try to account for CV not updating new issues as fast as GCD
|
|
|
|
#seems CV doesn't update total counts
|
|
|
|
#comicIssues = gcdinfo['totalissues']
|
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
|
|
|
comicIssues = comic['ComicIssues']
|
|
|
|
|
|
|
|
if not mylar.CV_ONLY:
|
|
|
|
if gcdinfo['gcdvariation'] == "cv":
|
|
|
|
comicIssues = str(int(comic['ComicIssues']) + 1)
|
2012-09-24 05:17:29 +00:00
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
#let's download the image...
|
|
|
|
if os.path.exists(mylar.CACHE_DIR):pass
|
|
|
|
else:
|
|
|
|
#let's make the dir.
|
|
|
|
try:
|
|
|
|
os.makedirs(str(mylar.CACHE_DIR))
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Cache Directory successfully created at: ' + str(mylar.CACHE_DIR))
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2012-10-17 15:57:51 +00:00
|
|
|
except OSError:
|
|
|
|
logger.error('Could not create cache dir. Check permissions of cache dir: ' + str(mylar.CACHE_DIR))
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-03-21 17:09:10 +00:00
|
|
|
coverfile = os.path.join(mylar.CACHE_DIR, str(comicid) + ".jpg")
|
2012-10-16 08:16: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
|
|
|
#if cover has '+' in url it's malformed, we need to replace '+' with '%20' to retreive properly.
|
|
|
|
#thisci = urllib.quote_plus(str(comic['ComicImage']))
|
|
|
|
|
|
|
|
#urllib.urlretrieve(str(thisci), str(coverfile))
|
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
try:
|
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
|
|
|
cimage = re.sub('[\+]','%20', comic['ComicImage'])
|
|
|
|
request = urllib2.Request(cimage)#, headers={'Content-Type': 'application/x-www-form-urlencoded'})
|
|
|
|
#request.add_header('User-Agent', str(mylar.USER_AGENT))
|
|
|
|
|
|
|
|
response = urllib2.urlopen(request)
|
|
|
|
|
|
|
|
com_image = response.read()
|
|
|
|
|
|
|
|
with open(coverfile, 'wb') as the_file:
|
|
|
|
the_file.write(com_image)
|
|
|
|
|
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:
|
|
|
|
logger.info('Image header check: ' + imghdr.what(coverfile))
|
|
|
|
except:
|
|
|
|
logger.info('image is corrupted.')
|
|
|
|
raise Exception
|
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.info('Successfully retrieved cover for ' + comic['ComicName'])
|
|
|
|
|
|
|
|
except Exception, e:
|
|
|
|
logger.warn('[%s] Error fetching data using : %s' % (e, comic['ComicImage']))
|
2014-06-02 19:02:28 +00:00
|
|
|
logger.info('Attempting to use alternate image size to get cover.')
|
|
|
|
try:
|
|
|
|
cimage = re.sub('[\+]','%20', comic['ComicImageALT'])
|
|
|
|
request = urllib2.Request(cimage)
|
|
|
|
response = urllib2.urlopen(request)
|
|
|
|
com_image = response.read()
|
|
|
|
with open(coverfile, 'wb') as the_file:
|
|
|
|
the_file.write(com_image)
|
|
|
|
|
|
|
|
logger.info('Successfully retrieved cover for ' + comic['ComicName'])
|
|
|
|
except Exception, e:
|
|
|
|
logger.warn('[%s] Error fetching data using : %s' % (e, comic['ComicImageALT']))
|
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
|
|
|
|
|
|
|
PRComicImage = os.path.join('cache',str(comicid) + ".jpg")
|
|
|
|
ComicImage = helpers.replacetheslash(PRComicImage)
|
2013-03-21 17:09:10 +00:00
|
|
|
|
|
|
|
#this is for Firefox when outside the LAN...it works, but I don't know how to implement it
|
|
|
|
#without breaking the normal flow for inside the LAN (above)
|
|
|
|
#ComicImage = "http://" + str(mylar.HTTP_HOST) + ":" + str(mylar.HTTP_PORT) + "/cache/" + str(comicid) + ".jpg"
|
|
|
|
|
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 the comic cover local is checked, save a cover.jpg to the series folder.
|
|
|
|
if mylar.COMIC_COVER_LOCAL:
|
|
|
|
try:
|
|
|
|
comiclocal = os.path.join(comlocation,'cover.jpg')
|
2014-08-27 02:20:16 +00:00
|
|
|
shutil.copy(coverfile,comiclocal)
|
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
|
|
|
except IOError as e:
|
2014-08-27 02:20:16 +00:00
|
|
|
logger.error('Unable to save cover (' + str(coverfile) + ') into series directory (' + str(comiclocal) + ') at this time.')
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-12-09 19:44:26 +00:00
|
|
|
if oldcomversion is None or oldcomversion == "None":
|
|
|
|
logger.info('previous version detected as None - seeing if update required')
|
2013-05-26 03:18:29 +00:00
|
|
|
if comic['ComicVersion'].isdigit():
|
|
|
|
comicVol = "v" + comic['ComicVersion']
|
2013-12-09 19:44:26 +00:00
|
|
|
logger.info('updated version to :' + str(comicVol))
|
2013-05-26 03:18:29 +00:00
|
|
|
else:
|
|
|
|
comicVol = None
|
2013-03-11 17:25:45 +00:00
|
|
|
else:
|
2013-05-26 03:18:29 +00:00
|
|
|
comicVol = oldcomversion
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-05-15 09:04:26 +00:00
|
|
|
#for description ...
|
|
|
|
#Cdesc = helpers.cleanhtml(comic['ComicDescription'])
|
|
|
|
#cdes_find = Cdesc.find("Collected")
|
|
|
|
#cdes_removed = Cdesc[:cdes_find]
|
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.fdebug('description: ' + cdes_removed)
|
2013-05-15 09:04:26 +00:00
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
controlValueDict = {"ComicID": comicid}
|
|
|
|
newValueDict = {"ComicName": comic['ComicName'],
|
|
|
|
"ComicSortName": sortname,
|
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_Filesafe": comicname_filesafe,
|
2013-03-12 16:13:43 +00:00
|
|
|
"ComicYear": SeriesYear,
|
2012-10-16 08:16:29 +00:00
|
|
|
"ComicImage": ComicImage,
|
2012-09-13 15:27:34 +00:00
|
|
|
"Total": comicIssues,
|
2013-03-11 17:25:45 +00:00
|
|
|
"ComicVersion": comicVol,
|
2012-09-13 15:27:34 +00:00
|
|
|
"ComicLocation": comlocation,
|
|
|
|
"ComicPublisher": comic['ComicPublisher'],
|
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
|
|
|
# "Description": Cdesc, #.dencode('utf-8', 'replace'),
|
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
|
|
|
"DetailURL": comic['ComicURL'],
|
|
|
|
# "ComicPublished": gcdinfo['resultPublished'],
|
2013-08-04 05:57:21 +00:00
|
|
|
"ComicPublished": "Unknown",
|
2012-09-13 15:27:34 +00:00
|
|
|
"DateAdded": helpers.today(),
|
|
|
|
"Status": "Loading"}
|
|
|
|
|
|
|
|
myDB.upsert("comics", newValueDict, controlValueDict)
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-03-21 17:09:10 +00:00
|
|
|
#comicsort here...
|
|
|
|
#run the re-sortorder here in order to properly display the page
|
|
|
|
if pullupd is None:
|
|
|
|
helpers.ComicSort(sequence='update')
|
2013-03-14 08:33:16 +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 CV_NoYearGiven == 'no':
|
|
|
|
#if set to 'no' then we haven't pulled down the issues, otherwise we did it already
|
|
|
|
issued = cv.getComic(comicid,'issue')
|
2014-06-09 18:34:53 +00:00
|
|
|
if issued is None:
|
|
|
|
logger.warn('Unable to retrieve data from ComicVine. Get your own API key already!')
|
|
|
|
return
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Sucessfully retrieved issue details for ' + comic['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
|
|
|
|
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
|
|
|
#move to own function so can call independently to only refresh issue data
|
|
|
|
#issued is from cv.getComic, comic['ComicName'] & comicid would both be already known to do independent call.
|
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
|
|
|
issuedata = updateissuedata(comicid, comic['ComicName'], issued, comicIssues, calledfrom, SeriesYear=SeriesYear, latestissueinfo=latestissueinfo)
|
2014-06-09 18:34:53 +00:00
|
|
|
if issuedata is None:
|
|
|
|
logger.warn('Unable to complete Refreshing / Adding issue data - this WILL create future problems if not addressed.')
|
|
|
|
return
|
2013-01-23 08:22:22 +00:00
|
|
|
|
2013-04-10 16:45:56 +00:00
|
|
|
if mylar.CVINFO or (mylar.CV_ONLY and mylar.CVINFO):
|
|
|
|
if not os.path.exists(os.path.join(comlocation,"cvinfo")) or mylar.CV_ONETIMER:
|
|
|
|
with open(os.path.join(comlocation,"cvinfo"),"w") as text_file:
|
|
|
|
text_file.write(str(comic['ComicURL']))
|
2012-09-13 15:27:34 +00:00
|
|
|
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Updating complete for: ' + comic['ComicName'])
|
2013-02-09 03:34:02 +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
|
|
|
if calledfrom == 'weekly':
|
|
|
|
logger.info('Successfully refreshed ' + comic['ComicName'] + ' (' + str(SeriesYear) + '). Returning to Weekly issue comparison.')
|
|
|
|
logger.info('Update issuedata for ' + str(issuechk) + ' of : ' + str(weeklyissue_check))
|
|
|
|
return issuedata # this should be the weeklyissue_check data from updateissuedata function
|
|
|
|
|
|
|
|
elif calledfrom == 'dbupdate':
|
|
|
|
logger.info('returning to dbupdate module')
|
|
|
|
return #issuedata # this should be the issuedata data from updateissuedata function
|
|
|
|
|
|
|
|
elif calledfrom == 'weeklycheck':
|
|
|
|
logger.info('Successfully refreshed ' + comic['ComicName'] + ' (' + str(SeriesYear) + '). Returning to Weekly issue update.')
|
|
|
|
return #no need to return any data here.
|
|
|
|
|
|
|
|
|
|
|
|
#if it made it here, then the issuedata contains dates, let's pull the data now.
|
|
|
|
latestiss = issuedata['LatestIssue']
|
|
|
|
latestdate = issuedata['LatestDate']
|
|
|
|
lastpubdate = issuedata['LastPubDate']
|
|
|
|
|
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
|
|
|
#move the files...if imported is not empty & not futurecheck (meaning it's not from the mass importer.)
|
|
|
|
if imported is None or imported == 'None' or imported == 'futurecheck':
|
2013-02-09 03:34:02 +00:00
|
|
|
pass
|
|
|
|
else:
|
|
|
|
if mylar.IMP_MOVE:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Mass import - Move files')
|
2013-02-13 01:27:24 +00:00
|
|
|
moveit.movefiles(comicid,comlocation,ogcname)
|
2013-02-17 10:31:18 +00:00
|
|
|
else:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Mass import - Moving not Enabled. Setting Archived Status for import.')
|
2013-02-17 10:31:18 +00:00
|
|
|
moveit.archivefiles(comicid,ogcname)
|
2013-02-06 19:55:23 +00:00
|
|
|
|
|
|
|
#check for existing files...
|
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
|
|
|
statbefore = myDB.selectone("SELECT * FROM issues WHERE ComicID=? AND Issue_Number=?", [comicid,str(latestiss)]).fetchone()
|
2014-02-26 19:48:50 +00:00
|
|
|
logger.fdebug('issue: ' + str(latestiss) + ' status before chk :' + str(statbefore['Status']))
|
2013-02-06 19:55:23 +00:00
|
|
|
updater.forceRescan(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
|
|
|
statafter = myDB.selectone("SELECT * FROM issues WHERE ComicID=? AND Issue_Number=?", [comicid,str(latestiss)]).fetchone()
|
2014-02-26 19:48:50 +00:00
|
|
|
logger.fdebug('issue: ' + str(latestiss) + ' status after chk :' + str(statafter['Status']))
|
2013-02-06 19:55:23 +00:00
|
|
|
|
2013-01-02 16:57:28 +00:00
|
|
|
if pullupd is None:
|
2013-01-18 09:18:31 +00:00
|
|
|
# lets' check the pullist for anything at this time as well since we're here.
|
|
|
|
# do this for only Present comics....
|
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.AUTOWANT_UPCOMING and lastpubdate == 'Present' and series_status == 'Active': #and 'Present' in gcdinfo['resultPublished']:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.fdebug('latestissue: #' + str(latestiss))
|
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
|
|
|
chkstats = myDB.selectone("SELECT * FROM issues WHERE ComicID=? AND Issue_Number=?", [comicid,str(latestiss)]).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
|
|
|
logger.fdebug('latestissue status: ' + chkstats['Status'])
|
2014-02-26 19:48:50 +00:00
|
|
|
if chkstats['Status'] == 'Skipped' or chkstats['Status'] == 'Wanted' or chkstats['Status'] == 'Snatched':
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Checking this week pullist for new issues of ' + comic['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
|
|
|
if comic['ComicName'] != comicname_filesafe:
|
|
|
|
cn_pull = comicname_filesafe
|
|
|
|
else:
|
|
|
|
cn_pull = comic['ComicName']
|
|
|
|
updater.newpullcheck(cn_pull, comicid, issue=latestiss)
|
2013-05-15 09:04:26 +00:00
|
|
|
|
|
|
|
#here we grab issues that have been marked as wanted above...
|
2012-09-13 15:27:34 +00:00
|
|
|
|
2013-05-15 09:04:26 +00:00
|
|
|
results = myDB.select("SELECT * FROM issues where ComicID=? AND Status='Wanted'", [comicid])
|
|
|
|
if results:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Attempting to grab wanted issues for : ' + comic['ComicName'])
|
2013-05-15 09:04:26 +00:00
|
|
|
|
|
|
|
for result in results:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.fdebug('Searching for : ' + str(result['Issue_Number']))
|
|
|
|
logger.fdebug('Status of : ' + str(result['Status']))
|
2013-05-15 09:04:26 +00:00
|
|
|
search.searchforissue(result['IssueID'])
|
2013-08-19 06:14:47 +00:00
|
|
|
else: logger.info('No issues marked as wanted for ' + comic['ComicName'])
|
2012-09-13 15:27:34 +00:00
|
|
|
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Finished grabbing what I could.')
|
2013-05-15 09:04:26 +00:00
|
|
|
else:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.info('Already have the latest issue : #' + str(latestiss))
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2014-03-19 19:07:25 +00:00
|
|
|
if chkwant is not None:
|
|
|
|
#if this isn't None, this is being called from the futureupcoming list
|
|
|
|
#a new series was added automagically, but it has more than 1 issue (probably because it was a back-dated issue)
|
|
|
|
#the chkwant is a tuple containing all the data for the given series' issues that were marked as Wanted for futureupcoming dates.
|
|
|
|
chkresults = myDB.select("SELECT * FROM issues WHERE ComicID=? AND Status='Skipped'", [comicid])
|
|
|
|
if chkresults:
|
|
|
|
logger.info('[FROM THE FUTURE CHECKLIST] Attempting to grab wanted issues for : ' + comic['ComicName'])
|
|
|
|
for result in chkresults:
|
|
|
|
for chkit in chkwant:
|
|
|
|
logger.fdebug('checking ' + str(chkit['IssueNumber']) + ' against ' + str(result['Issue_Number']))
|
|
|
|
if chkit['IssueNumber'] == result['Issue_Number']:
|
|
|
|
logger.fdebug('Searching for : ' + str(result['Issue_Number']))
|
|
|
|
logger.fdebug('Status of : ' + str(result['Status']))
|
|
|
|
search.searchforissue(result['IssueID'])
|
|
|
|
else: logger.info('No issues marked as wanted for ' + comic['ComicName'])
|
|
|
|
|
|
|
|
logger.info('Finished grabbing what I could.')
|
|
|
|
|
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 imported == 'futurecheck':
|
|
|
|
logger.info('Returning to Future-Check module to complete the add & remove entry.')
|
|
|
|
return
|
2014-03-19 19:07:25 +00:00
|
|
|
|
2014-01-31 06:36:58 +00:00
|
|
|
if calledfrom == 'addbyid':
|
2014-02-26 19:48:50 +00:00
|
|
|
logger.info('Sucessfully added ' + comic['ComicName'] + ' (' + str(SeriesYear) + ') by directly using the ComicVine ID')
|
|
|
|
return
|
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
def GCDimport(gcomicid, pullupd=None,imported=None,ogcname=None):
|
2012-10-16 08:16:29 +00:00
|
|
|
# this is for importing via GCD only and not using CV.
|
|
|
|
# used when volume spanning is discovered for a Comic (and can't be added using CV).
|
|
|
|
# Issue Counts are wrong (and can't be added).
|
|
|
|
|
|
|
|
# because Comicvine ComicID and GCD ComicID could be identical at some random point, let's distinguish.
|
|
|
|
# CV = comicid, GCD = gcomicid :) (ie. CV=2740, GCD=G3719)
|
|
|
|
|
|
|
|
gcdcomicid = gcomicid
|
|
|
|
myDB = db.DBConnection()
|
|
|
|
|
|
|
|
# We need the current minimal info in the database instantly
|
|
|
|
# so we don't throw a 500 error when we redirect to the artistPage
|
|
|
|
|
|
|
|
controlValueDict = {"ComicID": gcdcomicid}
|
|
|
|
|
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 ComicName, ComicYear, Total, ComicPublished, ComicImage, ComicLocation, ComicPublisher FROM comics WHERE ComicID=?', [gcomicid]).fetchone()
|
2012-10-16 08:16:29 +00:00
|
|
|
ComicName = comic[0]
|
|
|
|
ComicYear = comic[1]
|
|
|
|
ComicIssues = comic[2]
|
2013-01-18 09:18:31 +00:00
|
|
|
ComicPublished = comic[3]
|
2012-10-16 08:16:29 +00:00
|
|
|
comlocation = comic[5]
|
2013-01-07 19:26:10 +00:00
|
|
|
ComicPublisher = comic[6]
|
2012-10-16 08:16:29 +00:00
|
|
|
#ComicImage = comic[4]
|
|
|
|
#print ("Comic:" + str(ComicName))
|
|
|
|
|
|
|
|
newValueDict = {"Status": "Loading"}
|
|
|
|
myDB.upsert("comics", newValueDict, controlValueDict)
|
|
|
|
|
|
|
|
# we need to lookup the info for the requested ComicID in full now
|
|
|
|
#comic = cv.getComic(comicid,'comic')
|
|
|
|
|
|
|
|
if not comic:
|
2013-08-19 06:14:47 +00:00
|
|
|
logger.warn('Error fetching comic. ID for : ' + gcdcomicid)
|
2012-10-16 08:16:29 +00:00
|
|
|
if dbcomic is None:
|
|
|
|
newValueDict = {"ComicName": "Fetch failed, try refreshing. (%s)" % (gcdcomicid),
|
|
|
|
"Status": "Active"}
|
|
|
|
else:
|
|
|
|
newValueDict = {"Status": "Active"}
|
|
|
|
myDB.upsert("comics", newValueDict, controlValueDict)
|
|
|
|
return
|
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
#run the re-sortorder here in order to properly display the page
|
|
|
|
if pullupd is None:
|
|
|
|
helpers.ComicSort(comicorder=mylar.COMICSORT, imported=gcomicid)
|
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
if ComicName.startswith('The '):
|
|
|
|
sortname = ComicName[4:]
|
|
|
|
else:
|
|
|
|
sortname = ComicName
|
|
|
|
|
|
|
|
|
|
|
|
logger.info(u"Now adding/updating: " + ComicName)
|
|
|
|
#--Now that we know ComicName, let's try some scraping
|
|
|
|
#--Start
|
|
|
|
# gcd will return issue details (most importantly publishing date)
|
|
|
|
comicid = gcomicid[1:]
|
|
|
|
resultURL = "/series/" + str(comicid) + "/"
|
|
|
|
gcdinfo=parseit.GCDdetails(comseries=None, resultURL=resultURL, vari_loop=0, ComicID=gcdcomicid, TotalIssues=ComicIssues, issvariation=None, resultPublished=None)
|
|
|
|
if gcdinfo == "No Match":
|
|
|
|
logger.warn("No matching result found for " + ComicName + " (" + ComicYear + ")" )
|
|
|
|
updater.no_searchresults(gcomicid)
|
|
|
|
nomatch = "true"
|
|
|
|
return nomatch
|
|
|
|
logger.info(u"Sucessfully retrieved details for " + ComicName )
|
|
|
|
# print ("Series Published" + parseit.resultPublished)
|
|
|
|
#--End
|
|
|
|
|
|
|
|
ComicImage = gcdinfo['ComicImage']
|
|
|
|
|
|
|
|
#comic book location on machine
|
|
|
|
# setup default location here
|
|
|
|
if comlocation is None:
|
2013-03-08 01:36:36 +00:00
|
|
|
# let's remove the non-standard characters here.
|
2013-03-26 07:50:00 +00:00
|
|
|
u_comicnm = ComicName
|
2013-03-08 01:36:36 +00:00
|
|
|
u_comicname = u_comicnm.encode('ascii', 'ignore').strip()
|
|
|
|
if ':' in u_comicname or '/' in u_comicname or ',' in u_comicname:
|
|
|
|
comicdir = u_comicname
|
2012-10-20 16:14:32 +00:00
|
|
|
if ':' in comicdir:
|
|
|
|
comicdir = comicdir.replace(':','')
|
|
|
|
if '/' in comicdir:
|
|
|
|
comicdir = comicdir.replace('/','-')
|
2012-10-31 16:03:15 +00:00
|
|
|
if ',' in comicdir:
|
|
|
|
comicdir = comicdir.replace(',','')
|
2013-03-08 01:36:36 +00:00
|
|
|
else: comicdir = u_comicname
|
2013-01-07 19:26:10 +00:00
|
|
|
|
|
|
|
series = comicdir
|
|
|
|
publisher = ComicPublisher
|
|
|
|
year = ComicYear
|
|
|
|
|
|
|
|
#do work to generate folder path
|
|
|
|
values = {'$Series': series,
|
2013-01-14 05:12:59 +00:00
|
|
|
'$Publisher': publisher,
|
|
|
|
'$Year': year,
|
|
|
|
'$series': series.lower(),
|
|
|
|
'$publisher': publisher.lower(),
|
|
|
|
'$Volume': year
|
2013-01-07 19:26:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if mylar.FOLDER_FORMAT == '':
|
|
|
|
comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + comic['ComicYear'] + ")"
|
|
|
|
else:
|
|
|
|
comlocation = mylar.DESTINATION_DIR + "/" + helpers.replace_all(mylar.FOLDER_FORMAT, values)
|
|
|
|
|
|
|
|
#comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + ComicYear + ")"
|
2012-10-16 08:16:29 +00:00
|
|
|
if mylar.DESTINATION_DIR == "":
|
|
|
|
logger.error(u"There is no general directory specified - please specify in Config/Post-Processing.")
|
|
|
|
return
|
|
|
|
if mylar.REPLACE_SPACES:
|
|
|
|
#mylar.REPLACE_CHAR ...determines what to replace spaces with underscore or dot
|
|
|
|
comlocation = comlocation.replace(' ', mylar.REPLACE_CHAR)
|
2013-03-26 07:50:00 +00:00
|
|
|
|
|
|
|
#if it doesn't exist - create it (otherwise will bugger up later on)
|
2013-08-19 06:14:47 +00:00
|
|
|
if os.path.isdir(comlocation):
|
|
|
|
logger.info(u"Directory (" + comlocation + ") already exists! Continuing...")
|
2013-03-26 07:50:00 +00:00
|
|
|
else:
|
|
|
|
#print ("Directory doesn't exist!")
|
2013-04-22 03:43:57 +00:00
|
|
|
#try:
|
|
|
|
# os.makedirs(str(comlocation))
|
|
|
|
# logger.info(u"Directory successfully created at: " + str(comlocation))
|
|
|
|
#except OSError:
|
|
|
|
# logger.error(u"Could not create comicdir : " + str(comlocation))
|
|
|
|
filechecker.validateAndCreateDirectory(comlocation, True)
|
2012-10-16 08:16:29 +00:00
|
|
|
|
|
|
|
comicIssues = gcdinfo['totalissues']
|
|
|
|
|
|
|
|
#let's download the image...
|
|
|
|
if os.path.exists(mylar.CACHE_DIR):pass
|
|
|
|
else:
|
|
|
|
#let's make the dir.
|
|
|
|
try:
|
|
|
|
os.makedirs(str(mylar.CACHE_DIR))
|
|
|
|
logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR))
|
|
|
|
|
2012-10-17 15:57:51 +00:00
|
|
|
except OSError:
|
|
|
|
logger.error(u"Could not create cache dir : " + str(mylar.CACHE_DIR))
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
coverfile = os.path.join(mylar.CACHE_DIR, str(gcomicid) + ".jpg")
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
#try:
|
2012-10-16 08:16:29 +00:00
|
|
|
urllib.urlretrieve(str(ComicImage), str(coverfile))
|
|
|
|
try:
|
|
|
|
with open(str(coverfile)) as f:
|
2013-03-26 07:50:00 +00:00
|
|
|
ComicImage = os.path.join('cache',str(gcomicid) + ".jpg")
|
|
|
|
|
|
|
|
#this is for Firefox when outside the LAN...it works, but I don't know how to implement it
|
|
|
|
#without breaking the normal flow for inside the LAN (above)
|
|
|
|
#ComicImage = "http://" + str(mylar.HTTP_HOST) + ":" + str(mylar.HTTP_PORT) + "/cache/" + str(comi$
|
|
|
|
|
2013-03-08 01:36:36 +00:00
|
|
|
logger.info(u"Sucessfully retrieved cover for " + ComicName)
|
2013-03-26 07:50:00 +00:00
|
|
|
#if the comic cover local is checked, save a cover.jpg to the series folder.
|
|
|
|
if mylar.COMIC_COVER_LOCAL:
|
2013-08-19 06:14:47 +00:00
|
|
|
comiclocal = os.path.join(comlocation + "/cover.jpg")
|
2013-03-26 07:50:00 +00:00
|
|
|
shutil.copy(ComicImage,comiclocal)
|
2012-10-16 08:16:29 +00:00
|
|
|
except IOError as e:
|
|
|
|
logger.error(u"Unable to save cover locally at this time.")
|
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
#if comic['ComicVersion'].isdigit():
|
|
|
|
# comicVol = "v" + comic['ComicVersion']
|
|
|
|
#else:
|
|
|
|
# comicVol = None
|
|
|
|
|
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
controlValueDict = {"ComicID": gcomicid}
|
|
|
|
newValueDict = {"ComicName": ComicName,
|
|
|
|
"ComicSortName": sortname,
|
|
|
|
"ComicYear": ComicYear,
|
|
|
|
"Total": comicIssues,
|
|
|
|
"ComicLocation": comlocation,
|
2013-03-26 07:50:00 +00:00
|
|
|
#"ComicVersion": comicVol,
|
2012-10-16 08:16:29 +00:00
|
|
|
"ComicImage": ComicImage,
|
|
|
|
#"ComicPublisher": comic['ComicPublisher'],
|
|
|
|
#"ComicPublished": comicPublished,
|
|
|
|
"DateAdded": helpers.today(),
|
|
|
|
"Status": "Loading"}
|
|
|
|
|
|
|
|
myDB.upsert("comics", newValueDict, controlValueDict)
|
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
#comicsort here...
|
|
|
|
#run the re-sortorder here in order to properly display the page
|
|
|
|
if pullupd is None:
|
|
|
|
helpers.ComicSort(sequence='update')
|
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
logger.info(u"Sucessfully retrieved issue details for " + ComicName )
|
|
|
|
n = 0
|
|
|
|
iscnt = int(comicIssues)
|
|
|
|
issnum = []
|
|
|
|
issname = []
|
|
|
|
issdate = []
|
|
|
|
int_issnum = []
|
|
|
|
#let's start issue #'s at 0 -- thanks to DC for the new 52 reboot! :)
|
|
|
|
latestiss = "0"
|
|
|
|
latestdate = "0000-00-00"
|
|
|
|
#print ("total issues:" + str(iscnt))
|
|
|
|
#---removed NEW code here---
|
|
|
|
logger.info(u"Now adding/updating issues for " + ComicName)
|
|
|
|
bb = 0
|
|
|
|
while (bb <= iscnt):
|
|
|
|
#---NEW.code
|
|
|
|
try:
|
|
|
|
gcdval = gcdinfo['gcdchoice'][bb]
|
2012-10-16 15:53:46 +00:00
|
|
|
#print ("gcdval: " + str(gcdval))
|
2012-10-16 08:16:29 +00:00
|
|
|
except IndexError:
|
|
|
|
#account for gcd variation here
|
|
|
|
if gcdinfo['gcdvariation'] == 'gcd':
|
|
|
|
#print ("gcd-variation accounted for.")
|
|
|
|
issdate = '0000-00-00'
|
|
|
|
int_issnum = int ( issis / 1000 )
|
|
|
|
break
|
|
|
|
if 'nn' in str(gcdval['GCDIssue']):
|
|
|
|
#no number detected - GN, TP or the like
|
|
|
|
logger.warn(u"Non Series detected (Graphic Novel, etc) - cannot proceed at this time.")
|
|
|
|
updater.no_searchresults(comicid)
|
|
|
|
return
|
|
|
|
elif '.' in str(gcdval['GCDIssue']):
|
|
|
|
issst = str(gcdval['GCDIssue']).find('.')
|
|
|
|
issb4dec = str(gcdval['GCDIssue'])[:issst]
|
|
|
|
#if the length of decimal is only 1 digit, assume it's a tenth
|
|
|
|
decis = str(gcdval['GCDIssue'])[issst+1:]
|
|
|
|
if len(decis) == 1:
|
|
|
|
decisval = int(decis) * 10
|
|
|
|
issaftdec = str(decisval)
|
|
|
|
if len(decis) == 2:
|
|
|
|
decisval = int(decis)
|
|
|
|
issaftdec = str(decisval)
|
|
|
|
if int(issaftdec) == 0: issaftdec = "00"
|
|
|
|
gcd_issue = issb4dec + "." + issaftdec
|
|
|
|
gcdis = (int(issb4dec) * 1000) + decisval
|
|
|
|
else:
|
|
|
|
gcdis = int(str(gcdval['GCDIssue'])) * 1000
|
|
|
|
gcd_issue = str(gcdval['GCDIssue'])
|
|
|
|
#get the latest issue / date using the date.
|
|
|
|
int_issnum = int( gcdis / 1000 )
|
|
|
|
issdate = str(gcdval['GCDDate'])
|
|
|
|
issid = "G" + str(gcdval['IssueID'])
|
|
|
|
if gcdval['GCDDate'] > latestdate:
|
|
|
|
latestiss = str(gcd_issue)
|
|
|
|
latestdate = str(gcdval['GCDDate'])
|
|
|
|
#print("(" + str(bb) + ") IssueID: " + str(issid) + " IssueNo: " + str(gcd_issue) + " Date" + str(issdate) )
|
|
|
|
#---END.NEW.
|
|
|
|
|
|
|
|
# check if the issue already exists
|
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
|
|
|
iss_exists = myDB.selectone('SELECT * from issues WHERE IssueID=?', [issid]).fetchone()
|
2012-10-16 08:16:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Only change the status & add DateAdded if the issue is not already in the database
|
2012-10-31 16:03:15 +00:00
|
|
|
if iss_exists is None:
|
2012-10-16 08:16:29 +00:00
|
|
|
newValueDict['DateAdded'] = helpers.today()
|
|
|
|
|
|
|
|
#adjust for inconsistencies in GCD date format - some dates have ? which borks up things.
|
|
|
|
if "?" in str(issdate):
|
|
|
|
issdate = "0000-00-00"
|
|
|
|
|
|
|
|
controlValueDict = {"IssueID": issid}
|
|
|
|
newValueDict = {"ComicID": gcomicid,
|
|
|
|
"ComicName": ComicName,
|
|
|
|
"Issue_Number": gcd_issue,
|
|
|
|
"IssueDate": issdate,
|
|
|
|
"Int_IssueNumber": int_issnum
|
|
|
|
}
|
|
|
|
|
|
|
|
#print ("issueid:" + str(controlValueDict))
|
|
|
|
#print ("values:" + str(newValueDict))
|
|
|
|
|
|
|
|
if mylar.AUTOWANT_ALL:
|
|
|
|
newValueDict['Status'] = "Wanted"
|
2013-01-01 20:32:22 +00:00
|
|
|
elif issdate > helpers.today() and mylar.AUTOWANT_UPCOMING:
|
|
|
|
newValueDict['Status'] = "Wanted"
|
2012-10-16 08:16:29 +00:00
|
|
|
else:
|
|
|
|
newValueDict['Status'] = "Skipped"
|
|
|
|
|
2012-10-21 15:30:26 +00:00
|
|
|
if iss_exists:
|
|
|
|
#print ("Existing status : " + str(iss_exists['Status']))
|
|
|
|
newValueDict['Status'] = iss_exists['Status']
|
|
|
|
|
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
myDB.upsert("issues", newValueDict, controlValueDict)
|
|
|
|
bb+=1
|
|
|
|
|
|
|
|
# logger.debug(u"Updating comic cache for " + ComicName)
|
|
|
|
# cache.getThumb(ComicID=issue['issueid'])
|
|
|
|
|
|
|
|
# logger.debug(u"Updating cache for: " + ComicName)
|
|
|
|
# cache.getThumb(ComicIDcomicid)
|
|
|
|
|
|
|
|
|
|
|
|
controlValueStat = {"ComicID": gcomicid}
|
|
|
|
newValueStat = {"Status": "Active",
|
|
|
|
"LatestIssue": latestiss,
|
|
|
|
"LatestDate": latestdate,
|
|
|
|
"LastUpdated": helpers.now()
|
|
|
|
}
|
|
|
|
|
|
|
|
myDB.upsert("comics", newValueStat, controlValueStat)
|
|
|
|
|
2013-01-23 08:22:22 +00:00
|
|
|
if mylar.CVINFO:
|
|
|
|
if not os.path.exists(comlocation + "/cvinfo"):
|
|
|
|
with open(comlocation + "/cvinfo","w") as text_file:
|
2013-03-08 01:36:36 +00:00
|
|
|
text_file.write("http://www.comicvine.com/volume/49-" + str(comicid))
|
2013-01-23 08:22:22 +00:00
|
|
|
|
2012-10-16 08:16:29 +00:00
|
|
|
logger.info(u"Updating complete for: " + ComicName)
|
|
|
|
|
2013-03-26 07:50:00 +00:00
|
|
|
#move the files...if imported is not empty (meaning it's not from the mass importer.)
|
|
|
|
if imported is None or imported == 'None':
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
if mylar.IMP_MOVE:
|
|
|
|
logger.info("Mass import - Move files")
|
|
|
|
moveit.movefiles(gcomicid,comlocation,ogcname)
|
|
|
|
else:
|
|
|
|
logger.info("Mass import - Moving not Enabled. Setting Archived Status for import.")
|
|
|
|
moveit.archivefiles(gcomicid,ogcname)
|
|
|
|
|
|
|
|
#check for existing files...
|
|
|
|
updater.forceRescan(gcomicid)
|
|
|
|
|
|
|
|
|
2013-01-02 16:57:28 +00:00
|
|
|
if pullupd is None:
|
2013-01-01 20:09:28 +00:00
|
|
|
# lets' check the pullist for anyting at this time as well since we're here.
|
2013-01-18 09:18:31 +00:00
|
|
|
if mylar.AUTOWANT_UPCOMING and 'Present' in ComicPublished:
|
2013-03-08 01:36:36 +00:00
|
|
|
logger.info(u"Checking this week's pullist for new issues of " + ComicName)
|
2013-01-06 08:51:44 +00:00
|
|
|
updater.newpullcheck(comic['ComicName'], gcomicid)
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-01-01 20:09:28 +00:00
|
|
|
#here we grab issues that have been marked as wanted above...
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-01-01 20:09:28 +00:00
|
|
|
results = myDB.select("SELECT * FROM issues where ComicID=? AND Status='Wanted'", [gcomicid])
|
|
|
|
if results:
|
|
|
|
logger.info(u"Attempting to grab wanted issues for : " + ComicName)
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-01-01 20:09:28 +00:00
|
|
|
for result in results:
|
|
|
|
foundNZB = "none"
|
2013-01-18 09:18:31 +00:00
|
|
|
if (mylar.NZBSU or mylar.DOGNZB or mylar.EXPERIMENTAL or mylar.NEWZNAB or mylar.NZBX) and (mylar.SAB_HOST):
|
2013-01-01 20:09:28 +00:00
|
|
|
foundNZB = search.searchforissue(result['IssueID'])
|
|
|
|
if foundNZB == "yes":
|
|
|
|
updater.foundsearch(result['ComicID'], result['IssueID'])
|
|
|
|
else: logger.info(u"No issues marked as wanted for " + ComicName)
|
2012-10-16 08:16:29 +00:00
|
|
|
|
2013-01-01 20:09:28 +00:00
|
|
|
logger.info(u"Finished grabbing what I could.")
|
2012-10-16 08:16: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 issue_collection(issuedata,nostatus):
|
|
|
|
myDB = db.DBConnection()
|
|
|
|
|
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
|
|
|
nowdate = datetime.datetime.now()
|
|
|
|
nowtime = nowdate.strftime("%Y%m%d")
|
|
|
|
|
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 issuedata:
|
|
|
|
for issue in issuedata:
|
|
|
|
|
|
|
|
|
|
|
|
controlValueDict = {"IssueID": issue['IssueID']}
|
|
|
|
newValueDict = {"ComicID": issue['ComicID'],
|
|
|
|
"ComicName": issue['ComicName'],
|
|
|
|
"IssueName": issue['IssueName'],
|
|
|
|
"Issue_Number": issue['Issue_Number'],
|
|
|
|
"IssueDate": issue['IssueDate'],
|
2014-02-26 19:48:50 +00:00
|
|
|
"ReleaseDate": issue['ReleaseDate'],
|
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
|
|
|
"Int_IssueNumber": issue['Int_IssueNumber']
|
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
|
|
|
#"Status": "Skipped" #set this to Skipped by default to avoid NULL entries.
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
# check if the issue already exists
|
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
|
|
|
iss_exists = myDB.selectone('SELECT * from issues WHERE IssueID=?', [issue['IssueID']]).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 nostatus == 'False':
|
|
|
|
|
|
|
|
# Only change the status & add DateAdded if the issue is already in the database
|
|
|
|
if iss_exists is None:
|
|
|
|
newValueDict['DateAdded'] = helpers.today()
|
2014-08-18 19:54:34 +00:00
|
|
|
datechk = re.sub('-','', issue['ReleaseDate']).strip() # converts date to 20140718 format
|
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('issue #' + str(issue['Issue_Number']) + 'does not exist in db.')
|
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.AUTOWANT_ALL:
|
|
|
|
newValueDict['Status'] = "Wanted"
|
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
|
|
|
#logger.fdebug('autowant all')
|
2014-08-18 19:54:34 +00:00
|
|
|
elif int(datechk) >= int(nowtime) and mylar.AUTOWANT_UPCOMING:
|
|
|
|
#logger.fdebug(str(datechk) + ' >= ' + str(nowtime))
|
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
|
|
|
newValueDict['Status'] = "Wanted"
|
|
|
|
else:
|
|
|
|
newValueDict['Status'] = "Skipped"
|
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
|
|
|
#logger.fdebug('status is : ' + str(newValueDict))
|
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:(#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
|
|
|
#logger.fdebug('Existing status for issue #' + str(issue['Issue_Number']) + ' : ' + str(iss_exists['Status']))
|
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
|
|
|
newValueDict['Status'] = iss_exists['Status']
|
|
|
|
|
|
|
|
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
|
|
|
#logger.fdebug("Not changing the status at this time - reverting to previous module after to re-append existing status")
|
2014-02-26 19:48:50 +00:00
|
|
|
pass #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
|
|
|
|
|
|
|
try:
|
|
|
|
myDB.upsert("issues", newValueDict, controlValueDict)
|
|
|
|
except sqlite3.InterfaceError, e:
|
|
|
|
#raise sqlite3.InterfaceError(e)
|
|
|
|
logger.error('Something went wrong - I cannot add the issue information into my DB.')
|
|
|
|
myDB.action("DELETE FROM comics WHERE ComicID=?", [issue['ComicID']])
|
|
|
|
return
|
|
|
|
|
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
|
|
|
|
2014-02-26 19:48:50 +00:00
|
|
|
def manualAnnual(manual_comicid, comicname, comicyear, comicid):
|
|
|
|
#called when importing/refreshing an annual that was manually added.
|
|
|
|
myDB = db.DBConnection()
|
|
|
|
issueid = manual_comicid
|
|
|
|
logger.fdebug(str(issueid) + ' added to series list as an Annual')
|
|
|
|
sr = cv.getComic(manual_comicid, 'comic')
|
|
|
|
logger.info('Attempting to integrate ' + sr['ComicName'] + ' (' + str(issueid) + ') to the existing series of ' + comicname + '(' + str(comicyear) + ')')
|
|
|
|
if len(sr) is None or len(sr) == 0:
|
|
|
|
logger.fdebug('Could not find any information on the series indicated : ' + str(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
|
|
|
return
|
2014-02-26 19:48:50 +00:00
|
|
|
else:
|
|
|
|
n = 0
|
|
|
|
noissues = sr['ComicIssues']
|
|
|
|
logger.fdebug('there are ' + str(noissues) + ' annuals within this series.')
|
|
|
|
issued = cv.getComic(re.sub('4050-','',manual_comicid).strip(),'issue')
|
|
|
|
while (n < int(noissues)):
|
|
|
|
try:
|
|
|
|
firstval = issued['issuechoice'][n]
|
|
|
|
except IndexError:
|
|
|
|
break
|
|
|
|
cleanname = helpers.cleanName(firstval['Issue_Name'])
|
|
|
|
issid = str(firstval['Issue_ID'])
|
|
|
|
issnum = str(firstval['Issue_Number'])
|
|
|
|
issname = cleanname
|
|
|
|
issdate = str(firstval['Issue_Date'])
|
|
|
|
stdate = str(firstval['Store_Date'])
|
|
|
|
logger.fdebug('comicname:' + str(comicname))
|
|
|
|
logger.fdebug('comicid:' + str(comicid))
|
|
|
|
logger.fdebug('issid:' + str(issid))
|
|
|
|
logger.fdebug('cleanname:' + str(cleanname))
|
|
|
|
logger.fdebug('issnum:' + str(issnum))
|
|
|
|
logger.fdebug('issdate:' + str(issdate))
|
|
|
|
logger.fdebug('stdate:' + str(stdate))
|
|
|
|
newCtrl = {"IssueID": issid}
|
|
|
|
newVals = {"Issue_Number": issnum,
|
|
|
|
"Int_IssueNumber": helpers.issuedigits(issnum),
|
|
|
|
"IssueDate": issdate,
|
|
|
|
"ReleaseDate": stdate,
|
|
|
|
"IssueName": issname,
|
|
|
|
"ComicID": comicid, #this is the series ID
|
|
|
|
"ReleaseComicID": re.sub('4050-','',manual_comicid).strip(), #this is the series ID for the annual(s)
|
|
|
|
"ComicName": comicname, #series ComicName
|
|
|
|
"ReleaseComicName" :sr['ComicName'], #series ComicName for the manual_comicid
|
|
|
|
"Status": "Skipped"}
|
|
|
|
#need to add in the values for the new series to be added.
|
|
|
|
#"M_ComicName": sr['ComicName'],
|
|
|
|
#"M_ComicID": manual_comicid}
|
|
|
|
myDB.upsert("annuals", newVals, newCtrl)
|
|
|
|
n+=1
|
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('Successfully integrated ' + str(n) + ' issues of ' + sr['ComicName'] + ' to the series: ' + comicname)
|
2014-02-26 19:48:50 +00:00
|
|
|
return
|
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
|
|
|
|
|
|
|
|
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 updateissuedata(comicid, comicname=None, issued=None, comicIssues=None, calledfrom=None, issuechk=None, issuetype=None, SeriesYear=None, latestissueinfo=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
|
|
|
weeklyissue_check = []
|
|
|
|
logger.fdebug('issuedata call references...')
|
|
|
|
logger.fdebug('comicid:' + str(comicid))
|
2014-05-26 18:11:39 +00:00
|
|
|
logger.fdebug('comicname:' + 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
|
|
|
logger.fdebug('comicissues:' + str(comicIssues))
|
|
|
|
logger.fdebug('calledfrom: ' + str(calledfrom))
|
|
|
|
logger.fdebug('issuechk: ' + str(issuechk))
|
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('latestissueinfo: ' + str(latestissueinfo))
|
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('issuetype: ' + str(issuetype))
|
|
|
|
#to facilitate independent calls to updateissuedata ONLY, account for data not available and get it.
|
|
|
|
#chkType comes from the weeklypulllist - either 'annual' or not to distinguish annuals vs. issues
|
|
|
|
if comicIssues is None:
|
|
|
|
comic = cv.getComic(comicid,'comic')
|
2014-06-09 18:34:53 +00:00
|
|
|
if comic is None:
|
|
|
|
logger.warn('Error retrieving from ComicVine - either the site is down or you are not using your own CV API key')
|
|
|
|
return
|
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 comicIssues is None:
|
|
|
|
comicIssues = comic['ComicIssues']
|
|
|
|
if SeriesYear is None:
|
|
|
|
SeriesYear = comic['ComicYear']
|
|
|
|
if comicname is None:
|
|
|
|
comicname = comic['ComicName']
|
|
|
|
if issued is None:
|
|
|
|
issued = cv.getComic(comicid,'issue')
|
2014-06-09 18:34:53 +00:00
|
|
|
if issued is None:
|
|
|
|
logger.warn('Error retrieving from ComicVine - either the site is down or you are not using your own CV API key')
|
|
|
|
return
|
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
|
|
|
n = 0
|
|
|
|
iscnt = int(comicIssues)
|
|
|
|
issid = []
|
|
|
|
issnum = []
|
|
|
|
issname = []
|
|
|
|
issdate = []
|
|
|
|
issuedata = []
|
|
|
|
int_issnum = []
|
|
|
|
#let's start issue #'s at 0 -- thanks to DC for the new 52 reboot! :)
|
|
|
|
latestiss = "0"
|
|
|
|
latestdate = "0000-00-00"
|
|
|
|
firstiss = "10000000"
|
|
|
|
firstdate = "2099-00-00"
|
|
|
|
#print ("total issues:" + str(iscnt))
|
|
|
|
logger.info('Now adding/updating issues for ' + comicname)
|
|
|
|
|
|
|
|
if iscnt > 0: #if a series is brand new, it wont have any issues/details yet so skip this part
|
|
|
|
while (n <= iscnt):
|
|
|
|
try:
|
|
|
|
firstval = issued['issuechoice'][n]
|
|
|
|
#print firstval
|
|
|
|
except IndexError:
|
|
|
|
break
|
2014-11-21 17:16:28 +00:00
|
|
|
try:
|
|
|
|
cleanname = helpers.cleanName(firstval['Issue_Name'])
|
|
|
|
except:
|
|
|
|
cleanname = '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
|
|
|
issid = str(firstval['Issue_ID'])
|
|
|
|
issnum = firstval['Issue_Number']
|
|
|
|
#print ("issnum: " + str(issnum))
|
|
|
|
issname = cleanname
|
|
|
|
issdate = str(firstval['Issue_Date'])
|
|
|
|
storedate = str(firstval['Store_Date'])
|
|
|
|
if issnum.isdigit():
|
|
|
|
int_issnum = int( issnum ) * 1000
|
|
|
|
else:
|
2014-09-10 18:48:50 +00:00
|
|
|
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')
|
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 '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:
|
2014-09-08 08:35:15 +00:00
|
|
|
int_issnum = .5 * 1000
|
|
|
|
logger.info('1/2 issue detected :' + issnum + ' === ' + str(int_issnum))
|
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
|
|
|
elif u'\xbc' in issnum:
|
2014-09-08 08:35:15 +00:00
|
|
|
int_issnum = .25 * 1000
|
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
|
|
|
elif u'\xbe' in issnum:
|
2014-09-08 08:35:15 +00:00
|
|
|
int_issnum = .75 * 1000
|
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
|
|
|
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:
|
|
|
|
if ',' in issnum: issnum = re.sub(',','.', issnum)
|
|
|
|
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
|
|
|
|
decis = str(issnum)[issst+1:]
|
|
|
|
#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 = str(issnum)
|
|
|
|
int_issnum = (int(issb4dec) * 1000) + (int(issaftdec) * 10)
|
|
|
|
except ValueError:
|
|
|
|
logger.error('This has no issue # for me to get - Either a Graphic Novel or one-shot.')
|
|
|
|
updater.no_searchresults(comicid)
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
x = float(issnum)
|
|
|
|
#validity check
|
|
|
|
if x < 0:
|
|
|
|
logger.info('I have encountered a negative issue #: ' + str(issnum) + '. Trying to accomodate.')
|
|
|
|
logger.fdebug('value of x is : ' + str(x))
|
|
|
|
int_issnum = (int(x)*1000) - 1
|
|
|
|
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()
|
2014-09-10 18:48:50 +00:00
|
|
|
issno = issnum[:x].rstrip()
|
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
|
|
|
try:
|
|
|
|
isschk = float(issno)
|
|
|
|
except ValueError, e:
|
2014-09-08 08:35:15 +00:00
|
|
|
if len(issnum) == 1 and issnum.isalpha():
|
|
|
|
logger.fdebug('detected lone alpha issue. Attempting to figure this out.')
|
|
|
|
break
|
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('invalid numeric for issue - cannot be found. Ignoring.')
|
|
|
|
issno = None
|
|
|
|
tstord = None
|
|
|
|
invchk = "true"
|
|
|
|
break
|
|
|
|
x+=1
|
|
|
|
if tstord is not None and issno is not None:
|
|
|
|
a = 0
|
|
|
|
ordtot = 0
|
2014-09-10 18:48:50 +00:00
|
|
|
if len(issnum) == 1 and issnum.isalpha():
|
2014-09-08 08:35:15 +00:00
|
|
|
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
|
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
|
|
|
elif invchk == "true":
|
|
|
|
logger.fdebug('this does not have an issue # that I can parse properly.')
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
logger.error(str(issnum) + ' this has an alpha-numeric in the issue # which I cannot account for.')
|
|
|
|
return
|
|
|
|
#get the latest issue / date using the date.
|
2014-06-04 18:53:33 +00:00
|
|
|
#logger.fdebug('issue : ' + str(issnum))
|
|
|
|
#logger.fdebug('latest date: ' + str(latestdate))
|
|
|
|
#logger.fdebug('first date: ' + str(firstdate))
|
|
|
|
#logger.fdebug('issue date: ' + str(firstval['Issue_Date']))
|
2014-06-11 18:39:50 +00:00
|
|
|
if firstval['Issue_Date'] >= latestdate:
|
|
|
|
#logger.fdebug('date check hit for issue date > latestdate')
|
|
|
|
if int_issnum > helpers.issuedigits(latestiss):
|
|
|
|
#logger.fdebug('assigning latest issue to : ' + str(issnum))
|
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
|
|
|
latestiss = issnum
|
|
|
|
latestdate = str(firstval['Issue_Date'])
|
|
|
|
if firstval['Issue_Date'] < firstdate:
|
|
|
|
firstiss = issnum
|
|
|
|
firstdate = str(firstval['Issue_Date'])
|
|
|
|
|
|
|
|
if issuechk is not None and issuetype == 'series':
|
|
|
|
logger.fdebug('comparing ' + str(issuechk) + ' .. to .. ' + str(int_issnum))
|
|
|
|
if issuechk == int_issnum:
|
|
|
|
weeklyissue_check.append({"Int_IssueNumber": int_issnum,
|
|
|
|
"Issue_Number": issnum,
|
|
|
|
"IssueDate": issdate,
|
|
|
|
"ReleaseDate": storedate})
|
|
|
|
|
|
|
|
issuedata.append({"ComicID": comicid,
|
|
|
|
"IssueID": issid,
|
|
|
|
"ComicName": comicname,
|
|
|
|
"IssueName": issname,
|
|
|
|
"Issue_Number": issnum,
|
|
|
|
"IssueDate": issdate,
|
|
|
|
"ReleaseDate": storedate,
|
|
|
|
"Int_IssueNumber": int_issnum})
|
|
|
|
|
|
|
|
n+=1
|
|
|
|
|
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 calledfrom == 'futurecheck' and len(issuedata) == 0:
|
|
|
|
logger.fdebug('This is a NEW series with no issue data - skipping issue updating for now, and assigning generic information so things don\'t break')
|
|
|
|
latestdate = latestissueinfo[0]['latestdate'] # if it's from futurecheck, issuechk holds the latestdate for the given issue
|
|
|
|
latestiss = latestissueinfo[0]['latestiss']
|
|
|
|
lastpubdate = 'Present'
|
|
|
|
publishfigure = str(SeriesYear) + ' - ' + str(lastpubdate)
|
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:
|
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 len(issuedata) > 1 and not calledfrom == 'dbupdate':
|
|
|
|
logger.fdebug('initiating issue updating - info & status')
|
|
|
|
issue_collection(issuedata,nostatus='False')
|
|
|
|
else:
|
|
|
|
logger.fdebug('initiating issue updating - just the info')
|
|
|
|
issue_collection(issuedata,nostatus='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
|
|
|
|
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
|
|
|
styear = str(SeriesYear)
|
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
|
|
|
|
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 firstdate[5:7] == '00':
|
|
|
|
stmonth = "?"
|
|
|
|
else:
|
|
|
|
stmonth = helpers.fullmonth(firstdate[5:7])
|
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
|
|
|
|
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
|
|
|
ltyear = re.sub('/s','', latestdate[:4])
|
|
|
|
if latestdate[5:7] == '00':
|
|
|
|
ltmonth = "?"
|
|
|
|
else:
|
|
|
|
ltmonth = helpers.fullmonth(latestdate[5:7])
|
|
|
|
|
|
|
|
#try to determine if it's an 'actively' published comic from above dates
|
|
|
|
#threshold is if it's within a month (<55 days) let's assume it's recent.
|
|
|
|
try:
|
|
|
|
c_date = datetime.date(int(latestdate[:4]),int(latestdate[5:7]),1)
|
|
|
|
except:
|
|
|
|
logger.error('Cannot determine Latest Date for given series. This is most likely due to an issue having a date of : 0000-00-00')
|
|
|
|
latestdate = str(SeriesYear) + '-01-01'
|
|
|
|
logger.error('Setting Latest Date to be ' + str(latestdate) + '. You should inform CV that the issue data is stale.')
|
|
|
|
c_date = datetime.date(int(latestdate[:4]),int(latestdate[5:7]),1)
|
|
|
|
|
|
|
|
n_date = datetime.date.today()
|
|
|
|
recentchk = (n_date - c_date).days
|
|
|
|
|
|
|
|
if recentchk <= 55:
|
|
|
|
lastpubdate = 'Present'
|
|
|
|
else:
|
|
|
|
lastpubdate = str(ltmonth) + ' ' + str(ltyear)
|
|
|
|
|
|
|
|
publishfigure = str(stmonth) + ' ' + str(styear) + ' - ' + str(lastpubdate)
|
|
|
|
if stmonth == '?' and styear == '?' and lastpubdate =='0000' and comicIssues == '0':
|
|
|
|
logger.info('No available issue data - I believe this is a NEW series.')
|
|
|
|
latestdate = latestissueinfo[0]['latestdate']
|
|
|
|
latestiss = latestissueinfo[0]['latestiss']
|
|
|
|
lastpubdate = 'Present'
|
|
|
|
publishfigure = str(SeriesYear) + ' - ' + str(lastpubdate)
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
controlValueStat = {"ComicID": comicid}
|
|
|
|
|
|
|
|
newValueStat = {"Status": "Active",
|
|
|
|
"ComicPublished": publishfigure,
|
|
|
|
"LatestIssue": latestiss,
|
|
|
|
"LatestDate": latestdate,
|
|
|
|
"LastUpdated": helpers.now()
|
|
|
|
}
|
|
|
|
|
|
|
|
myDB = db.DBConnection()
|
|
|
|
myDB.upsert("comics", newValueStat, controlValueStat)
|
|
|
|
|
|
|
|
importantdates = {}
|
|
|
|
importantdates['LatestIssue'] = latestiss
|
|
|
|
importantdates['LatestDate'] = latestdate
|
|
|
|
importantdates['LastPubDate'] = lastpubdate
|
|
|
|
|
|
|
|
if calledfrom == 'weekly':
|
|
|
|
return weeklyissue_check
|
|
|
|
|
|
|
|
elif calledfrom == 'dbupdate':
|
|
|
|
return issuedata
|
|
|
|
|
|
|
|
return importantdates
|