Closed sudosauer closed 4 years ago
The logic was to capitalize if it was all lowercase or all upper case. Can you share with episodes filenames?
If they weren't all of the same case then the title changed and we should comment that line maybe or do our own capitalize function...
Here are some filenames: The Office (US) - S00E40 - Webisodes The 3rd Floor 1 - Moving On The Office (US) - S00E71 - S02E16 Valentine's Day Deleted Scenes The Office (US) - S00E120 - Excerpt From The 58th Annual Primetime Emmy Awards The Office (US) - S00E142 - Michael Scott's Dunder Mifflin Ad
The logic seems right, its just that titles are always lowercase. 'capwords' from the string module is a little better than title() though are still a few cases where it will fail. Good discussion about it over here: https://stackoverflow.com/a/12336911.
I'd say the best solution would be to pass the filename through, trust what capitalization they already have (if any), but somewhere in the code its forced to be lowercase.
I can see the same in my logs as well
"SERIES_RX-1" "Blackadder'S Christmas Carol" "Black Adder - S00E03 - Blackadder's Christmas Carol [HandBrake].mkv"
I see the code segment in question. Will let you know.
One interesting thing I've found is that if you have the specials in the parent folder where it looks for content, than the the title remains unmodified.
For example, if specials are located here:
/tv/Show/Specials/(Specials Here)
or here:
/tv/Show/(Specials Here)
then they are always lowercased.
If you put specials here:
/tv/(Specials Here)
then they pass through without being lowercased, still showing up correctly under specials season in the correct show in Plex. Not sure if that helps.
The files also don't show up in the logs, so I'm guessing because they're not properly in a series and season folder they aren't being fully processed.
Done
Yup, that fixes it. Filenames now preserved and show up the same in Plex. Thank You!
So one slightly obscure issue I've come across is the scanner modifying the title of all files it adds to Plex. Normally this isn't noticeable because the metadata agent will overwrite the title, but when there isn't an entry in TVDB or The Movie DB etc., then the title falls back to what the scanner outputs. But, the scanner uses the title() function which has odd cases where "3rd" becomes "3Rd" and "that's" becomes "That'S" which leaves me with these scenarios:
This line in the 'add_episode_into_plex' function seems to suggest that the title comes in unmodified. https://github.com/ZeroQI/Absolute-Series-Scanner/blob/a35db37dedf48cb40bb84be6ff96f32ce4f8b5d2/Scanners/Series/Absolute%20Series%20Scanner.py#L441 However, by adding a log printing the title before this line, the title seems to always be lowercase.
So, is the title supposed to be converted to all lowercase at some point? Preferably the title would be passed through without modification, though I can understand changing an all lowercase or all uppercase title.