mirror of
https://github.com/evilhero/mylar
synced 2025-03-10 05:52:48 +00:00
Fix: Recheck files/scanning of files resulted in missing files even if present (issue#127)
This commit is contained in:
parent
d7810adafc
commit
3ff5866763
1 changed files with 10 additions and 8 deletions
|
@ -19,16 +19,16 @@ import os.path
|
||||||
import pprint
|
import pprint
|
||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
|
import logger
|
||||||
|
|
||||||
def file2comicmatch(watchmatch):
|
def file2comicmatch(watchmatch):
|
||||||
#print ("match: " + str(watchmatch))
|
#print ("match: " + str(watchmatch))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def listFiles(dir,watchcomic):
|
def listFiles(dir,watchcomic):
|
||||||
#print("dir:" + dir)
|
logger.fdebug("comic: " + watchcomic)
|
||||||
#print("comic: " + watchcomic)
|
|
||||||
basedir = dir
|
basedir = dir
|
||||||
#print "Files in ", dir, ": "
|
logger.fdebug("Looking in: " + dir)
|
||||||
watchmatch = {}
|
watchmatch = {}
|
||||||
comiclist = []
|
comiclist = []
|
||||||
comiccnt = 0
|
comiccnt = 0
|
||||||
|
@ -38,15 +38,18 @@ def listFiles(dir,watchcomic):
|
||||||
subname = item
|
subname = item
|
||||||
#print subname
|
#print subname
|
||||||
subname = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]',' ', str(subname))
|
subname = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]',' ', str(subname))
|
||||||
watchcomic = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]', ' ', str(watchcomic))
|
modwatchcomic = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]', ' ', str(watchcomic))
|
||||||
|
modwatchcomic = re.sub('\s+', ' ', str(modwatchcomic)).strip()
|
||||||
|
subname = re.sub('\s+', ' ', str(subname)).strip()
|
||||||
#if '_' in subname:
|
#if '_' in subname:
|
||||||
# subname = subname.replace('_', ' ')
|
# subname = subname.replace('_', ' ')
|
||||||
if watchcomic.lower() in subname.lower():
|
logger.fdebug("watchcomic:" + str(modwatchcomic) + " ..comparing to found file: " + str(subname))
|
||||||
|
if modwatchcomic.lower() in subname.lower():
|
||||||
if 'annual' in subname.lower():
|
if 'annual' in subname.lower():
|
||||||
#print ("it's an annual - unsure how to proceed")
|
#print ("it's an annual - unsure how to proceed")
|
||||||
continue
|
continue
|
||||||
comicpath = os.path.join(basedir, item)
|
comicpath = os.path.join(basedir, item)
|
||||||
#print ( watchcomic + " - watchlist match on : " + comicpath)
|
logger.fdebug( modwatchcomic + " - watchlist match on : " + comicpath)
|
||||||
comicsize = os.path.getsize(comicpath)
|
comicsize = os.path.getsize(comicpath)
|
||||||
#print ("Comicsize:" + str(comicsize))
|
#print ("Comicsize:" + str(comicsize))
|
||||||
comiccnt+=1
|
comiccnt+=1
|
||||||
|
@ -60,8 +63,7 @@ def listFiles(dir,watchcomic):
|
||||||
pass
|
pass
|
||||||
#print ("directory found - ignoring")
|
#print ("directory found - ignoring")
|
||||||
|
|
||||||
#print ("you have a total of " + str(comiccnt) + " comics")
|
logger.fdebug("you have a total of " + str(comiccnt) + " " + str(watchcomic) + " comics")
|
||||||
#print ("watchdata: " + str(watchmatch))
|
|
||||||
watchmatch['comiccount'] = comiccnt
|
watchmatch['comiccount'] = comiccnt
|
||||||
return watchmatch
|
return watchmatch
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue