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

[Issue]: Wrong MIME type returned for different comic book formats #11009

Closed
1 task done
rluetzner opened this issue Feb 14, 2024 · 4 comments · Fixed by #11010
Closed
1 task done

[Issue]: Wrong MIME type returned for different comic book formats #11009

rluetzner opened this issue Feb 14, 2024 · 4 comments · Fixed by #11010
Labels
bug Something isn't working

Comments

@rluetzner
Copy link
Contributor

Please describe your bug

As described in jellyfin/jellyfin-plugin-opds#38 , I noticed that the current MIME type implementation does not account for different comic book formats. It will always return application/x-cbr.

Sadly cbr (a.k.a. Rar) is a proprietary compression algorithm, so most FOSS eReaders won't be able to download or display such files.

I couldn't pinpoint the exact place where this goes wrong, but I noticed that this case is not covered by the tests in MimeTypeTests.cs. However, I also couldn't find a place where x-cbr is explicitly set, so I'm still not sure where this bug is coming from.

Reproduction Steps

Is reproducible by adding cbr and cbz to the MimeTypesTests class like this:

        [InlineData(".cbr", "application/x-cbr")]
        [InlineData(".cbz", "application/x-cbz")]
[xUnit.net 00:00:00.73]     Jellyfin.Model.Tests.Net.MimeTypesTests.GetMimeType_Valid_ReturnsCorrectResult(input: ".cbz", expectedResult: "application/x-cbz") [FAIL]
  Fehler Jellyfin.Model.Tests.Net.MimeTypesTests.GetMimeType_Valid_ReturnsCorrectResult(input: ".cbz", expectedResult: "application/x-cbz") [1 ms]
  Fehlermeldung:
   Assert.Equal() Failure: Strings differ
                           ↓ (pos 16)
Expected: "application/x-cbz"
Actual:   "application/x-cbr"
                           ↑ (pos 16)

Jellyfin Version

10.8.13

if other:

No response

Environment

- OS:
- Linux Kernel:
- Virtualization:
- Clients:
- Browser:
- FFmpeg Version:
- Playback Method:
- Hardware Acceleration:
- GPU Model:
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

-

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rluetzner rluetzner added the bug Something isn't working label Feb 14, 2024
@nielsvanvelzen
Copy link
Member

You can look at #10980 to see how to update the mime type mappings.

@rluetzner
Copy link
Contributor Author

Thanks @nielsvanvelzen . I'll get to work, depending on the answer I get to khellang/MimeTypes#23 . 🙂

It's actually a bug in the MimeTypes package Jellyfin uses, so I'd rather have it fixed there and have other projects benefit from this as well.

Thanks for the quick response.

@felix920506
Copy link
Member

I think you would get a quicker fix by fixing it on the JF side, given that the last commit on upstream is from 9 months ago

@rluetzner
Copy link
Contributor Author

Thanks for the advice @felix920506 . I did both. 🙂

Issue Triage for Main Repo automation moved this from Needs triage to Closed/Done Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants