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

Renamer: <baseFileName> includes File Extension (.mkv) #1846

Open
2 tasks
hologarden opened this issue Jan 21, 2025 · 5 comments
Open
2 tasks

Renamer: <baseFileName> includes File Extension (.mkv) #1846

hologarden opened this issue Jan 21, 2025 · 5 comments

Comments

@hologarden
Copy link

Describe the bug
See title.

To Reproduce
Steps to reproduce the behavior:

  1. Find unfulfilled movie with no data
  2. 'Load information' > follow through with saving metadata
  3. Save metadata using 'Save' button
  4. NFO and images renamed with movie title ie. 映画 聲の形 (2016).mkv.nfo instead of 映画 聲の形 (2016).nfo

Expected behavior
See step 4 of reproduction.

Screenshots
If applicable, add screenshots to help explain your problem.

MediaElch Version:

  • 2.12.0 (stable)

Operating System:

  • Windows

Additional context
I have only recently updated to 2.12.0, though I don't know what previous version I had. This behavior is either newly intended or unintentional, but either way Jellyfin does not like it and it has messed with applying metadata to new entries.

@hologarden
Copy link
Author

hologarden commented Jan 21, 2025

Would also like to add that i've used linuxserver/docker-mediaelch as well to see if this particularly pertains to Windows 11, however it is replicable there as well under the same conditions.

In my particular case, I have multiple versions of a film: US and Japanese. Here, the Japanese version has full metadata, but neither Windows nor Docker versions recognize the JP version, though they have previously merged under one entry (Pokemon 3, with a dropdown showing US and JP filepaths)

The scanner for MediaElch correctly correlates the US and JP versions together, however shows the filepath for the US version. When saving, it saves the metadata for the JP release.

For example:

Image

Image

@bugwelle bugwelle added the bug label Jan 25, 2025
@bugwelle bugwelle added this to the v2.12.2 milestone Jan 25, 2025
@bugwelle
Copy link
Collaborator

Hi,

thanks for reporting!

I can't reproduce it (yet). Could you tell me more about your file names and post them here? Do you separate your movies by folders?

Your screenshot in your second post does not have the issue your described in your first one.

Does your movie's filename have another extension such as movie-title.mkv.mkv? On Windows, you have to explicitly enable file extensions to be shown (but looking at your screenshot, you've already done that).

The logic for the "baseFileName" relies on Qt, the UI framework we use. It uses completeBaseName() which strips the filename. I currently do not see how an extension can up in the NFO's filename.

Regards,

Andre

@hologarden
Copy link
Author

Sorry for the confusion, the files you see in my second comment were manually edited to remove the .mkv append that the issue relates to.

Do you separate your movies by folders?

Yes, as so:
Image

Does your movie's filename have another extension such as movie-title.mkv.mkv? On Windows, you have to explicitly enable file extensions to be shown (but looking at your screenshot, you've already done that).

As you can guess, yes, for this specific reason I have enabled it in Windows to ensure that this doesn't happen but also to make filetypes transparent without relying on Explorer itself to guess what it is (sometimes it applies, for example 'Adobe Acrobat PDF' if Acrobat is installed instead of just 'PDF')

Here is a previously saved film, por example:

Image

And its files, from when they were added to ME:

Image

I'm not familiar with Qt, however it is strange the issue is replicable for me both on Windows and Linux (through linuxserver/docker-mediaelch). After some testing though, I introduce a strange problem that amends it:

By isolating the film, on my Desktop in a folder named _test, with it's own folder, making the filepath:
C:\Users\leader\Desktop\_test\劇場版ポケットモンスター 結晶塔の帝王 ENTEI (2000)

MediaElch successfully writes the new metadata without the file extension appended.

Image

So perhaps this is related to filepath length somehow?

@hologarden
Copy link
Author

Ah, I've found the exact issue at hand, which relates to multiple film versions.

When removing the second version (which is what MediaElch first displays, as below), this is the output:
Image
Image

When adding the second version back into the directory:
Image
Image

So at the end of the day this is technically user error, however what would be the best way to amend this? Is it intended behavior by MediaElch to make the metadata unique for each version (even though it displays the US Release first)?

@bugwelle
Copy link
Collaborator

Oh, wow!

Thank you very much for reproducing the issue!

mkdir my-movie && cd $_
touch my-movie-us.mkv my-movie-jap.mkv
  1. Reload movies
  2. Select "my-movie"
  3. load some data
  4. save
  5. See invalid filenames:
.
├── my-movie-jap.mkv
├── my-movie-jap.mkv-banner.jpg
├── my-movie-jap.mkv-clearart.png
├── my-movie-jap.mkv-clearlogo.png
├── my-movie-jap.mkv-discart.png
├── my-movie-jap.mkv-fanart.jpg
├── my-movie-jap.mkv-landscape.jpg
├── my-movie-jap.mkv.nfo
├── my-movie-jap.mkv-poster.jpg
└── my-movie-us.mkv

@hologarden In my opinion, this is a bug. Interestingly, there is a TODO note in the code about file extensions, where I've linked to #1175

That means I will have to double check the logic and will need to check that I don't introduce an old bug again.
If I fix the issue, it could be that banners and other files are no longer found, hence I need to be careful.

There is currently nothing you can do.

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

No branches or pull requests

2 participants