1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2025-03-09 05:13:35 +00:00

FIX:(#1197) Startup errors on Windows systems after last commit related to stderr/stdout problems, FIX: Selecting copy/move option from GUI configuration wouldn't retain settings, FIX: Removed unnecessary stdout calls from included CT module, FIX: When copy/moving during post-processing and meta-tagging enabled, won't move files to tag if copy is selected

This commit is contained in:
evilhero 2016-01-27 03:57:27 -05:00
parent d182321d9b
commit 52d0b29702
9 changed files with 53 additions and 41 deletions

View file

@ -32,6 +32,9 @@ try:
except ImportError: except ImportError:
import lib.argparse as argparse import lib.argparse as argparse
if ( sys.platform == 'win32' and sys.executable.split( '\\' )[-1] == 'pythonw.exe'):
sys.stdout = open(os.devnull, "w")
sys.stderr = open(os.devnull, "w")
def handler_sigterm(signum, frame): def handler_sigterm(signum, frame):
mylar.SIGNAL = 'shutdown' mylar.SIGNAL = 'shutdown'

View file

@ -460,7 +460,7 @@
%endif %endif
%if mylar.ENABLE_META: %if mylar.ENABLE_META:
<a href="#" title="Manually meta-tag issue" onclick="doAjaxCall('manual_metatag?dirName=${comic['ComicLocation'] |u}&issueid=${issue['IssueID']}&filename=${linky |u}&comicid=${issue['ComicID']}&comversion=${comic['ComicVersion']}',$(this),'table')" data-success="${issue['Issue_Number']} successfully tagged."><img src="interfaces/default/images/comictagger.png" height="25" width="25" class="highqual" /></a> <a href="#" title="Manually meta-tag issue" onclick="doAjaxCall('manual_metatag?dirName=${comic['ComicLocation'] |u}&issueid=${issue['IssueID']}&filename=${linky |u}&comicid=${issue['ComicID']}&comversion=${comic['ComicVersion']}',$(this),'table')" data-success="${comic['ComicName']} #${issue['Issue_Number']} successfully tagged."><img src="interfaces/default/images/comictagger.png" height="25" width="25" class="highqual" /></a>
%endif %endif
%endif %endif
<a href="#" title="Add to Reading List" onclick="doAjaxCall('addtoreadlist?IssueID=${issue['IssueID']}',$(this),'table')" data-success="${comic['ComicName']} #${issue['Issue_Number']} added to Reading List"><img src="interfaces/default/images/glasses-icon.png" height="25" width="25" class="highqual" /></a> <a href="#" title="Add to Reading List" onclick="doAjaxCall('addtoreadlist?IssueID=${issue['IssueID']}',$(this),'table')" data-success="${comic['ComicName']} #${issue['Issue_Number']} added to Reading List"><img src="interfaces/default/images/glasses-icon.png" height="25" width="25" class="highqual" /></a>
@ -603,7 +603,7 @@
%endif %endif
%if mylar.ENABLE_META: %if mylar.ENABLE_META:
<a href="#" title="Manually meta-tag annual" onclick="doAjaxCall('manual_metatag?dirName=${comic['ComicLocation'] |u}&issueid=${issue['IssueID']}&filename=${linky |u}&comicid=${issue['ComicID']}',$(this),'table')" data-success="${issue['Issue_Number']} successfully tagged."><img src="interfaces/default/images/comictagger.png" height="25" width="25" class="highqual" /></a> <a href="#" title="Manually meta-tag annual" onclick="doAjaxCall('manual_metatag?dirName=${comic['ComicLocation'] |u}&issueid=${issue['IssueID']}&filename=${linky |u}&comicid=${issue['ComicID']}',$(this),'table')" data-success="${annual['ComicName']} #${issue['Issue_Number']} successfully tagged."><img src="interfaces/default/images/comictagger.png" height="25" width="25" class="highqual" /></a>
%endif %endif
%endif %endif
<!-- <!--

View file

@ -734,7 +734,7 @@
<div class="config"> <div class="config">
<div class="row left"> <div class="row left">
<label>When Post-Processing <label>When Post-Processing
<select name="file_opts clearfix"> <select name="file_opts">
%for x in ['move', 'copy']: %for x in ['move', 'copy']:
<% <%
if config['file_opts'] == x: if config['file_opts'] == x:

View file

@ -68,7 +68,7 @@ def actual_issue_data_fetch( match, settings, opts ):
comicVine.wait_for_rate_limit = opts.wait_and_retry_on_rate_limit comicVine.wait_for_rate_limit = opts.wait_and_retry_on_rate_limit
cv_md = comicVine.fetchIssueData( match['volume_id'], match['issue_number'], settings ) cv_md = comicVine.fetchIssueData( match['volume_id'], match['issue_number'], settings )
except ComicVineTalkerException: except ComicVineTalkerException:
print >> sys.stderr, "Network error while getting issue details. Save aborted" print "Network error while getting issue details. Save aborted"
return None return None
if settings.apply_cbl_transform_on_cv_import: if settings.apply_cbl_transform_on_cv_import:
@ -81,16 +81,16 @@ def actual_metadata_save( ca, opts, md ):
if not opts.dryrun: if not opts.dryrun:
# write out the new data # write out the new data
if not ca.writeMetadata( md, opts.data_style ): if not ca.writeMetadata( md, opts.data_style ):
print >> sys.stderr,"The tag save seemed to fail!" print "The tag save seemed to fail!"
return False return False
else: else:
pass pass
#print >> sys.stderr,"Save complete." #print >> sys.stderr,"Save complete."
else: else:
if opts.terse: if opts.terse:
print >> sys.stderr,"dry-run option was set, so nothing was written" print "dry-run option was set, so nothing was written"
else: else:
print >> sys.stderr,"dry-run option was set, so nothing was written, but here is the final set of tags:" print "dry-run option was set, so nothing was written, but here is the final set of tags:"
print u"{0}".format(md) print u"{0}".format(md)
return True return True
@ -176,7 +176,7 @@ def post_process_matches( match_results, opts, settings ):
def cli_mode( opts, settings ): def cli_mode( opts, settings ):
if len( opts.file_list ) < 1: if len( opts.file_list ) < 1:
print >> sys.stderr,"You must specify at least one filename. Use the -h option for more info" print "You must specify at least one filename. Use the -h option for more info"
return return
match_results = OnlineMatchResults() match_results = OnlineMatchResults()
@ -185,7 +185,7 @@ def cli_mode( opts, settings ):
if type(f) == str: if type(f) == str:
f = f.decode(filename_encoding, 'replace') f = f.decode(filename_encoding, 'replace')
process_file_cli( f, opts, settings, match_results ) process_file_cli( f, opts, settings, match_results )
sys.stdout.flush() #sys.stdout.flush()
post_process_matches( match_results, opts, settings ) post_process_matches( match_results, opts, settings )
@ -215,16 +215,16 @@ def process_file_cli( filename, opts, settings, match_results ):
ca = ComicArchive(filename, settings.rar_exe_path) ca = ComicArchive(filename, settings.rar_exe_path)
if not os.path.lexists( filename ): if not os.path.lexists( filename ):
print >> sys.stderr,"Cannot find "+ filename print "Cannot find "+ filename
return return
if not ca.seemsToBeAComicArchive(): if not ca.seemsToBeAComicArchive():
print >> sys.stderr,"Sorry, but "+ filename + " is not a comic archive!" print "Sorry, but "+ filename + " is not a comic archive!"
return return
#if not ca.isWritableForStyle( opts.data_style ) and ( opts.delete_tags or opts.save_tags or opts.rename_file ): #if not ca.isWritableForStyle( opts.data_style ) and ( opts.delete_tags or opts.save_tags or opts.rename_file ):
if not ca.isWritable( ) and ( opts.delete_tags or opts.copy_tags or opts.save_tags or opts.rename_file ): if not ca.isWritable( ) and ( opts.delete_tags or opts.copy_tags or opts.save_tags or opts.rename_file ):
print >> sys.stderr,"This archive is not writable for that tag type" print "This archive is not writable for that tag type"
return return
has = [ False, False, False ] has = [ False, False, False ]
@ -353,12 +353,12 @@ def process_file_cli( filename, opts, settings, match_results ):
comicVine.wait_for_rate_limit = opts.wait_and_retry_on_rate_limit comicVine.wait_for_rate_limit = opts.wait_and_retry_on_rate_limit
cv_md = comicVine.fetchIssueDataByIssueID( opts.issue_id, settings ) cv_md = comicVine.fetchIssueDataByIssueID( opts.issue_id, settings )
except ComicVineTalkerException: except ComicVineTalkerException:
print >> sys.stderr,"Network error while getting issue details. Save aborted" print "Network error while getting issue details. Save aborted"
match_results.fetchDataFailures.append(filename) match_results.fetchDataFailures.append(filename)
return return
if cv_md is None: if cv_md is None:
print >> sys.stderr,"No match for ID {0} was found.".format(opts.issue_id) print "No match for ID {0} was found.".format(opts.issue_id)
match_results.noMatches.append(filename) match_results.noMatches.append(filename)
return return
@ -368,7 +368,7 @@ def process_file_cli( filename, opts, settings, match_results ):
ii = IssueIdentifier( ca, settings ) ii = IssueIdentifier( ca, settings )
if md is None or md.isEmpty: if md is None or md.isEmpty:
print >> sys.stderr,"No metadata given to search online with!" print "No metadata given to search online with!"
match_results.noMatches.append(filename) match_results.noMatches.append(filename)
return return
@ -407,19 +407,19 @@ def process_file_cli( filename, opts, settings, match_results ):
if choices: if choices:
if low_confidence: if low_confidence:
print >> sys.stderr,"Online search: Multiple low confidence matches. Save aborted" print "Online search: Multiple low confidence matches. Save aborted"
match_results.lowConfidenceMatches.append(MultipleMatch(filename,matches)) match_results.lowConfidenceMatches.append(MultipleMatch(filename,matches))
return return
else: else:
print >> sys.stderr,"Online search: Multiple good matches. Save aborted" print "Online search: Multiple good matches. Save aborted"
match_results.multipleMatches.append(MultipleMatch(filename,matches)) match_results.multipleMatches.append(MultipleMatch(filename,matches))
return return
if low_confidence and opts.abortOnLowConfidence: if low_confidence and opts.abortOnLowConfidence:
print >> sys.stderr,"Online search: Low confidence match. Save aborted" print "Online search: Low confidence match. Save aborted"
match_results.lowConfidenceMatches.append(MultipleMatch(filename,matches)) match_results.lowConfidenceMatches.append(MultipleMatch(filename,matches))
return return
if not found_match: if not found_match:
print >> sys.stderr,"Online search: No match found. Save aborted" print "Online search: No match found. Save aborted"
match_results.noMatches.append(filename) match_results.noMatches.append(filename)
return return
@ -454,7 +454,7 @@ def process_file_cli( filename, opts, settings, match_results ):
md = create_local_metadata( opts, ca, use_tags ) md = create_local_metadata( opts, ca, use_tags )
if md.series is None: if md.series is None:
print >> sys.stderr, msg_hdr + "Can't rename without series name" print msg_hdr + "Can't rename without series name"
return return
new_ext = None # default new_ext = None # default
@ -472,7 +472,7 @@ def process_file_cli( filename, opts, settings, match_results ):
new_name = renamer.determineName( filename, ext=new_ext ) new_name = renamer.determineName( filename, ext=new_ext )
if new_name == os.path.basename(filename): if new_name == os.path.basename(filename):
print >> sys.stderr, msg_hdr + "Filename is already good!" print msg_hdr + "Filename is already good!"
return return
folder = os.path.dirname( os.path.abspath( filename ) ) folder = os.path.dirname( os.path.abspath( filename ) )
@ -493,7 +493,7 @@ def process_file_cli( filename, opts, settings, match_results ):
msg_hdr = u"{0}: ".format(filename) msg_hdr = u"{0}: ".format(filename)
if not ca.isRar(): if not ca.isRar():
print >> sys.stderr, msg_hdr + "Archive is not a RAR." print msg_hdr + "Archive is not a RAR."
return return
rar_file = os.path.abspath( os.path.abspath( filename ) ) rar_file = os.path.abspath( os.path.abspath( filename ) )
@ -514,7 +514,7 @@ def process_file_cli( filename, opts, settings, match_results ):
try: try:
os.unlink( rar_file ) os.unlink( rar_file )
except: except:
print >> sys.stderr, msg_hdr + "Error deleting original RAR after export" print msg_hdr + "Error deleting original RAR after export"
delete_success = False delete_success = False
else: else:
delete_success = True delete_success = True

View file

@ -60,7 +60,7 @@ def ctmain():
if not qt_available and not opts.no_gui: if not qt_available and not opts.no_gui:
opts.no_gui = True opts.no_gui = True
print >> sys.stderr, "PyQt4 is not available. ComicTagger is limited to command-line mode." print "PyQt4 is not available. ComicTagger is limited to command-line mode."
if opts.no_gui: if opts.no_gui:
cli.cli_mode( opts, settings ) cli.cli_mode( opts, settings )

View file

@ -1245,6 +1245,7 @@ class PostProcessor(object):
else: else:
#need to set the filename source as the new name of the file returned from comictagger. #need to set the filename source as the new name of the file returned from comictagger.
odir = os.path.split(pcheck)[0]
ofilename = os.path.split(pcheck)[1] ofilename = os.path.split(pcheck)[1]
ext = os.path.splitext(ofilename)[1] ext = os.path.splitext(ofilename)[1]
self._log("Sucessfully wrote metadata to .cbz - Continuing..") self._log("Sucessfully wrote metadata to .cbz - Continuing..")
@ -1322,6 +1323,9 @@ class PostProcessor(object):
# else: # else:
if pcheck == "fail": if pcheck == "fail":
odir, ofilename = os.path.split(ml['ComicLocation']) odir, ofilename = os.path.split(ml['ComicLocation'])
elif pcheck:
#odir, ofilename already set. Carry it through.
pass
else: else:
odir = os.path.split(ml['ComicLocation'])[0] odir = os.path.split(ml['ComicLocation'])[0]
logger.fdebug(module + ' ofilename:' + ofilename) logger.fdebug(module + ' ofilename:' + ofilename)

View file

@ -320,6 +320,7 @@ CT_TAG_CR = 1
CT_TAG_CBL = 1 CT_TAG_CBL = 1
CT_CBZ_OVERWRITE = 0 CT_CBZ_OVERWRITE = 0
UNRAR_CMD = None UNRAR_CMD = None
CT_SETTINGSPATH = None
UPCOMING_SNATCHED = 1 UPCOMING_SNATCHED = 1
@ -419,7 +420,7 @@ def initialize():
NEWZNAB, NEWZNAB_NAME, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_UID, NEWZNAB_ENABLED, EXTRA_NEWZNABS, NEWZNAB_EXTRA, \ NEWZNAB, NEWZNAB_NAME, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_UID, NEWZNAB_ENABLED, EXTRA_NEWZNABS, NEWZNAB_EXTRA, \
ENABLE_TORZNAB, TORZNAB_NAME, TORZNAB_HOST, TORZNAB_APIKEY, TORZNAB_CATEGORY, \ ENABLE_TORZNAB, TORZNAB_NAME, TORZNAB_HOST, TORZNAB_APIKEY, TORZNAB_CATEGORY, \
EXPERIMENTAL, ALTEXPERIMENTAL, \ EXPERIMENTAL, ALTEXPERIMENTAL, \
ENABLE_META, CMTAGGER_PATH, CT_TAG_CR, CT_TAG_CBL, CT_CBZ_OVERWRITE, UNRAR_CMD, UPDATE_ENDED, INDIE_PUB, BIGGIE_PUB, IGNORE_HAVETOTAL, SNATCHED_HAVETOTAL, PROVIDER_ORDER, \ ENABLE_META, CMTAGGER_PATH, CT_TAG_CR, CT_TAG_CBL, CT_CBZ_OVERWRITE, UNRAR_CMD, CT_SETTINGSPATH, UPDATE_ENDED, INDIE_PUB, BIGGIE_PUB, IGNORE_HAVETOTAL, SNATCHED_HAVETOTAL, PROVIDER_ORDER, \
dbUpdateScheduler, searchScheduler, RSSScheduler, WeeklyScheduler, VersionScheduler, FolderMonitorScheduler, \ dbUpdateScheduler, searchScheduler, RSSScheduler, WeeklyScheduler, VersionScheduler, FolderMonitorScheduler, \
ENABLE_TORRENTS, MINSEEDS, TORRENT_LOCAL, LOCAL_WATCHDIR, TORRENT_SEEDBOX, SEEDBOX_HOST, SEEDBOX_PORT, SEEDBOX_USER, SEEDBOX_PASS, SEEDBOX_WATCHDIR, \ ENABLE_TORRENTS, MINSEEDS, TORRENT_LOCAL, LOCAL_WATCHDIR, TORRENT_SEEDBOX, SEEDBOX_HOST, SEEDBOX_PORT, SEEDBOX_USER, SEEDBOX_PASS, SEEDBOX_WATCHDIR, \
ENABLE_RSS, RSS_CHECKINTERVAL, RSS_LASTRUN, FAILED_DOWNLOAD_HANDLING, FAILED_AUTO, ENABLE_TORRENT_SEARCH, ENABLE_KAT, KAT_PROXY, ENABLE_32P, MODE_32P, KEYS_32P, RSSFEED_32P, USERNAME_32P, PASSWORD_32P, AUTHKEY_32P, PASSKEY_32P, FEEDINFO_32P, VERIFY_32P, SNATCHEDTORRENT_NOTIFY, \ ENABLE_RSS, RSS_CHECKINTERVAL, RSS_LASTRUN, FAILED_DOWNLOAD_HANDLING, FAILED_AUTO, ENABLE_TORRENT_SEARCH, ENABLE_KAT, KAT_PROXY, ENABLE_32P, MODE_32P, KEYS_32P, RSSFEED_32P, USERNAME_32P, PASSWORD_32P, AUTHKEY_32P, PASSKEY_32P, FEEDINFO_32P, VERIFY_32P, SNATCHEDTORRENT_NOTIFY, \
@ -1047,15 +1048,15 @@ def initialize():
#comictagger - force to use included version if option is enabled. #comictagger - force to use included version if option is enabled.
if ENABLE_META: if ENABLE_META:
CMTAGGER_PATH = PROG_DIR CMTAGGER_PATH = PROG_DIR
logger.info('Setting ComicTagger default path to : ' + PROG_DIR)
#we need to make sure the default folder setting for the comictagger settings exists so things don't error out #we need to make sure the default folder setting for the comictagger settings exists so things don't error out
CT_SETTINGSPATH = os.path.join(PROG_DIR, 'lib', 'comictaggerlib', 'ct_settings') CT_SETTINGSPATH = os.path.join(PROG_DIR, 'lib', 'comictaggerlib', 'ct_settings')
logger.info('Setting ComicTagger settings default path to : ' + CT_SETTINGSPATH)
if os.path.exists(os.path.join(PROG_DIR, 'lib', 'comictaggerlib', 'ct_settings')): if os.path.exists(CT_SETTINGSPATH):
logger.info('ComicTagger settings location exists.') logger.info('ComicTagger settings location exists.')
else: else:
try: try:
os.mkdir(os.path.join(PROG_DIR, 'lib', 'comictaggerlib', 'ct_settings')) os.mkdir(CT_SETTINGSPATH)
except OSError,e: except OSError,e:
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
logger.error('Unable to create setting directory for ComicTagger. This WILL cause problems when tagging.') logger.error('Unable to create setting directory for ComicTagger. This WILL cause problems when tagging.')

View file

@ -18,7 +18,7 @@ import mylar
from mylar import logger from mylar import logger
def run(dirName, nzbName=None, issueid=None, comversion=None, manual=None, filename=None, module=None): def run(dirName, nzbName=None, issueid=None, comversion=None, manual=None, filename=None, module=None, manualmeta=False):
if module is None: if module is None:
module = '' module = ''
module += '[META-TAGGER]' module += '[META-TAGGER]'
@ -101,7 +101,10 @@ def run(dirName, nzbName=None, issueid=None, comversion=None, manual=None, filen
import tempfile import tempfile
new_folder = os.path.join(tempfile.mkdtemp(prefix='mylar_', dir=mylar.CACHE_DIR)) #prefix, suffix, dir new_folder = os.path.join(tempfile.mkdtemp(prefix='mylar_', dir=mylar.CACHE_DIR)) #prefix, suffix, dir
new_filepath = os.path.join(new_folder, filename) new_filepath = os.path.join(new_folder, filename)
shutil.copy(filepath, new_filepath) if mylar.FILE_OPTS == 'copy' and manualmeta == False:
shutil.copy(filepath, new_filepath)
else:
shutil.move(filepath, new_filepath)
filepath = new_filepath filepath = new_filepath
except: except:
logger.warn(module + ' Unable to create temporary directory to perform meta-tagging. Processing without metatagging.') logger.warn(module + ' Unable to create temporary directory to perform meta-tagging. Processing without metatagging.')
@ -222,15 +225,14 @@ def run(dirName, nzbName=None, issueid=None, comversion=None, manual=None, filen
logger.fdebug(module + ' Absolute path to script: ' +script_cmd[0]) logger.fdebug(module + ' Absolute path to script: ' +script_cmd[0])
try: try:
p = subprocess.Popen(script_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p = subprocess.Popen(script_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out, err = p.communicate() # @UnusedVariable out, err = p.communicate()
#logger.info('out:' + str(out))
#logger.info('err:' + str(err))
if initial_ctrun and 'exported successfully' in out: if initial_ctrun and 'exported successfully' in out:
logger.fdebug(module + '[COMIC-TAGGER] : ' +str(out)) logger.fdebug(module + '[COMIC-TAGGER] : ' +str(out))
#Archive exported successfully to: X-Men v4 008 (2014) (Digital) (Nahga-Empire).cbz (Original deleted) #Archive exported successfully to: X-Men v4 008 (2014) (Digital) (Nahga-Empire).cbz (Original deleted)
tmpfilename = re.sub('Archive exported successfully to: ', '', out.rstrip()) tmpfilename = re.sub('Archive exported successfully to: ', '', out.rstrip())
if mylar.FILE_OPTS == 'move': if mylar.FILE_OPTS == 'move':
tmpfilename = re.sub('\(Original deleted\)', '', tmpname).strip() tmpfilename = re.sub('\(Original deleted\)', '', tmpfilename).strip()
filepath = os.path.join(comicpath, tmpfilename) filepath = os.path.join(comicpath, tmpfilename)
logger.fdebug(module + '[COMIC-TAGGER][CBR-TO-CBZ] New filename: ' + filepath) logger.fdebug(module + '[COMIC-TAGGER][CBR-TO-CBZ] New filename: ' + filepath)
initial_ctrun = False initial_ctrun = False
@ -245,7 +247,7 @@ def run(dirName, nzbName=None, issueid=None, comversion=None, manual=None, filen
file_error = 'file not found||' + filename file_error = 'file not found||' + filename
return file_error return file_error
else: else:
logger.info(module + '[COMIC-TAGGER] Successfully wrote ' + tagdisp) logger.info(module + '[COMIC-TAGGER] Successfully wrote ' + tagdisp + ' [' + filepath + ']')
i+=1 i+=1
except OSError, e: except OSError, e:
#Cannot find The Walking Dead 150 (2016) (Digital) (Zone-Empire).cbr #Cannot find The Walking Dead 150 (2016) (Digital) (Zone-Empire).cbr

View file

@ -4136,7 +4136,7 @@ class WebInterface(object):
module = '[MANUAL META-TAGGING]' module = '[MANUAL META-TAGGING]'
try: try:
import cmtagmylar import cmtagmylar
metaresponse = cmtagmylar.run(dirName, issueid=issueid, filename=filename, comversion=comversion) metaresponse = cmtagmylar.run(dirName, issueid=issueid, filename=filename, comversion=comversion, manualmeta=True)
except ImportError: except ImportError:
logger.warn(module + ' comictaggerlib not found on system. Ensure the ENTIRE lib directory is located within mylar/lib/comictaggerlib/ directory.') logger.warn(module + ' comictaggerlib not found on system. Ensure the ENTIRE lib directory is located within mylar/lib/comictaggerlib/ directory.')
metaresponse = "fail" metaresponse = "fail"
@ -4145,12 +4145,14 @@ class WebInterface(object):
logger.fdebug(module + ' Unable to write metadata successfully - check mylar.log file.') logger.fdebug(module + ' Unable to write metadata successfully - check mylar.log file.')
return return
elif metaresponse == "unrar error": elif metaresponse == "unrar error":
logger.error(module + ' This is a corrupt archive - whether CRC errors or it is incomplete. Marking as BAD, and retrying a different copy.') logger.error(module + ' This is a corrupt archive - whether CRC errors or it is incomplete. Marking as BAD, and retrying a different copy.')
return return
#launch failed download handling here. #launch failed download handling here.
else: else:
logger.info(module + ' Sucessfully wrote metadata to .cbz (' + os.path.split(metaresponse)[1] + ') - Continuing..') dst = os.path.join(dirName, os.path.split(metaresponse)[1])
shutil.move(metaresponse, dst)
logger.info(module + ' Sucessfully wrote metadata to .cbz (' + os.path.split(metaresponse)[1] + ') - Continuing..')
updater.forceRescan(comicid) updater.forceRescan(comicid)
manual_metatag.exposed = True manual_metatag.exposed = True