jkwill87 / mnamer

media file renaming and organizing tool
https://pypi.org/project/mnamer
MIT License
750 stars 63 forks source link

Incorrect capitalization #297

Open pustinov88 opened 1 month ago

pustinov88 commented 1 month ago

I am trying to use mnamer to rename TV episodes. By coincidence, the first shows I tried to rename showed a problem with capitalization.

Example 1: NCIS - mnamer changes it to Ncis Example 2: Ghosts (US) - mnamer changes it to Ghosts (Us)

I expect shows like FBI or even ones with more fancy spelling will show similar issues, not even talking about titles. As far as I can tell, there is no way to get mnamer to use the name as retrieved from the provider (tvdb / tvmaze), or did I miss anything? Shouldn't these sources give the best indication on how to capitalize the show titles and episode names?

pustinov88 commented 1 month ago

Okay, https://github.com/jkwill87/mnamer/blob/main/mnamer/utils.py#L335 seems to cover FBI and CSI. It does show however that this is not a scalable solution, as e.g. adding US to it would break shows like The Last of Us.

Another annoying issue is with shows like M.A.S.H. or S.W.A.T. where the a is forced to be lowercase, making the show title S.W.a.T. during rename.

pustinov88 commented 1 month ago

Changing str_title_case to always return s immediately (i.e., skipping to "intelligently apply title case transformations to strings") fixes the immediate problem for me. The shows I renamed so far where all correct, whereas with the transformation there would have been various issues (e.g., https://www.tvmaze.com/episodes/2781751/swat-7x10-snafu).