feat(OpdsFeedService): detect ZIP mime type for FB2 files when zipped (#2242)

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
Balázs Szücs
2026-01-12 17:01:22 -07:00
committed by GitHub
parent 64f036fb71
commit 9761c0e9b6
2 changed files with 25 additions and 1 deletions
@@ -607,7 +607,15 @@ public class OpdsFeedService {
return switch (book.getBookType()) {
case PDF -> "application/pdf";
case EPUB -> "application/epub+zip";
case FB2 -> "application/x-fictionbook+xml";
case FB2 -> {
if (book.getFileName() != null) {
ArchiveUtils.ArchiveType type = ArchiveUtils.detectArchiveType(new File(FileUtils.getBookFullPath(book)));
if (type == ArchiveUtils.ArchiveType.ZIP) {
yield "application/zip";
}
}
yield "application/x-fictionbook+xml";
}
case CBX -> {
if (book.getArchiveType() != null) {
yield switch (book.getArchiveType()) {