Closed pathsny closed 3 years ago
you can rename the movie s01e01 as a workaround
I permitted movies in series libraries as per the readme: "Movies in series libraries support (names same as folder or contain " - Complete Movie")", and while i did not consider specials for movies in libraries folder, "Final Fantasy VII Advent Children - Complete Movie [AonE].avi" should be seen as s01e01
THis line should give the episode 1 to the file, can't see where it goes wrong for now https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/Scanners/Series/Absolute%20Series%20Scanner.py#L988
It works correctly when there is no other file. I wonder if the special being scanned first results in the entire folder being tagged as season 0 in some way.
I'd like to try and debug this, but I'm unclear on how to make changes and actually see the effect. Whats the development process to make a change and actually see it reflected?
When I modify one of the log.info lines. I've tried deleting the .pyc file and restarting the plexmediaserver. But for some reason I still dont see my changes reflected.
You need to do a Plex dance. If you don't change the folder content, scanner will not run again for that folder....
Ah sorry. I meant to say, I also renamed one of the files. So I see the scanner run again and write new log entries. However none of the changes to the python file I've made seem to be executed. For instance I modified this line https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/Scanners/Series/Absolute%20Series%20Scanner.py#L169 to say
Log.info("Plex xyz scan start: {}".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S,%f")))
but the log entries continue to say
Plex scan start: 2021-05-22 14:30:34,515010
If it the indeed the same line, Plex need restarting to load the new code, maybe a my/pyc refresh issue, but never seen pyc generated before...
@pathsny, Remove 'complete movie' from this line in WHACK and try a scan with both files in the folder.
TO
'dsr', 'dsrip', 'hdtv', 'pdtv', 'ppv', 'stv', 'tvrip', "hiei", "metis", "norar", # Source: dtv, stv
I removed "complete movie" and it didnt make a difference.
I also updated my scanner to the latest version and I'm running into an interesting experience with Logs now. The log file under
Plug-in\ Support/Data/com.plexapp.agents.hama/DataItems/_Logs/Anime/<show name>.scanner.log
does not get populated anymore.
Now I only see updates in
Plex Media Server/Logs/ASS Scanner Logs/<show name>.scanner.log
. And this update does not include any timestamps. How do I get logs from Log.info to show up?
that's where it should be. did you check in "Plex Media Scanner.log" to see if it crashed, and modified the folder content so the scanner run again (otherwise it use cached results making scanner development a pain) ?
that's where it should be. did you check in "Plex Media Scanner.log" to see if it crashed, and modified the folder content so the scanner run again (otherwise it use cached results making scanner development a pain) ?
Not quite sure I follow. What I mean is after I updated to the latest version. Everytime I change the folder content and rescan.
Plex Media Server/Logs/ASS Scanner Logs/<show name>.scanner.log
gets updated, which seems to indicate that it did not crash. In addition I dont see anything in Plex Media Scanner.log
indicating a crash. So I dont believe its crashing. The logs look like this
=============================================================================================================================================================
Call: "Plex", path: "Final Fantasy VII Advent Children", folder_show: "Final Fantasy VII Advent Children", dirs (0), files (2)
=============================================================================================================================================================
Unknown extension File: 'Final Fantasy VII Advent Children/anidb.id'
Unknown extension File: 'Final Fantasy VII Advent Children/tvshow.nfo'
=============================================================================================================================================================
Forced ID (source file) - source: "anidb", id: "1208"
"Final Fantasy VII Advent Children [anidb-1208]" s00e 5 "Word Search" "On the Way to a Smile Episode Denzel - lug" "Final Fantasy VII Advent Children - episode S5 - On the Way to a Smile Episode Denzel [THORA] - lug.mkv"
"Final Fantasy VII Advent Children [anidb-1208]" s00e 501 "__" "Complete Movie" "Final Fantasy VII Advent Children - Complete Movie [AonE].avi"
=============================================================================================================================================================
But the logs in Plug-in\ Support/Data/com.plexapp.agents.hama/DataItems/_Logs/Anime/<show name>.scanner.log
have not been updated at all.
I don't know if this is normal. The logs in Plex Media Server/Logs/ASS Scanner Logs/<show name>.scanner.log
are not as rich as the logs in Plug-in\ Support/Data/com.plexapp.agents.hama/DataItems/_Logs/Anime/<show name>.scanner.log
used to be. For instance its missing the timestamp when the scanning should have started.
Plug-in\ Support/Data/com.plexapp.agents.hama/DataItems/_Logs/Anime/
Line 305-306 Logs folder used is in Hama agent data folder if HAMA is the primary agent otherwise it's in Plex logs.
Logs format amended to have limited instances or duration logged to avoid appending you infinitely.
Ah I see, interestingly I've started seeing this error after I updated to the latest version.
Exception: ''PLEXTOKEN'', library_xml could not be loaded. X-Plex-Token file created?
The X-Plex-Token.id file is still present inside the "Plex Media Server" folder and the token inside still works (testing it from the command line). I'm not clear why the the exception keeps occurring. https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/Scanners/Series/Absolute%20Series%20Scanner.py#L176
I printed out os.environ and I dont see a key named 'PLEXTOKEN' but I do see 'X_PLEX_TOKEN' which interestingly is not the value from the attached id file but is the value associated with a device named "plex" from devices.xml
os.environ['PLEXTOKEN'] is a workaround somebody implemented for some OS...
This should fix
library_xml = etree.fromstring(read_url(Request(PLEX_LIBRARY_URL, headers={"X-Plex-Token": read_file(os.path.join(PLEX_ROOT, "X-Plex-Token.id")).strip() if os.path.isfile(os.path.join(PLEX_ROOT, "X-Plex-Token.id")) else Dict(os.environ, 'PLEXTOKEN')})))
So I did some digging and found where the issue is.
This line matches the ep against the string - Complete Movie
https://github.com/ZeroQI/Absolute-Series-Scanner/blob/21e57b0d957b4fa29acbee1418c878411762db15/Scanners/Series/Absolute%20Series%20Scanner.py#L992
However, the call to clean_string
here
https://github.com/ZeroQI/Absolute-Series-Scanner/blob/21e57b0d957b4fa29acbee1418c878411762db15/Scanners/Series/Absolute%20Series%20Scanner.py#L986 has the prefix and the leading dash. So the string ep is now Complete Movie
and not - Complete Movie
When the special file is removed from the folder, the reason the match is correct is because of the next rule here https://github.com/ZeroQI/Absolute-Series-Scanner/blob/21e57b0d957b4fa29acbee1418c878411762db15/Scanners/Series/Absolute%20Series%20Scanner.py#L993 which applies in situations where there is only one file in the folder.
If I were to change the check to match against Complete Movie
instead of - Complete Movie
the file is recognized correctly.
Do you think it's reasonable to make this change?
We could test lines 992-994 after line 981, but ultimately, this change is the easiest and still scrub the filename Thanks for the detective work, couldn't see where it was going wrong
Platform
Operating system and version: Truenas-12.0-Stable (Freebsd 11.2-RELEASE-p9) Plex version: 1.22.3.4392
Expected Behavior
Correctly tag movie files as being in season 1
Current Behavior
When a movie folder includes a special, the movie gets identified as a special
Steps to Reproduce
When I have
the file gets recognized as Season 1, Episode 1 (Complete Movie)
When I have
the files get recognized as S00E05 and S00E01
As you can see, the addition of another file changes how the movie gets identified.
Additional information