mdhiggins / radarr-sma

MIT License
25 stars 13 forks source link

isValidSource unexpectedly threw an exception #12

Closed steve1977 closed 4 years ago

steve1977 commented 4 years ago

I configured the script based on radarr rename. It may well be a user mistake, but I cannot figure out what I am doing wrong. Please see error below from the radarr debug log:

7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - RadarrPostProcess - INFO - Radarr extra script post processing started.
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - resources.readsettings - INFO - /usr/bin/python3
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - resources.readsettings - WARNING - Force-convert is true, so convert-mp4 is being overridden to true as well
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - resources.mediaprocessor - ERROR - isValidSource unexpectedly threw an exception, returning None
7/30/2020 2:30:29 AM - Standard - Traceback (most recent call last):
7/30/2020 2:30:29 AM - Standard -   File "/usr/local/sma/resources/mediaprocessor.py", line 258, in isValidSource
7/30/2020 2:30:29 AM - Standard -     extension = self.parseFile(inputfile)[2]
7/30/2020 2:30:29 AM - Standard -   File "/usr/local/sma/resources/mediaprocessor.py", line 1417, in parseFile
7/30/2020 2:30:29 AM - Standard -     path = os.path.abspath(path)
7/30/2020 2:30:29 AM - Standard -   File "/usr/lib/python3.8/posixpath.py", line 374, in abspath
7/30/2020 2:30:29 AM - Standard -     path = os.fspath(path)
7/30/2020 2:30:29 AM - Standard - TypeError: expected str, bytes or os.PathLike object, not NoneType
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - resources.mediaprocessor - INFO - File None is not valid
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - RadarrPostProcess - INFO - Processing returned False.
7/30/2020 2:30:29 AM - Standard - 2020-07-30 10:30:29 - RadarrPostProcess - ERROR - Error processing file
7/30/2020 2:30:29 AM - Standard - Traceback (most recent call last):
7/30/2020 2:30:29 AM - Standard -   File "/usr/local/sma/postRadarr.py", line 153, in <module>
7/30/2020 2:30:29 AM - Standard -     sys.exit(1)
7/30/2020 2:30:29 AM - Standard - SystemExit: 1
mdhiggins commented 4 years ago

The script requires a moviefile path which is only provided on the On Download / On Upgrade events. On rename is not a valid event to call the script from and you're getting "None" for that required value as a result

https://github.com/Radarr/Radarr/wiki/Custom-Post-Processing-Scripts

steve1977 commented 4 years ago

Any chance to add a feature request to run the scrip on rename as well? Or a technical limitation of the API?

mdhiggins commented 4 years ago

API doesn't provide enough data

steve1977 commented 4 years ago

Thanks. I could ask the Radarr gang on Discocrd / Github whether they can make this available on the API. Could you let me know what info would need to be made available?

I am still trying to find a way to convert & tag my existing library (and ideally different based on tag).