Unmanic / unmanic

Unmanic - Library Optimiser
GNU General Public License v3.0
1.41k stars 84 forks source link

Folder Structure With Year Of Release In Brackets Throws An Error On Re-Processing Attempt #438

Open irishj opened 5 months ago

irishj commented 5 months ago

Description

Attempting to re-add a failed task back to the pending queue returns an error in the UI and in the "tornado.log" file.

ApiHistoryHandler.add_completed_tasks_to_pending_list: Path does not exist - '/media/tv/HD/For All Mankind (2019)/S04/For All Mankind (2019).S04E04.House Divided.WEBDL-1080p.EAC3 Atmos.5.1.-NHTFS.mkv'

500 POST /unmanic/api/v2/history/reprocess (192.168.0.65) 1.14ms

Logging into the docker container and manually navigating to the directory works fine and I can see the file it's attempting to re-process.

root@ANUBIS:/# cd /media
root@ANUBIS:/media# cd tv
root@ANUBIS:/media/tv# cd HD
root@ANUBIS:/media/tv/HD# cd "For All Mankind (2019)"
root@ANUBIS:/media/tv/HD/For All Mankind (2019)# cd S04
root@ANUBIS:/media/tv/HD/For All Mankind (2019)/S04# ls
'For All Mankind (2019).S04E01.Glasnost.WEBDL-1080p Proper.AC3.5.1.-HiggsBoson.mk v'
'For All Mankind (2019).S04E01.Glasnost.WEBDL-1080p Proper.AC3.5.1.-HiggsBoson.nf o'
'For All Mankind (2019).S04E02.Have a Nice Sol.WEBDL-1080p.EAC3 Atmos.5.1.-NHTFS. mkv'
'For All Mankind (2019).S04E02.Have a Nice Sol.WEBDL-1080p.EAC3 Atmos.5.1.-NHTFS. nfo'
'For All Mankind (2019).S04E03.The Bear Hug.WEBDL-1080p.AC3.5.1.-ANESSE.mkv'
'For All Mankind (2019).S04E03.The Bear Hug.WEBDL-1080p.AC3.5.1.-ANESSE.nfo'
'For All Mankind (2019).S04E04.House Divided.WEBDL-1080p.-NHTFS.mkv'
'For All Mankind (2019).S04E04.House Divided.WEBDL-1080p.-NHTFS.nfo'
season.nfo
root@ANUBIS:/media/tv/HD/For All Mankind (2019)/S04# pwd
/media/tv/HD/For All Mankind (2019)/S04

The issue may be related to the show containing the year in brackets after the show title. When navigating here manually, I need to add apostrophe before and after the show name.

"For All Mankind (2019)"

If I attempt to navigate to the directory without the apostrophes an error is shown

bash: syntax error near unexpected token `('

Steps to Reproduce

  1. Create a folder with a tv shows year of release in the folder name
  2. Attempt to process the file and make it fail so it can be re-attempted
  3. Attempt to re-add it back into the pending queue and an error will be shown

Expected behavior:

The episode should be re-added back into the pending queue

Actual behaviour:

Am error is shown in the user UI and in the tornado.log file

Error in UI : An error was encountered while requesting the selected tasks be added to the pending tasks list

Error in log file : ApiHistoryHandler.add_completed_tasks_to_pending_list: Path does not exist / 500 POST /unmanic/api/v2/history/reprocess

Reproduces how often:

100%

Versions

Program Version : [0.2.4~7339f8b]

OS Version : 20.04.6 LTS (Focal Fossa) -- Docker

Installation Method Used

Docker

Additional Information

None