mirror of https://github.com/evilhero/mylar
FIX:(#231) Error about lower() on startup via browser, FIX:(#230) Manual Renaming button did nothing (works now - code in place), FIX:(#220) Uncommented line required for pre-scripts, IMP: Removed unnecessary repetitive logging when parsing, IMP:InfoPop on Downloaded/Archived issues that shows Filename and size.
This commit is contained in:
parent
4d1555ea99
commit
3bdcf9dc16
|
@ -10,7 +10,7 @@
|
||||||
<div id="subhead_menu">
|
<div id="subhead_menu">
|
||||||
<a id="menu_link_refresh" onclick="doAjaxCall('refreshArtist?ComicID=${comic['ComicID']}', $(this)),'table'" href="#" data-success="'${comic['ComicName']}' is being refreshed">Refresh Comic</a>
|
<a id="menu_link_refresh" onclick="doAjaxCall('refreshArtist?ComicID=${comic['ComicID']}', $(this)),'table'" href="#" data-success="'${comic['ComicName']}' is being refreshed">Refresh Comic</a>
|
||||||
<a id="menu_link_delete" href="deleteArtist?ComicID=${comic['ComicID']}">Delete Comic</a>
|
<a id="menu_link_delete" href="deleteArtist?ComicID=${comic['ComicID']}">Delete Comic</a>
|
||||||
<a id="menu_link_refresh" onclick="doAjaxCall('manualRename?comicid=${comic['ComicID']}', $(this),'table'" href="#" data-success="Renaming files.">Rename Files</a>
|
<a id="menu_link_refresh" onclick="doAjaxCall('manualRename?comicid=${comic['ComicID']}', $(this),'table')" data-success="Renaming files.">Rename Files</a>
|
||||||
<a id="menu_link_refresh" onclick="doAjaxCall('forceRescan?ComicID=${comic['ComicID']}', $(this)),'table'" href="#" data-success="'${comic['ComicName']}' is being refreshed">Recheck Files</a>
|
<a id="menu_link_refresh" onclick="doAjaxCall('forceRescan?ComicID=${comic['ComicID']}', $(this)),'table'" href="#" data-success="'${comic['ComicName']}' is being refreshed">Recheck Files</a>
|
||||||
%if comic['Status'] == 'Paused':
|
%if comic['Status'] == 'Paused':
|
||||||
<a id="menu_link_resume" href="#" onclick="doAjaxCall('resumeArtist?ComicID=${comic['ComicID']}',$(this),true)" data-success="${comic['ComicName']} resumed">Resume Comic</a>
|
<a id="menu_link_resume" href="#" onclick="doAjaxCall('resumeArtist?ComicID=${comic['ComicID']}',$(this),true)" data-success="${comic['ComicName']} resumed">Resume Comic</a>
|
||||||
|
@ -270,7 +270,12 @@
|
||||||
<td id="issuenumber">${issue['Issue_Number']}</td>
|
<td id="issuenumber">${issue['Issue_Number']}</td>
|
||||||
<td id="issuename">${issue['IssueName']}</td>
|
<td id="issuename">${issue['IssueName']}</td>
|
||||||
<td id="reldate">${issue['IssueDate']}</td>
|
<td id="reldate">${issue['IssueDate']}</td>
|
||||||
<td id="status">${issue['Status']}</td>
|
<td id="status">${issue['Status']}
|
||||||
|
%if issue['Status'] == 'Downloaded' or issue['Status'] == 'Archived':
|
||||||
|
<%Csize = mylar.helpers.human_size(issue['ComicSize'])%>
|
||||||
|
<a href="#" title="${issue['Location']} (${Csize})"><img src="interfaces/default/images/info32.png" height="16" alt="" /></a>
|
||||||
|
%endif
|
||||||
|
</td>
|
||||||
<td id="options">
|
<td id="options">
|
||||||
%if issue['Status'] == 'Skipped':
|
%if issue['Status'] == 'Skipped':
|
||||||
<a href="#" title="Mark issue as Wanted" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&ComicYear=${issue['IssueDate']}&mode=want',$(this),'table')"><img src="interfaces/default/images/wanted_icon.png" height="25" width="25" /></a>
|
<a href="#" title="Mark issue as Wanted" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&ComicYear=${issue['IssueDate']}&mode=want',$(this),'table')"><img src="interfaces/default/images/wanted_icon.png" height="25" width="25" /></a>
|
||||||
|
@ -296,6 +301,7 @@
|
||||||
|
|
||||||
<%def name="headIncludes()">
|
<%def name="headIncludes()">
|
||||||
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
|
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
|
||||||
|
|
||||||
%if comic['Status'] == 'Loading':
|
%if comic['Status'] == 'Loading':
|
||||||
<meta http-equiv="refresh" content="60">
|
<meta http-equiv="refresh" content="60">
|
||||||
%endif
|
%endif
|
||||||
|
@ -305,6 +311,7 @@
|
||||||
<%def name="javascriptIncludes()">
|
<%def name="javascriptIncludes()">
|
||||||
<script src="js/libs/jquery.dataTables.min.js"></script>
|
<script src="js/libs/jquery.dataTables.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// show/hide different types of rows when the checkboxes are changed
|
// show/hide different types of rows when the checkboxes are changed
|
||||||
$("#checkboxControls input").change(function(e){
|
$("#checkboxControls input").change(function(e){
|
||||||
var whichClass = $(this).attr('id')
|
var whichClass = $(this).attr('id')
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
|
@ -71,7 +71,9 @@
|
||||||
<td id="published">${comic['LatestDate']}</td>
|
<td id="published">${comic['LatestDate']}</td>
|
||||||
<td id="have"><span title="${percent}"></span><div class="progress-container"><div style="background-color:#a3e532; height:14px; width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
|
<td id="have"><span title="${percent}"></span><div class="progress-container"><div style="background-color:#a3e532; height:14px; width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
|
||||||
<td id="status">
|
<td id="status">
|
||||||
%if 'present' in comic['ComicPublished'].lower():
|
%if comic['ComicPublished'] is None or comic['ComicPublished'] == '':
|
||||||
|
Unknown
|
||||||
|
%elif 'present' in comic['ComicPublished'].lower():
|
||||||
Continuing
|
Continuing
|
||||||
%else:
|
%else:
|
||||||
Ended
|
Ended
|
||||||
|
|
|
@ -92,7 +92,7 @@ class PostProcessor(object):
|
||||||
self._log("initiating pre script detection.", logger.DEBUG)
|
self._log("initiating pre script detection.", logger.DEBUG)
|
||||||
self._log("mylar.PRE_SCRIPTS : " + mylar.PRE_SCRIPTS, logger.DEBUG)
|
self._log("mylar.PRE_SCRIPTS : " + mylar.PRE_SCRIPTS, logger.DEBUG)
|
||||||
# for currentScriptName in mylar.PRE_SCRIPTS:
|
# for currentScriptName in mylar.PRE_SCRIPTS:
|
||||||
# currentScriptName = str(mylar.PRE_SCRIPTS).decode("string_escape")
|
currentScriptName = str(mylar.PRE_SCRIPTS).decode("string_escape")
|
||||||
self._log("pre script detected...enabling: " + str(currentScriptName), logger.DEBUG)
|
self._log("pre script detected...enabling: " + str(currentScriptName), logger.DEBUG)
|
||||||
# generate a safe command line string to execute the script and provide all the parameters
|
# generate a safe command line string to execute the script and provide all the parameters
|
||||||
script_cmd = shlex.split(currentScriptName, posix=False) + [str(nzb_name), str(nzb_folder), str(seriesmetadata)]
|
script_cmd = shlex.split(currentScriptName, posix=False) + [str(nzb_name), str(nzb_folder), str(seriesmetadata)]
|
||||||
|
|
|
@ -221,7 +221,7 @@ def GCDdetails(comseries, resultURL, vari_loop, ComicID, TotalIssues, issvariati
|
||||||
# resultPublished will return just the date and not the word 'Present' which dictates on the main
|
# resultPublished will return just the date and not the word 'Present' which dictates on the main
|
||||||
# page if a series is Continuing / Ended .
|
# page if a series is Continuing / Ended .
|
||||||
if resultFormat != '':
|
if resultFormat != '':
|
||||||
if 'ongoing series' in resultFormat.lower() and 'was' not in resultFormat.lower():
|
if 'ongoing series' in resultFormat.lower() and 'was' not in resultFormat.lower() and 'present' not in resultPublished.lower():
|
||||||
resultPublished = resultPublished + " - Present"
|
resultPublished = resultPublished + " - Present"
|
||||||
coverst = soup.find("div", {"id" : "series_cover"})
|
coverst = soup.find("div", {"id" : "series_cover"})
|
||||||
if coverst < 0:
|
if coverst < 0:
|
||||||
|
@ -291,7 +291,7 @@ def GCDdetails(comseries, resultURL, vari_loop, ComicID, TotalIssues, issvariati
|
||||||
dec_ad = dec_chk[dec_st+1:]
|
dec_ad = dec_chk[dec_st+1:]
|
||||||
dec_ad = re.sub("\s", "", dec_ad)
|
dec_ad = re.sub("\s", "", dec_ad)
|
||||||
if dec_b4.isdigit() and dec_ad.isdigit():
|
if dec_b4.isdigit() and dec_ad.isdigit():
|
||||||
logger.fdebug("Alternate decimal issue...*Whew* glad I caught that")
|
#logger.fdebug("Alternate decimal issue...*Whew* glad I caught that")
|
||||||
ParseIssue = dec_b4 + "." + dec_ad
|
ParseIssue = dec_b4 + "." + dec_ad
|
||||||
else:
|
else:
|
||||||
#logger.fdebug("it's a decimal, but there's no digits before or after decimal")
|
#logger.fdebug("it's a decimal, but there's no digits before or after decimal")
|
||||||
|
@ -301,7 +301,7 @@ def GCDdetails(comseries, resultURL, vari_loop, ComicID, TotalIssues, issvariati
|
||||||
ParseIssue = re.sub("[^0-9]", " ", m[0])
|
ParseIssue = re.sub("[^0-9]", " ", m[0])
|
||||||
# ^^ removes everything but the digits from the remaining non-brackets
|
# ^^ removes everything but the digits from the remaining non-brackets
|
||||||
|
|
||||||
logger.fdebug("variant cover detected : " + str(ParseIssue))
|
#logger.fdebug("variant cover detected : " + str(ParseIssue))
|
||||||
variant="yes"
|
variant="yes"
|
||||||
altcount = 1
|
altcount = 1
|
||||||
isslen = ParseIssue.find(' ')
|
isslen = ParseIssue.find(' ')
|
||||||
|
@ -349,21 +349,22 @@ def GCDdetails(comseries, resultURL, vari_loop, ComicID, TotalIssues, issvariati
|
||||||
datematch="false"
|
datematch="false"
|
||||||
|
|
||||||
if not any(d.get('GCDIssue', None) == str(ParseIssue) for d in gcdchoice):
|
if not any(d.get('GCDIssue', None) == str(ParseIssue) for d in gcdchoice):
|
||||||
logger.fdebug("preparing to add issue to db : " + str(ParseIssue))
|
#logger.fdebug("preparing to add issue to db : " + str(ParseIssue))
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
logger.fdebug("2 identical issue #'s have been found...determining if it's intentional")
|
#logger.fdebug("2 identical issue #'s have been found...determining if it's intentional")
|
||||||
#get current issue & publication date.
|
#get current issue & publication date.
|
||||||
logger.fdebug("Issue #:" + str(ParseIssue))
|
#logger.fdebug("Issue #:" + str(ParseIssue))
|
||||||
logger.fdebug("IssueDate: " + str(gcdinfo['ComicDate']))
|
#logger.fdebug("IssueDate: " + str(gcdinfo['ComicDate']))
|
||||||
#get conflicting issue from tuple
|
#get conflicting issue from tuple
|
||||||
for d in gcdchoice:
|
for d in gcdchoice:
|
||||||
if str(d['GCDIssue']) == str(ParseIssue):
|
if str(d['GCDIssue']) == str(ParseIssue):
|
||||||
logger.fdebug("Issue # already in tuple - checking IssueDate:" + str(d['GCDDate']) )
|
#logger.fdebug("Issue # already in tuple - checking IssueDate:" + str(d['GCDDate']) )
|
||||||
if str(d['GCDDate']) == str(gcdinfo['ComicDate']):
|
if str(d['GCDDate']) == str(gcdinfo['ComicDate']):
|
||||||
logger.fdebug("Issue #'s and dates match...skipping.")
|
#logger.fdebug("Issue #'s and dates match...skipping.")
|
||||||
datematch="true"
|
datematch="true"
|
||||||
else:
|
else:
|
||||||
logger.fdebug("Issue#'s match but different publication dates, not skipping.")
|
#logger.fdebug("Issue#'s match but different publication dates, not skipping.")
|
||||||
datematch="false"
|
datematch="false"
|
||||||
|
|
||||||
if datematch == "false":
|
if datematch == "false":
|
||||||
|
@ -430,8 +431,8 @@ def GettheDate(parsed,PrevYRMO):
|
||||||
basmonths = {'january':'01','february':'02','march':'03','april':'04','may':'05','june':'06','july':'07','august':'08','september':'09','october':'10','november':'11','december':'12'}
|
basmonths = {'january':'01','february':'02','march':'03','april':'04','may':'05','june':'06','july':'07','august':'08','september':'09','october':'10','november':'11','december':'12'}
|
||||||
pdlen = len(ParseDate)
|
pdlen = len(ParseDate)
|
||||||
pdfind = ParseDate.find(' ',2)
|
pdfind = ParseDate.find(' ',2)
|
||||||
logger.fdebug("length: " + str(pdlen) + "....first space @ pos " + str(pdfind))
|
#logger.fdebug("length: " + str(pdlen) + "....first space @ pos " + str(pdfind))
|
||||||
logger.fdebug("this should be the year: " + str(ParseDate[pdfind+1:pdlen-1]))
|
#logger.fdebug("this should be the year: " + str(ParseDate[pdfind+1:pdlen-1]))
|
||||||
if ParseDate[pdfind+1:pdlen-1].isdigit():
|
if ParseDate[pdfind+1:pdlen-1].isdigit():
|
||||||
#assume valid date.
|
#assume valid date.
|
||||||
#search for number as text, and change to numeric
|
#search for number as text, and change to numeric
|
||||||
|
@ -440,7 +441,7 @@ def GettheDate(parsed,PrevYRMO):
|
||||||
pconv = basmonths[numbs]
|
pconv = basmonths[numbs]
|
||||||
ParseYear = re.sub('/s','',ParseDate[-5:])
|
ParseYear = re.sub('/s','',ParseDate[-5:])
|
||||||
ParseDate = str(ParseYear) + "-" + str(pconv)
|
ParseDate = str(ParseYear) + "-" + str(pconv)
|
||||||
logger.fdebug("!success - Publication date: " + str(ParseDate))
|
#logger.fdebug("!success - Publication date: " + str(ParseDate))
|
||||||
break
|
break
|
||||||
# some comics are messed with pub.dates and have Spring/Summer/Fall/Winter
|
# some comics are messed with pub.dates and have Spring/Summer/Fall/Winter
|
||||||
else:
|
else:
|
||||||
|
@ -475,7 +476,7 @@ def GettheDate(parsed,PrevYRMO):
|
||||||
if int(PrevMO) < 10:
|
if int(PrevMO) < 10:
|
||||||
PrevMO = "0" + str(PrevMO)
|
PrevMO = "0" + str(PrevMO)
|
||||||
ParseDate = str(PrevYR) + "-" + str(PrevMO)
|
ParseDate = str(PrevYR) + "-" + str(PrevMO)
|
||||||
logger.fdebug("parseDAte:" + str(ParseDate))
|
#logger.fdebug("parseDAte:" + str(ParseDate))
|
||||||
return ParseDate
|
return ParseDate
|
||||||
|
|
||||||
def GCDAdd(gcdcomicid):
|
def GCDAdd(gcdcomicid):
|
||||||
|
|
|
@ -90,16 +90,18 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate):
|
||||||
if issuechk is None:
|
if issuechk is None:
|
||||||
logger.fdebug(str(ComicName) + " Issue: " + str(IssueNumber) + " not present in listings to mark for download...updating comic and adding to Upcoming Wanted Releases.")
|
logger.fdebug(str(ComicName) + " Issue: " + str(IssueNumber) + " not present in listings to mark for download...updating comic and adding to Upcoming Wanted Releases.")
|
||||||
# we need to either decrease the total issue count, OR indicate that an issue is upcoming.
|
# we need to either decrease the total issue count, OR indicate that an issue is upcoming.
|
||||||
upco_iss = myDB.action("SELECT COUNT(*) FROM UPCOMING WHERE ComicID=?",[ComicID]).fetchone()
|
upco_results = myDB.action("SELECT COUNT(*) FROM UPCOMING WHERE ComicID=?",[ComicID]).fetchall()
|
||||||
if upco_iss > 0:
|
upco_iss = upco_results[0][0]
|
||||||
print ("There is " + str(upco_iss[0]) + " of " + str(ComicName) + " that's not accounted for")
|
#logger.info("upco_iss: " + str(upco_iss))
|
||||||
|
if int(upco_iss) > 0:
|
||||||
|
#logger.info("There is " + str(upco_iss) + " of " + str(ComicName) + " that's not accounted for")
|
||||||
newKey = {"ComicID": ComicID}
|
newKey = {"ComicID": ComicID}
|
||||||
newVal = {"not_updated_db": str(upco_iss[0])}
|
newVal = {"not_updated_db": str(upco_iss)}
|
||||||
myDB.upsert("comics", newVal, newKey)
|
myDB.upsert("comics", newVal, newKey)
|
||||||
elif upco_iss <=0 and lastupdatecheck['not_updated_db']:
|
elif int(upco_iss) <=0 and lastupdatechk['not_updated_db']:
|
||||||
#if not_updated_db has a value, and upco_iss is > 0, let's zero it back out cause it's updated now.
|
#if not_updated_db has a value, and upco_iss is > 0, let's zero it back out cause it's updated now.
|
||||||
newKey = {"ComicID": ComicID}
|
newKey = {"ComicID": ComicID}
|
||||||
newVal - {"not_updated_db": null}
|
newVal = {"not_updated_db": ""}
|
||||||
myDB.upsert("comics", newVal, newKey)
|
myDB.upsert("comics", newVal, newKey)
|
||||||
|
|
||||||
if hours > 5:
|
if hours > 5:
|
||||||
|
|
|
@ -28,7 +28,6 @@ import time
|
||||||
import threading
|
import threading
|
||||||
import csv
|
import csv
|
||||||
import platform
|
import platform
|
||||||
import Queue
|
|
||||||
import urllib
|
import urllib
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
@ -86,10 +85,6 @@ class WebInterface(object):
|
||||||
sconv = baseissues[seas]
|
sconv = baseissues[seas]
|
||||||
isCounts[sconv]+=1
|
isCounts[sconv]+=1
|
||||||
continue
|
continue
|
||||||
print ("skipped: " + str(isCounts[1]))
|
|
||||||
print ("wanted: " + str(isCounts[2]))
|
|
||||||
print ("archived: " + str(isCounts[3]))
|
|
||||||
print ("downloaded: " + str(isCounts[4]))
|
|
||||||
isCounts = {
|
isCounts = {
|
||||||
"Skipped" : str(isCounts[1]),
|
"Skipped" : str(isCounts[1]),
|
||||||
"Wanted" : str(isCounts[2]),
|
"Wanted" : str(isCounts[2]),
|
||||||
|
@ -109,8 +104,9 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="artistredone.html", title=comic['ComicName'], comic=comic, issues=issues, comicConfig=comicConfig, isCounts=isCounts)
|
return serve_template(templatename="artistredone.html", title=comic['ComicName'], comic=comic, issues=issues, comicConfig=comicConfig, isCounts=isCounts)
|
||||||
artistPage.exposed = True
|
artistPage.exposed = True
|
||||||
|
|
||||||
def searchit(self, name, issue=None, mode=None):
|
def searchit(self, name, issue=None, mode=None, type=None):
|
||||||
type = 'comic' # let's default this to comic search only for the time being (will add story arc, characters, etc later)
|
if type is None: type = 'comic' # let's default this to comic search only for the time being (will add story arc, characters, etc later)
|
||||||
|
else: print (str(type) + " mode enabled.")
|
||||||
#mode dictates type of search:
|
#mode dictates type of search:
|
||||||
# --series ... search for comicname displaying all results
|
# --series ... search for comicname displaying all results
|
||||||
# --pullseries ... search for comicname displaying a limited # of results based on issue
|
# --pullseries ... search for comicname displaying a limited # of results based on issue
|
||||||
|
@ -124,6 +120,8 @@ class WebInterface(object):
|
||||||
searchresults = mb.findComic(name, mode, issue=None)
|
searchresults = mb.findComic(name, mode, issue=None)
|
||||||
elif type == 'comic' and mode == 'want':
|
elif type == 'comic' and mode == 'want':
|
||||||
searchresults = mb.findComic(name, mode, issue)
|
searchresults = mb.findComic(name, mode, issue)
|
||||||
|
elif type == 'storyarc':
|
||||||
|
searchresults = mb.findComic(name, mode, issue=None, storyarc='yes')
|
||||||
|
|
||||||
searchresults = sorted(searchresults, key=itemgetter('comicyear','issues'), reverse=True)
|
searchresults = sorted(searchresults, key=itemgetter('comicyear','issues'), reverse=True)
|
||||||
#print ("Results: " + str(searchresults))
|
#print ("Results: " + str(searchresults))
|
||||||
|
@ -554,10 +552,9 @@ class WebInterface(object):
|
||||||
skipped2wanted.exposed = True
|
skipped2wanted.exposed = True
|
||||||
|
|
||||||
def manualRename(self, comicid):
|
def manualRename(self, comicid):
|
||||||
print ("entering.")
|
|
||||||
if mylar.FILE_FORMAT == '':
|
if mylar.FILE_FORMAT == '':
|
||||||
print ("You haven't specified a File Format in Configuration/Advanced")
|
logger.error("You haven't specified a File Format in Configuration/Advanced")
|
||||||
print ("Cannot rename files.")
|
logger.error("Cannot rename files.")
|
||||||
return
|
return
|
||||||
|
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
|
@ -565,27 +562,32 @@ class WebInterface(object):
|
||||||
comicdir = comic['ComicLocation']
|
comicdir = comic['ComicLocation']
|
||||||
comicname = comic['ComicName']
|
comicname = comic['ComicName']
|
||||||
extensions = ('.cbr', '.cbz')
|
extensions = ('.cbr', '.cbz')
|
||||||
issues = myDB.action("SELECT * FROM issues WHERE ComicID=?", [comicid])
|
issues = myDB.action("SELECT * FROM issues WHERE ComicID=?", [comicid]).fetchall()
|
||||||
comfiles = []
|
comfiles = []
|
||||||
|
filefind = 0
|
||||||
for root, dirnames, filenames in os.walk(comicdir):
|
for root, dirnames, filenames in os.walk(comicdir):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
if filename.lower().endswith(extensions):
|
if filename.lower().endswith(extensions):
|
||||||
print ("filename being checked is : " + str(filename))
|
#logger.info("filename being checked is : " + str(filename))
|
||||||
for issue in issues:
|
for issue in issues:
|
||||||
if issue['Location'] == filename:
|
if issue['Location'] == filename:
|
||||||
print ("matched " + str(filename) + " to DB file " + str(issue['Location']))
|
#logger.error("matched " + str(filename) + " to DB file " + str(issue['Location']))
|
||||||
renameiss = helpers.rename_param(comicid, comicname, issue['Issue_Number'], filename, comicyear=None, issueid=None)
|
renameiss = helpers.rename_param(comicid, comicname, issue['Issue_Number'], filename, comicyear=None, issueid=None)
|
||||||
nfilename = renameiss['nfilename']
|
nfilename = renameiss['nfilename']
|
||||||
srciss = os.path.join(comicdir,filename)
|
srciss = os.path.join(comicdir,filename)
|
||||||
dstiss = os.path.join(comicdir,nfilename)
|
dstiss = os.path.join(comicdir,nfilename)
|
||||||
logger.info("Renaming " + str(filename) + " ... to " + str(nfilename))
|
if filename != nfilename:
|
||||||
|
logger.info("Renaming " + str(filename) + " ... to ... " + str(nfilename))
|
||||||
try:
|
try:
|
||||||
shutil.move(srciss, dstiss)
|
shutil.move(srciss, dstiss)
|
||||||
except (OSError, IOError):
|
except (OSError, IOError):
|
||||||
logger.error("Failed to move files - check directories and manually re-run.")
|
logger.error("Failed to move files - check directories and manually re-run.")
|
||||||
continue
|
return
|
||||||
|
filefind+=1
|
||||||
print ("hello")
|
else:
|
||||||
|
logger.info("Not renaming " + str(filename) + " as it is in desired format already.")
|
||||||
|
#continue
|
||||||
|
logger.info("I have renamed " + str(filefind) + " issues of " + str(comicname))
|
||||||
manualRename.exposed = True
|
manualRename.exposed = True
|
||||||
|
|
||||||
def searchScan(self, name):
|
def searchScan(self, name):
|
||||||
|
@ -1105,7 +1107,6 @@ class WebInterface(object):
|
||||||
|
|
||||||
error_change.exposed = True
|
error_change.exposed = True
|
||||||
|
|
||||||
|
|
||||||
def comic_config(self, com_location, ComicID, alt_search=None, fuzzy_year=None):
|
def comic_config(self, com_location, ComicID, alt_search=None, fuzzy_year=None):
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
#--- this is for multipe search terms............
|
#--- this is for multipe search terms............
|
||||||
|
|
Loading…
Reference in New Issue