Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for error: No such file or directory (os error 2) #20

Open
lescx opened this issue May 2, 2024 · 1 comment
Open

Comments

@lescx
Copy link

lescx commented May 2, 2024

I try to rename episode names of a series using a JSON map.

When running nomino, it returns the following error:

$ nomino -ktmp renamed.json 
error: No such file or directory (os error 2)

I cannot debug where the actual issue is. I would like a more verbose error message.

episodes.json
{
 "Season 01/Episode 01.mp4": "Season01/Episode 01 - Echoes of Thunder.mp4",
 "Season 01/Episode 02.mp4": "Season 01/Episode 02 - What Is Done.mp4",
 "…": "…",
 "Season 05/Episode 09.mp4": "Season05/Episode 09 - Infantis Sanguine.mp4"
}
╭─[/mnt/Series/The Dragon Prince]
╰──╼ls
 renamed.json  'Season 01'  'Season 02'  'Season 03'  'Season 04'  'Season 05'
╭─[/mnt/Series/The Dragon Prince]
╰──╼ls Season\ 01/
'Episode 01.mp4'  'Episode 02.mp4'  'Episode 03.mp4'  'Episode 04.mp4'  'Episode 05.mp4'  'Episode 06.mp4'  'Episode 07.mp4'  'Episode 08.mp4'  'Episode 09.mp4'   Subs

OS: Debian 12
nomino: v.1.3.4

@lescx
Copy link
Author

lescx commented May 2, 2024

Or another example I encountered:

nomino -pe "Season .*/.*S(\d+)E(\d+) \- (\w+.*) \(.*" "Season {:2}/Episode {:2} - {}"                                                                                                
[error] unable to rename 'Season 2/Avatar The Last Airbender (2005) - S02E05 - Avatar Day (1080p WEB-DL x265 RCVR).mkv': No such file or directory (os error 2)                          
[error] unable to rename 'Season 2/Avatar The Last Airbender (2005) - S02E10 - The Library (1080p WEB-DL x265 RCVR).mkv': No such file or directory (os error 2)                         
[error] unable to rename 'Season 2/Avatar The Last Airbender (2005) - S02E17 - Lake Laogai (1080p WEB-DL x265 RCVR).mkv': No such file or directory (os error 2)
…
$ ls
'Season 1'  'Season 2'  'Season 3'
$ ls Season\ 1/
'Avatar The Last Airbender (2005) - S01E01 - The Boy in the Iceberg (1080p WEB-DL x265 RCVR).mkv'
'Avatar The Last Airbender (2005) - S01E02 - The Avatar Returns (1080p WEB-DL x265 RCVR).mkv'
'Avatar The Last Airbender (2005) - S01E03 - The Southern Air Temple (1080p WEB-DL x265 RCVR).mkv'
'Avatar The Last Airbender (2005) - S01E04 - The Warriors of Kyoshi (1080p WEB-DL x265 RCVR).mkv'

Still, it seems to work when I test it.

nomino -pet "Season .*/.*S(\d+)E(\d+) \- (\w+.*) \(.*" "Season {:2}/Episode {:2} - {}"
| Season 1/Avatar The Last Airbender (2005) - S01E01 - The Boy in the Iceberg (1080p WEB-DL x265 RCVR).mkv               | Season 01/Episode 01 - The Boy in the Iceberg.mkv               |
| Season 1/Avatar The Last Airbender (2005) - S01E02 - The Avatar Returns (1080p WEB-DL x265 RCVR).mkv                   | Season 01/Episode 02 - The Avatar Returns.mkv                   |
| Season 1/Avatar The Last Airbender (2005) - S01E03 - The Southern Air Temple (1080p WEB-DL x265 RCVR).mkv              | Season 01/Episode 03 - The Southern Air Temple.mkv              |
| Season 1/Avatar The Last Airbender (2005) - S01E04 - The Warriors of Kyoshi (1080p WEB-DL x265 RCVR).mkv               | Season 01/Episode 04 - The Warriors of Kyoshi.mkv               |

In this case I know I should add the -k parameter. We could add an error message like: Please add -k parameter. Adding the -k parameter in the first example does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant