drop DOC and LIT from the pipeline (deliberately unsupported)
.IMAGE — extensions removed from AllowedExtensions (scan gate), bookExtensions, MimeTypes and sync/format.go maps: .doc/.lit files are no longer scanned or indexed. classifyFormatGroup gains the RTF and PDB reflowable arms that were missing when those rungs shipped (rows only reclassify on creation). Scanner docs updated. DOC + LIT have no credible JS tooling (mammoth is docx-only; LIT needs LZX and its DRM variants are dead) and text-extraction-only support would misrepresent what the reader can do. Verified: probe .doc/.lit files watched but never scanned; probe .txt control scanned; TestClassifyFormatGroup extended and passing. Docs change granted in-session by the user (extensions + format docs).
This commit is contained in:
@@ -30,7 +30,7 @@ const (
|
||||
)
|
||||
|
||||
var AllowedExtensions = map[string][]string{
|
||||
LibraryTypeEbooks: {".epub", ".pdf", ".mobi", ".azw", ".azw3", ".txt", ".rtf", ".doc", ".docx", ".lit", ".fb2", ".pdb"},
|
||||
LibraryTypeEbooks: {".epub", ".pdf", ".mobi", ".azw", ".azw3", ".txt", ".rtf", ".docx", ".fb2", ".pdb"},
|
||||
LibraryTypeComics: {".cbz", ".cbr", ".cb7", ".cbt", ".epub", ".pdf"},
|
||||
LibraryTypeManga: {".cbz", ".cbr", ".epub", ".pdf", ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".webp", ".avif", ".tiff", ".tif"},
|
||||
}
|
||||
@@ -59,9 +59,7 @@ var MimeTypes = map[string]string{
|
||||
".azw3": "application/vnd.amazon.ebook",
|
||||
".txt": "text/plain",
|
||||
".rtf": "application/rtf",
|
||||
".doc": "application/msword",
|
||||
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
".lit": "application/x-msreader",
|
||||
".fb2": "application/x-fictionbook+xml",
|
||||
".pdb": "application/vnd.palm",
|
||||
}
|
||||
|
||||
@@ -662,8 +662,8 @@ func (s *MediaScanner) extractFolderStructureMetadata(path, rootFolder string) *
|
||||
|
||||
var bookExtensions = map[string]bool{
|
||||
".epub": true, ".pdf": true, ".mobi": true, ".azw": true, ".azw3": true,
|
||||
".fb2": true, ".txt": true, ".rtf": true, ".doc": true, ".docx": true,
|
||||
".lit": true, ".pdb": true, ".djvu": true,
|
||||
".fb2": true, ".txt": true, ".rtf": true, ".docx": true,
|
||||
".pdb": true, ".djvu": true,
|
||||
".cbz": true, ".cbr": true, ".cb7": true, ".cbt": true,
|
||||
}
|
||||
|
||||
@@ -3873,7 +3873,7 @@ func classifyFormatGroup(ext string, epubIsFixedLayout bool) (formatGroup string
|
||||
return "fixed_layout", false, true
|
||||
}
|
||||
return "reflowable", true, false
|
||||
case ".mobi", ".azw", ".azw3", ".fb2", ".txt", ".docx":
|
||||
case ".mobi", ".azw", ".azw3", ".fb2", ".txt", ".docx", ".rtf", ".pdb":
|
||||
return "reflowable", true, false
|
||||
case ".pdf", ".djvu":
|
||||
return "fixed_layout", false, true
|
||||
|
||||
@@ -135,6 +135,8 @@ func TestClassifyFormatGroup(t *testing.T) {
|
||||
{"FB2", ".fb2", false, "reflowable", true, false},
|
||||
{"TXT", ".txt", false, "reflowable", true, false},
|
||||
{"DOCX (was unknown before the fix)", ".docx", false, "reflowable", true, false},
|
||||
{"RTF", ".rtf", false, "reflowable", true, false},
|
||||
{"PDB (PalmDOC)", ".pdb", false, "reflowable", true, false},
|
||||
{"PDF", ".pdf", false, "fixed_layout", false, true},
|
||||
{"DJVU", ".djvu", false, "fixed_layout", false, true},
|
||||
{"CBZ", ".cbz", false, "comic_archive", false, true},
|
||||
|
||||
@@ -30,9 +30,7 @@ var mimeTypes = map[string]string{
|
||||
".fb2": "application/x-fictionbook+xml",
|
||||
".txt": "text/plain",
|
||||
".rtf": "application/rtf",
|
||||
".doc": "application/msword",
|
||||
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
".lit": "application/x-ms-reader",
|
||||
".pdb": "application/vnd.palm",
|
||||
".prc": "application/vnd.palm",
|
||||
}
|
||||
@@ -46,9 +44,7 @@ var ReflowableFormats = map[string]bool{
|
||||
".fb2": true,
|
||||
".txt": true,
|
||||
".rtf": true,
|
||||
".doc": true,
|
||||
".docx": true,
|
||||
".lit": true,
|
||||
".pdb": true,
|
||||
".prc": true,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user