From b2c3674afdab31330955ce3b6a7320e6d5de5fe0 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Fri, 9 Nov 2012 21:02:59 +0000 Subject: [PATCH] Added a hack that will probably be removed git-svn-id: http://comictagger.googlecode.com/svn/trunk@19 6c5673fe-1810-88d6-992b-cd32ca31540c --- filenameparser.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/filenameparser.py b/filenameparser.py index 39ca491..355ade1 100644 --- a/filenameparser.py +++ b/filenameparser.py @@ -127,16 +127,26 @@ class FileNameParser: def parseFilename( self, filename ): + # remove the path filename = os.path.basename(filename) # remove the extension filename = os.path.splitext(filename)[0] - - #url decvocde, just in case + + #url decode, just in case filename = unquote(filename) - + + # ----HACK + # remove the first word that word is a 3 digit number. + # some story arcs collection packs do this, but it's ugly + # this will probably break something, i.e. "100 bullets" + word = filename.split(' ')[0] + if len(word) == 3 and word[0] =='0' and word.isdigit(): + filename = filename[4:] + # ----HACK - + self.issue = self.getIssueNumber(filename) self.series, self.volume = self.getSeriesName(filename, self.issue) self.year = self.getYear(filename)