ZeroQI / Absolute-Series-Scanner

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

Movie scanning not behaving as described #267

Closed KuroSetsuna29 closed 3 years ago

KuroSetsuna29 commented 4 years ago

As indicated from README:

Movie files in Series libraries (since this is a Series Scanner) are supported if:

  • Files are in a folder with the same name or with a single file inside it
  • Filename contain " - Complete Movie"
  • Files are numbered (01|ep 01|s01e01)

Expected: If I have the following file, that it should meet the conditions above and be picked up as season 1 episode 1:

Meitantei Conan - Movie 16 - 11-ninme no Striker/Detective Conan - Movie 16 - The Eleventh Striker - Complete Movie [DCTP][1080p][H264][B3F676E6].mkv

Actual: It is being picked up as season 1 episode 16.

Looking at the following code:

      if not path and " - Complete Movie" in ep:  ep, title, show = "01", ep.split(" - Complete Movie")[0], ep.split(" - Complete Movie")[0]   ### Movies ### If using WebAOM (anidb rename) and movie on root
      elif len(files)==1 and (not re.search(r"\d+(\.\d+)?", clean_string(filename, True)) or "-m" in folder_show.split()):
        ep, title = "01", folder_show  #if  ("movie" in ep.lower()+folder_show.lower() or "gekijouban" in folder_show.lower()) or "-m" in folder_show.split():  ep, title,      = "01", folder_show                  ### Movies ### If only one file in the folder & contains '(movie|gekijouban)' in the file or folder name

This doesn't seem to either match the inline comment or what the README describes.

  1. It does match with filename containing "- Complete Movie" but only when on root and not within a folder, this is not stated in the README
  2. It does match only one file in the folder but because the filename has numbers it fails the regex r"\d+(\.\d+)?" (by the way, this regex will match anything that just has numbers in it as the (\.\d+) is optional. It looked like it use to check if it contained the word movie|gekijouban but was changed here: https://github.com/ZeroQI/Absolute-Series-Scanner/commit/55cbf913ad1d7b1aa80535d0be430bf4d1d72d11

Not sure if this is intentional, but I would suggest one or both of the following fixes:

  1. Allow "- Complete Movie" within sub folders, ie. remove empty path requirement
  2. Add another OR condition if filename contains (movie|gekijouban), something like:
    elif len(files)==1 and (not re.search(r"\d+(\.\d+)?", clean_string(filename, True)) or "movie" in ep.lower()+folder_show.lower() or "gekijouban" in ep.lower()+folder_show.lower() or "-m" in folder_show.split()):

P.S. While writing this I think I found my issue, is that I have the folder name as "Meitantei Conan" and the filename as "Detective Conan" so it was not automatically stripping the name out. However I think my concerns are still valid as it is either misleading or doesn't behave as intended. root.agent.log root-media-Anime 2.filelist.log root-media-Anime 2.scanner.log Meitantei Conan - Movie 16 - 11-ninme no Striker.agent-search.log Meitantei Conan - Movie 16 - 11-ninme no Striker.agent-update.log Meitantei Conan - Movie 16 - 11-ninme no Striker.filelist.log Meitantei Conan - Movie 16 - 11-ninme no Striker.scanner.log

ZeroQI commented 4 years ago

Yes, matching the filename to the folder name helps greatly, but it should also manage outside of it. I think it was JMM that used that "complete movie" naming convention from memory Thanks for following the readme, i apologize it isn't precise enough regarding this matter

For your points

Yes i agree to the addition, if you do a pull request will validate it straight away

ZeroQI commented 4 years ago

Thanks for the fix.

EndOfLine369 commented 4 years ago

Hi, this fix does not work as intended. This incorrectly wipes out any mapping done on the "show" variable set from "folder_show".

EX: "Gekijouban Sword Art Online Ordinal Scale - 01" s04e001 (Orig: s01e001 ) "Word Search" "" "[RH] Gekijouban Sword Art Online Ordinal Scale - 01 - Complete Movie (Dual Audio 5.1 FLAC) [B7E3B1B2].mkv" Where it was previously correctly getting properly mapped under [tvdb6-259640]. "Sword Art Online the Movie - Ordinal Scale [tvdb6-259640]" s04e001 (Orig: s01e001 ) "Word Search" "Complete Movie" "[RH] Gekijouban Sword Art Online Ordinal Scale - 01 - Complete Movie (Dual Audio 5.1 FLAC) [B7E3B1B2].mkv"

Note, in this situation/example, it thankfully still worked for the episode number as mapping data was available. But it still breaks the series name and thus HAMA matching.

Believe it just needs to use if not path: show = ep.split(" - Complete Movie")[0]. Basically we only ever want to override "show" when its on root and thus never have any mapping being done. You see this in all 3 sections we override this variable.

EX from code before this merge: https://github.com/ZeroQI/Absolute-Series-Scanner/blob/85e6373393893f1b113d525cb374fab8081f7e95/Scanners/Series/Absolute%20Series%20Scanner.py#L940 https://github.com/ZeroQI/Absolute-Series-Scanner/blob/85e6373393893f1b113d525cb374fab8081f7e95/Scanners/Series/Absolute%20Series%20Scanner.py#L948-L950 https://github.com/ZeroQI/Absolute-Series-Scanner/blob/85e6373393893f1b113d525cb374fab8081f7e95/Scanners/Series/Absolute%20Series%20Scanner.py#L999

ZeroQI commented 3 years ago

Line 1019 has if not path but in a path only loop: is if not path and not " - Complete Movie" in file: show = clean_string( " ".join(words[:words.index(word)]) if words.index(word)>0 else "No title", False) # root folder and moved out of loop and added support for movie (year).ext at root