diff --git a/internal/home/discover.go b/internal/home/discover.go index d929db9..6dbdf1f 100644 --- a/internal/home/discover.go +++ b/internal/home/discover.go @@ -385,6 +385,10 @@ func kindNoun(kind string) string { return "photos" case "games": return "games" + case "movies", "adult", "hentai", "video": + return "films" + case "tv": + return "shows" default: return strings.ReplaceAll(kind, "-", " ") } diff --git a/internal/jellyfin/dto/dto.go b/internal/jellyfin/dto/dto.go index 14b09ef..ce99aab 100644 --- a/internal/jellyfin/dto/dto.go +++ b/internal/jellyfin/dto/dto.go @@ -257,8 +257,10 @@ func CollectionType(kind string) string { switch kind { case "series": return "tvshows" - case "video": + case "video", "movies", "adult", "hentai": return "movies" + case "tv": + return "tvshows" case "audiobooks", "music": return "music" case "photos": diff --git a/internal/scanner/scan.go b/internal/scanner/scan.go index 0357559..d7dcae3 100644 --- a/internal/scanner/scan.go +++ b/internal/scanner/scan.go @@ -742,7 +742,10 @@ func upsertGroup(ctx context.Context, tx *sql.Tx, lib library.Library, g group, func upsertItem(ctx context.Context, tx *sql.Tx, lib library.Library, g group, parentID int64) (int64, error) { kind := g.kind if kind == "" { - kind = lib.Kind + // The group always carries a kind; this is the belt-and-braces path. It + // resolves through ItemKindFor so a video library stores 'video' rather + // than its own name, which is what every query for playable video asks. + kind = library.ItemKindFor(lib.Kind) } var season, episode any if g.season > 0 { @@ -971,9 +974,16 @@ func probeBatch(ctx context.Context, lib library.Library, groups map[string]grou // probeable reports whether a library kind holds files worth probing for codec // facts. Only video and the audio kinds have media streams; ebooks, comics, -// photos, and games are never probed. -func probeable(kind string) bool { - switch kind { +// photos and games are never probed. +// +// The test is on the kind its ROWS carry, not on the library's own kind. Every +// video library stores 'video' (library.MediaType.ItemKind), so a movies, tv, +// adult or hentai library is probed exactly like the original video kind was. +// Comparing the library kind against a list was how splitting the video kinds +// silently stopped probing them, and with no codec facts resolve cannot tell an +// unplayable file from a playable one. +func probeable(libKind string) bool { + switch library.ItemKindFor(libKind) { case "video", "audiobooks", "music": return true default: