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:
+9
-1
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user