Skip to content

Commit

Permalink
"Misc" variable calculation once only
Browse files Browse the repository at this point in the history
#47 (comment)

in case of bad character maps, would all be reported once per file in the folder
adding these matches, the others being incoherent: 14844052:'-' and 15711646:'~'
  • Loading branch information
ZeroQI committed Jul 8, 2016
1 parent 39b7ac4 commit 240ad89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Scanners/Series/Absolute Series Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"mthd", "thora", 'sickrage', 'brrip', "remastered", "yify", "tsr", "reidy", "gerdhanse", #'limited',
'rikou', 'homЯ', "it00nz", "nn92", "mthd", "elysium", "encodebyjosh", "krissy", "reidy", "it00nz", "s4a"] #
CHARACTERS_MAP = {
14844057:"'", 14844051:'-', 14844070:'...', 15711386:':', 14846080:'∀', #['’' \xe2\x80\x99] ['–' \xe2\x80\x93] ['…' \xe2\x80\xa6] # ':' # 12770:'', # '∀ Gundam' no need #'´' ['\xc2', '\xb4']
14844057:"'", 14844051:'-', 14844052:'-', 14844070:'...', 15711386:':', 14846080:'∀', 15711646:'~', #['’' \xe2\x80\x99] ['–' \xe2\x80\x93] ['…' \xe2\x80\xa6] # ':' # 12770:'', # '∀ Gundam' no need #'´' ['\xc2', '\xb4']
50048:'A' , 50050:'A' , 50052:'Ä' , 50080:'a' , 50082:'a' , 50084:'a' , 50305:'a' , 50308:'A' , 50309:'a' , 50055:'C' , 50087:'c' , 50310:'C' , 50311:'c' , #'à' ['\xc3', '\xa0'] #'â' ['\xc3', '\xa2'] #'Ä' ['\xc3', '\x84'] #'ā' ['\xc4', '\x81'] #'À' ['\xc3', '\x80'] #'Â' ['\xc3', '\x82'] # 'Märchen Awakens Romance', 'Rozen Maiden Träumend' #'Ç' ['\xc3', '\x87'] #'ç' ['\xc3', '\xa7']
50057:'E' , 50088:'e' , 50089:'e' , 50090:'e' , 50091:'e' , 50323:'e' , 50328:'E' , 50329:'e' , #'É' ['\xc3', '\x89'] #'è' ['\xc3', '\xa8'] #'é' ['\xc3', '\xa9'] #'ē' ['\xc4', '\x93'] #'ê' ['\xc3', '\xaa'] #'ë' ['\xc3', '\xab']
50094:'i' , 50095:'i' , 50347:'i' , 50561:'L' , 50562:'l' , 50563:'N' , 50564:'n' , 50097:'n' , #'î' ['\xc3', '\xae'] #'ï' ['\xc3', '\xaf'] #'ī' ['\xc4', '\xab'] #'ñ' ['\xc3', '\xb1']
Expand Down Expand Up @@ -331,7 +331,7 @@ def Scan(path, files, mediaList, subdirs, language=None, root=None, **kwargs): #
if tvdb_mapping: Log("unknown_series_length: %s, tvdb_mapping: %s" % (unknown_series_length, str(tvdb_mapping)))

### File main loop ###
movie_list, AniDB_op, counter = {}, {}, 500; files.sort(key=natural_sort_key)
movie_list, AniDB_op, counter, misc = {}, {}, 500; files.sort(key=natural_sort_key), filter(None, " ".join( [clean_string(os.path.basename(x), True) for x in files]).lower().split()) # put all filenames in folder in a string to count if ep number valid or present in multiple files ###clean_string was true ###
for file in files:
ext = file[1:] if file.count('.')==1 and file.startswith('.') else os.path.splitext(file)[1].lstrip('.').lower() # Otherwise .plexignore file has extension ""
if ext=="ifo" and not file.upper()=="VIDEO_TS.IFO": continue
Expand All @@ -353,7 +353,7 @@ def Scan(path, files, mediaList, subdirs, language=None, root=None, **kwargs): #
if ep.lower().startswith(prefix.lower()): ep = replace_insensitive(ep, prefix , "").lstrip() # Series S2 like transformers (bad naming) # Serie S2 in season folder, Anidb specials regex doesn't like
if ep.lower().startswith("special") or "omake" in ep.lower() or "picture drama" in ep.lower(): season, title = 0, ep.title() # If specials, season is 0 and if title empty use as title ###
#Log("Second Initial: show '%s', season '%s', ep '%s'" % (show, season, ep))
words, misc = filter(None, ep.split()), filter(None, " ".join( [clean_string(os.path.basename(x), True) for x in files]).lower().split()) # put all filenames in folder in a string to count if ep number valid or present in multiple files ###clean_string was true ###
words = filter(None, ep.split()) #
for word in words: #
ep=word.lower().strip() # cannot use words[words.index(word)] otherwise# if word=='': continue filter prevent "" on double spaces
if "(" in ep and len(ep)==6 and ep[0]=='(' and ep[5]==')' and ep[1:5].isdigit(): ep = ep [1:5] # remove parenthesis from year in parenthesis
Expand Down

0 comments on commit 240ad89

Please sign in to comment.