Komet / MediaElch

Media Manager for Kodi
https://mediaelch.github.io/mediaelch-doc/about.html
GNU Lesser General Public License v3.0
831 stars 93 forks source link

Placeholders not replaced on file renaming #562

Open Extarys opened 6 years ago

Extarys commented 6 years ago

Renaming files:

Input: <showTitle> - S<season>E<episode> - <title>.<extension>
Return: My TV Show - S01E01 - Pilot.mkv

This is ok. But the following doesn't work.

Input: <showTitle> - S<season>E<episode> - <title> (<resolution> <videoCodec> <audioCodec>).<extension>
Return: My TV Show - S01E01 - Pilot (SD  ).mkv

File is 1080p HEVC h265 with eac3 audio 5.1 channels

Season directory:

Input: <showTitle> - Season <season> (<resolution> <videoCodec> <audioCodec> <channels>)
Return: showTitle - Season 01 (resolution videoCodec audioCodec channels).mkv

I can understand why in season directory the video codec and resolution for example wouldn't work (even though it would be great), but the showTitle should definitely work.

.sub, .idx and .srt files doesn't seem to be renamed either and I had to rename them manually.

EDIT: I saw the merge about showTitle in season directory, nice!

bugwelle commented 6 years ago

Thanks for reporting this. The showTitle bug has been resolved in #559 . It fixes #553

The movie is saved and stream details are loaded correctly?Then it's a bug. I can't fully reproduce this but <audioCodec> doesn't work for me either. Will have to look into this deeper.

resolution isn't supported for season directories for obvious reasons :-)

bugwelle commented 6 years ago

Ok, found it. Only following audio codecs are supported:

    m_hdAudioCodecs{"dtshd_ma", "dtshd_hra", "truehd"},
    m_normalAudioCodecs{"DTS", "dts", "ac3", "eac3", "flac"},
    m_sdAudioCodecs{"mp3"}

See: https://github.com/Komet/MediaElch/blob/master/data/StreamDetails.cpp#L35

I don't know the reasoning behind that, yet...

Extarys commented 6 years ago

Thanks for confirming that. I will test with other files to see when this happens.

Maybe for seasons it would be nice to take the first episode's data to populate those tags. In my case all episodes of a specific season have all the same spec. I know it might not be the case for everyone and every situation but it would be better than not working, I think.

bugwelle commented 6 years ago

Sounds like a reasonable solution. :-)

I'm currently refactoring the renamer. It has become too big to manage, contained a lot of duplicated code and is really difficult to test (too tight coupling, depends on UI).
Some of my refactoring broke the renamer (it's fixed now) and I'm still not sure why it didn't work as expected. What I'm trying to say: I will implement this feature but only after I've refactored the renamer and have written tests for it so that I can be sure that I won't break anything. Then I'll look into this again. :smiley:

Extarys commented 6 years ago

Sounds resonable, thanks @bugwelle , and good luck. :smile_cat:

saperlot commented 3 months ago

This bug seems related to what i have seen. The mediainfo on many files of mine is just unable to get the information resulting in showing no info icons next to the title. The renamer want to rename these files as just "SD" and this part should look like .. with MediaInfo-gui i can't realy spot any difference between those files which works and such that don't.