ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
1.01k stars 155 forks source link

episodeoffset="-1" fails but both episodeoffset="1" works #207

Closed Feredzhanov closed 5 years ago

Feredzhanov commented 5 years ago

So I had an odd mapping problem and I'm not sure if the problem is with ASS interpreting wrong ScudLee's offset values, or if the same problem exists with Kodi (last I remember ScudLee's list is generally made for use with Kodi plug-ins).

So the original list mapping is:

<anime anidbid="12498" tvdbid="254653" defaulttvdbseason="4" episodeoffset="-1" tmdbid="" imdbid="">
    <name>High School DxD Hero</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="0">;1-18;</mapping>
    </mapping-list>
  </anime>

But then AniDB Ep. 02 is mapped as TVDB Ep. 02 no matter how I change the value. However, this:

  <anime anidbid="12498" tvdbid="254653" defaulttvdbseason="4" episodeoffset="" tmdbid="" imdbid="">
    <name>High School DxD Hero</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="0">;1-18;</mapping>
      <mapping anidbseason="1" tvdbseason="4" start="2" end="13" offset="-1"/>
    </mapping-list>
  </anime>

works as intended. I'm not sure if it's a bug in ASS or not, just may be worth checking though, since it's almost sure to happen somewhere else as well.

ZeroQI commented 5 years ago

I am sorry but you are not making any sense to me

I need

Feredzhanov commented 5 years ago

Ok, so here are the logs with the first settings (the one currently in ScudLee's list High School DxD Hero [anidb2-12498].agent-search.log High School DxD Hero [anidb2-12498].filelist.log High School DxD Hero [anidb2-12498].scanner.log

And here are after the changes: High School DxD Hero [anidb2-12498].agent-search.log High School DxD Hero [anidb2-12498].filelist.log High School DxD Hero [anidb2-12498].scanner.log

Feredzhanov commented 5 years ago

Ok, so apparently, negative values don't work in the current scenario. High School DxD Hero [anidb2-12498].scanner.log

ZeroQI commented 5 years ago

episodeoffset="-1" fails but both episodeoffset="1" and mapping offset "-1" works

High School DxD Hero [anidb2-12498].scanner.log was sufficient to see the failed mapping, here is my approach to see where was the issue. I now see what you meant...

This is an important bug that could impact many series and weirdly enough wasn't reported until now... Thanks for this bug report.

def isinteger(string):
return isdigit(string) or len(string)>1 and string.startswith("-") and string[1:].isdigit() or much simpler but not a one liner: try: return int(string) except ValueError: return False

I cannot put into the master for now as i cannot test but if anybody can:

EndOfLine369 commented 5 years ago

Could even just use:

IS_INT=com(r"^-?\d+$")
def isinteger(string):  return bool(IS_INT.search(string))
ZeroQI commented 5 years ago

@EndOfLine369 why using regex when you don't have to? i honestly cannot tell what the function does reading the code,,,

Please test and report

EndOfLine369 commented 5 years ago

Was just to give another option 😃

ZeroQI commented 5 years ago

The option is good but in an obscure way. I am super bad with regex...

I prefer the shortest code but readable. I know i do it my way otherwise wouldn't have bpther coding as much. It's becoming harder. Btw, If you need me to prioritise something let ne know what as i can't focus much. I tried reducing the number of bug reports but they keep increasing...

On Wed, 10 Apr 2019 7:41 pm EndOfLine369, notifications@github.com wrote:

Was just to give another option 😃

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/207#issuecomment-481813269, or mute the thread https://github.com/notifications/unsubscribe-auth/AE7LZSExEmfOdVFpSIz6ZuWlLafacM-6ks5vfjBKgaJpZM4ckM4O .

ZeroQI commented 5 years ago

So... is the fix (or the scanner still) working?

sven-7 commented 5 years ago

I think this broke anidb4. Nothing I'm adding is working with it now.

See logs on current master:
Bungo Stray Dogs.filelist.log Bungo Stray Dogs.scanner.log

See logs on commit d30b789 - where it is working:

Bungo Stray Dogs.scanner.log Bungo Stray Dogs.filelist.log

Not sure if this has anything to do with it:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
AniDB mode (anidb4) enabled, loading season and relation mapping for all associated tvdbid entries
URL: 'https://rawgit.com/ScudLee/anime-lists/master/anime-list-master.xml', Using cached file: 'c:\users\raftel3\appdata\local\temp\ASS-anime-list-master.xml'
URL: 'https://rawgit.com/ZeroQI/Absolute-Series-Scanner/master/anime-list-corrections.xml', Using cached file: 'c:\users\raftel3\appdata\local\temp\ASS-anime-list-corrections.xml'
Error parsing content, Exception: 'global name 'isdigit' is not defined'
-------------------------------------------------------------------------------------------------------------------------------------------------------------
misc_count: {'1': 1, 'oad': 1}
misc_words: []
-------------------------------------------------------------------------------------------------------------------------------------------------------------
ZeroQI commented 5 years ago

Look like it was crashing, isdigit() method works on strings but not as standalone function... Just submitted to fix https://github.com/ZeroQI/Absolute-Series-Scanner/commit/a7ef39014104c92e433b33e0fa114097fcd48a55 Please test and report

sven-7 commented 5 years ago

Seems good to me now.

ZeroQI commented 5 years ago

Excellent :D Thanks for testing

On Sat, 27 Apr 2019 8:23 pm sven-7, notifications@github.com wrote:

Seems good to me now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/207#issuecomment-487312805, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHMWZNO4HB6MOH3I5IVLK3PSSR3RANCNFSM4HEQZYHA .