SpykerNZ / one-pace-for-plex

This project helps adapt One Pace to a format plex can read.
79 stars 9 forks source link

File renaming Option A - Windows Executable does nothing to the "Specials" #50

Closed TheOne320 closed 2 months ago

TheOne320 commented 4 months ago

Like the title says. The windows executable rename.exe renamed everything except for the files in the "Specials" folder. They were completely ignored. I renamed them by hand.

SpykerNZ commented 3 months ago

We are currently not handling the specials. Anyone could look at adding these but I don't have the time currently.

TheIceCreamTroll commented 2 months ago

We are currently not handling the specials. Anyone could look at adding these but I don't have the time currently.

I took a look at this, and the main issue is that the renaming process is centered around matching an NFO file to a video file via an episode number, which isn't in the filenames of the specials. One workaround could be to use the <original_filename> XML tag. If you think that's a solid option @SpykerNZ I can throw something together, just want to run it by you before I spend time on it.

SpykerNZ commented 2 months ago

Surely the easiest solution here is to just add them as exceptions? I don't think there are many of them.

TheIceCreamTroll commented 2 months ago

Oop, absolutely correct. Got a little ahead of myself while working on it last night. Using exceptions works, but the code needs a slight adjustment.

Currently, folders are iterated through using

for season_no in seasons.values():    
    season_name = f"Season {season_no}"
    season_folder = Path(show_dir / season_name)
    media_files = list(season_folder.rglob(f"*{MKV_EXT}")) + list(season_folder.rglob(f"*{MP4_EXT}"))

Since season_no is "Specials" (read from seasons.json) the glob ends up looking for files in One Pace/Season Specials, and fails.

This is a relatively easy fix though. I'll throw together a PR in a minute #61