fix(ui): hide Comic/Manga editor section for non-comics media

The metadata editor's Comic/Manga section (Manga Type, Reading
Direction, Age Rating, Story Arc, Imprint, Scan Info, Metadata
Notes, B&W) rendered for every item — an audiobook showed a manga
dropdown, which is nonsense.

MediaDetail now carries LibraryTypeName (resolved via
GetLibraryType in the /media/:uuid handler) and a
ShowComicMetadata() gate: comics and manga libraries always show the
section; other media only when the scanner recorded comic-style
values (fixed-layout manga-style EPUBs get those scanner defaults
deliberately — when present they stay editable).
This commit is contained in:
John O'Keefe committed 2026-10-25 12:08:26 -04:00
1 parent ab2a5568ae
commit d41c3e4774
4 files changed
+249 -217

No files matched your search

+7
View File
@@ -1712,6 +1712,12 @@ func registerFrontendRoutes(cfg *Config) {
}
// Assemble response (no field duplication!)
libraryTypeName := ""
if lib, lerr := cfg.Queries.GetLibrary(c.Request().Context(), mediaItem.LibraryID); lerr == nil {
if lt, terr := cfg.Queries.GetLibraryType(c.Request().Context(), lib.LibraryTypeID); terr == nil {
libraryTypeName = lt.Name
}
}
detail := handlers.MediaDetail{
MediaItems: mediaItem, // Embedded - ALL fields available
FileLocation: fileLocation,
@@ -1720,6 +1726,7 @@ func registerFrontendRoutes(cfg *Config) {
Collections: collections,
ReadingProgress: progress,
BookStats: bookStats,
LibraryTypeName: libraryTypeName,
ActiveConflict: activeConflict,
NotesCount: len(notes),
HighlightsCount: len(highlights),