diff --git a/data/interfaces/default/comicdetails.html b/data/interfaces/default/comicdetails.html index dae6012c..41d1be64 100644 --- a/data/interfaces/default/comicdetails.html +++ b/data/interfaces/default/comicdetails.html @@ -495,8 +495,9 @@ %endfor - + +
diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 1e2a7549..f0968acb 100755 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -212,7 +212,7 @@ Usenet Sabnzbd NZBget Black Hole -
+
@@ -283,7 +283,7 @@
-
+
@@ -380,7 +380,7 @@
- +
@@ -961,8 +961,8 @@ if ($("#nzb_downloader_sabnzbd").is(":checked")) { - $("#sabnzbd_options").show(); $("#nzbget_options,#blackhole_options").hide(); + $("#sabnzbd_options").show(); } if ($("#nzb_downloader_nzbget").is(":checked")) { diff --git a/mylar/api.py b/mylar/api.py index 6249d1a3..a773b43a 100644 --- a/mylar/api.py +++ b/mylar/api.py @@ -145,42 +145,6 @@ class Api(object): def _getLogs(self, **kwargs): pass - def _findArtist(self, **kwargs): - if 'name' not in kwargs: - self.data = 'Missing parameter: name' - return - if 'limit' in kwargs: - limit = kwargs['limit'] - else: - limit=50 - - self.data = mb.findArtist(kwargs['name'], limit) - - def _findAlbum(self, **kwargs): - if 'name' not in kwargs: - self.data = 'Missing parameter: name' - return - if 'limit' in kwargs: - limit = kwargs['limit'] - else: - limit=50 - - self.data = mb.findRelease(kwargs['name'], limit) - - def _addArtist(self, **kwargs): - if 'id' not in kwargs: - self.data = 'Missing parameter: id' - return - else: - self.id = kwargs['id'] - - try: - importer.addComictoDB(self.id) - except Exception, e: - self.data = e - - return - def _delComic(self, **kwargs): if 'id' not in kwargs: self.data = 'Missing parameter: id' diff --git a/mylar/cmtagmylar.py b/mylar/cmtagmylar.py index d13b5026..dc72e3f3 100644 --- a/mylar/cmtagmylar.py +++ b/mylar/cmtagmylar.py @@ -2,7 +2,7 @@ # modified very slightly so Mylar just passes it the IssueID for it to do it's magic. -import os +import os, errno import sys import re import glob @@ -92,8 +92,15 @@ def run (dirName, nzbName=None, issueid=None, manual=None, filename=None): if os.path.exists( comicpath ): shutil.rmtree( comicpath ) - os.makedirs( comicpath ) + logger.fdebug('attempting to create directory @: ' + str(comicpath)) + try: + os.makedirs(comicpath) + except OSError: + raise + + logger.fdebug('created directory @ : ' + str(comicpath)) + logger.fdebug('filename is : ' + str(filename)) if filename is None: filename_list = glob.glob( os.path.join( downloadpath, "*.cbz" ) ) filename_list.extend( glob.glob( os.path.join( downloadpath, "*.cbr" ) ) ) @@ -114,10 +121,8 @@ def run (dirName, nzbName=None, issueid=None, manual=None, filename=None): if filename.endswith('.cbr'): f = os.path.join( comicpath, filename ) if zipfile.is_zipfile( f ): - #print "zipfile detected" + logger.fdebug('zipfile detected') base = os.path.splitext( f )[0] - #print base - #print f shutil.move( f, base + ".cbz" ) logger.fdebug('{0}: renaming {1} to be a cbz'.format( scriptname, os.path.basename( f ) )) @@ -138,6 +143,7 @@ def run (dirName, nzbName=None, issueid=None, manual=None, filename=None): # Now rename all CBR files to RAR if filename.endswith('.cbr'): + #logger.fdebug('renaming .cbr to .rar') f = os.path.join( comicpath, filename) base = os.path.splitext( f )[0] baserar = base + ".rar" diff --git a/mylar/filechecker.py b/mylar/filechecker.py index 9b477d89..0b30dd9d 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -86,7 +86,7 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non item = fname['filename'] if item == 'cover.jpg' or item == 'cvinfo': continue - if not item.endswith(extensions): + if not item.lower().endswith(extensions): logger.fdebug('[FILECHECKER] filename not a valid cbr/cbz - ignoring: ' + item) continue @@ -157,11 +157,11 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non #if the series has digits this f's it up. if numberinseries == 'True' or decimalinseries == 'True': #we need to remove the series from the subname and then search the remainder. - watchname = re.sub('[-\:\;\!\'\/\?\+\=\_\%\.]', '', watchcomic) #remove spec chars for watchcomic match. + watchname = re.sub('[\:\;\!\'\/\?\+\=\_\%\.]', '', watchcomic) #remove spec chars for watchcomic match. logger.fdebug('[FILECHECKER] watch-cleaned: ' + str(watchname)) subthis = re.sub('.cbr', '', subname) subthis = re.sub('.cbz', '', subthis) - subthis = re.sub('[-\:\;\!\'\/\?\+\=\_\%\.]', '', subthis) + subthis = re.sub('[\:\;\!\'\/\?\+\=\_\%\.]', '', subthis) logger.fdebug('[FILECHECKER] sub-cleaned: ' + str(subthis)) subthis = subthis[len(watchname):] #remove watchcomic #we need to now check the remainder of the string for digits assuming it's a possible year @@ -173,7 +173,7 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non subit = re.sub('(.*)[\s+|_+](19\d{2}|20\d{2})(.*)', '\\1 (\\2) \\3', subname) subthis2 = re.sub('.cbr', '', subit) subthis1 = re.sub('.cbz', '', subthis2) - subname = re.sub('[-\:\;\!\'\/\?\+\=\_\%\-]', '', subthis1) + subname = re.sub('[\:\;\!\'\/\?\+\=\_\%]', '', subthis1) #if '.' appears more than once at this point, then it's being used in place of spaces. #if '.' only appears once at this point, it's a decimal issue (since decimalinseries is False within this else stmt). if len(str(subname.count('.'))) == 1: @@ -235,6 +235,7 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non detneg = "no" leavehyphen = False should_restart = True + lenwatch = len(watchcomic) # because subname gets replaced dynamically, the length will change and things go wrong. while should_restart: should_restart = False for nono in not_these: @@ -254,7 +255,8 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non logger.fdebug('[FILECHECKER] possible negative issue detected.') nonocount = nonocount + subcnt - 1 detneg = "yes" - elif '-' in watchcomic and i < len(watchcomic): + elif '-' in watchcomic and j < lenwatch: + lenwatch -=1 logger.fdebug('[FILECHECKER] - appears in series title.') logger.fdebug('[FILECHECKER] up to - :' + subname[:j+1].replace('-', ' ')) logger.fdebug('[FILECHECKER] after - :' + subname[j+1:]) @@ -263,7 +265,7 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non should_restart = True leavehyphen = True i+=1 - if detneg == "no" or leavehyphen == False: + if detneg == "no" and leavehyphen == False: subname = re.sub(str(nono), ' ', subname) nonocount = nonocount + subcnt #logger.fdebug('[FILECHECKER] (str(nono) + " detected " + str(subcnt) + " times.") @@ -374,23 +376,23 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non i=0 while (i < len(charpos)): for i,j in enumerate(charpos): - #print i,j - #print subname - #print "digitchk: " + str(subname[j:]) + #logger.fdebug('i,j:' + str(i) + ',' + str(j)) + #logger.fdebug(str(len(subname)) + ' - subname: ' + subname) + #logger.fdebug("digitchk: " + str(subname[j:])) if j >= len(subname): logger.fdebug('[FILECHECKER] end reached. ignoring remainder.') break elif subname[j:] == '-': - if i <= len(subname) and subname[i+1].isdigit(): + if j <= len(subname) and subname[j+1].isdigit(): logger.fdebug('[FILECHECKER] negative issue detected.') #detneg = "yes" elif j > findtitlepos: if subname[j:] == '#': - if subname[i+1].isdigit(): + if subname[j+1].isdigit(): logger.fdebug('[FILECHECKER] # detected denoting issue#, ignoring.') else: nonocount-=1 - elif '-' in watchcomic and i < len(watchcomic): + elif '-' in watchcomic and j < len(watchcomic): logger.fdebug('[FILECHECKER] - appears in series title, ignoring.') else: logger.fdebug('[FILECHECKER] special character appears outside of title - ignoring @ position: ' + str(charpos[i]))