Skip to content

Commit

Permalink
Remove 'FutureWarning' & Fix pull test
Browse files Browse the repository at this point in the history
  • Loading branch information
EndOfLine369 authored Aug 27, 2018
1 parent 9d5fb15 commit 2f2799b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Scanners/Series/Absolute Series Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def getmtime(name): return os.path.getmtime(os.path.join(root, path, name))
if rx in ANIDB_RX[:-2]: ### AniDB Specials ################################################################
season = 0 # offset = 100 for OP, 150 for ED, etc... #Log.info("ep: '%s', rx: '%s', file: '%s'" % (ep, rx, file))
# AniDB xml load (ALWAYS GZIPPED)
if source.startswith('anidb') and id and not anidb_xml and rx in ANIDB_RX[1:3]: #2nd and 3rd rx
if source.startswith('anidb') and id and anidb_xml is None and rx in ANIDB_RX[1:3]: #2nd and 3rd rx
import StringIO, gzip
anidb_str_gzip = urlopen(ANIDB_HTTP_API_URL+id, context=SSL_CONTEXT).read()
anidb_str = gzip.GzipFile(fileobj=StringIO.StringIO( anidb_str_gzip )).read()
Expand Down Expand Up @@ -832,7 +832,7 @@ def getmtime(name): return os.path.getmtime(os.path.join(root, path, name))
### OP/ED with letter version Example: op2a
if not ep.isdigit() and len(ep)>1 and ep[:-1].isdigit(): ep, offset = int(ep[:-1]), ord(ep[-1:])-ord('a')
else: offset = 0
if not anidb_xml:
if anidb_xml is not None:
if ANIDB_RX.index(rx) in AniDB_op: AniDB_op [ ANIDB_RX.index(rx) ] [ ep ] = offset # {101: 0 for op1a / 152: for ed2b} and the distance between a and the version we have hereep, offset = str( int( ep[:-1] ) ), offset + sum( AniDB_op.values() ) # "if xxx isdigit() else 1" implied since OP1a for example... # get the offset (100, 150, 200, 300, 400) + the sum of all the mini offset caused by letter version (1b, 2b, 3c = 4 mini offset)
else: AniDB_op [ ANIDB_RX.index(rx) ] = { ep: offset }
cumulative_offset = sum( [ AniDB_op [ ANIDB_RX.index(rx) ][x] for x in Dict(AniDB_op, ANIDB_RX.index(rx), default={0:0}) if x<ep ] )
Expand Down

0 comments on commit 2f2799b

Please sign in to comment.