feat(music): offer File Info on tracks and other file-backed items
The context menu only offered File Info for movies and episodes, so a track's path, container, and audio stream detail were unreachable even though both backends already answer getFileInfo for them. Gate the entry on the new MediaKind.hasFileInfo instead of a literal kind list: movies, episodes, tracks, and clips are leaf items with real files, while shows, seasons, artists, albums, collections, playlists, and folders carry no Media/MediaSources and would only ever produce the "not available" snackbar. Also fix the Plex stream classifier, which mapped streamType 4 to an embedded image although PlexStreamType.lyrics is 4. Only music tracks carry that type, so a track's lyric stream rendered under "Embedded Images" with the video field block. Type 5 was invented outright and is now unknown. close #1747
This commit is contained in:
@@ -546,12 +546,15 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
);
|
||||
}
|
||||
|
||||
// File Info (for episodes and movies). Backend-neutral — both
|
||||
// PlexClient and JellyfinClient implement [getFileInfo], reading
|
||||
// codec/stream metadata from `Media`/`MediaSources` respectively.
|
||||
// Hidden when the item has no backend marker so we don't fan out
|
||||
// to an arbitrary client.
|
||||
if (itemBackend != null && (mediaKind == MediaKind.episode || mediaKind == MediaKind.movie)) {
|
||||
// File Info — every file-backed leaf kind (movies, episodes, tracks,
|
||||
// clips). Backend-neutral: both PlexClient and JellyfinClient implement
|
||||
// [MediaServerClient.getFileInfo], reading codec/stream metadata from
|
||||
// `Media`/`MediaSources` respectively. Container kinds are excluded by
|
||||
// [MediaKind.hasFileInfo] because neither backend attaches media sources
|
||||
// to them — a show/season/album/artist entry would only ever produce the
|
||||
// "not available" snackbar. Hidden when the item has no backend marker
|
||||
// so we don't fan out to an arbitrary client.
|
||||
if (itemBackend != null && mediaKind != null && mediaKind.hasFileInfo) {
|
||||
menuActions.add(_MenuAction(value: 'fileinfo', icon: Symbols.info_rounded, label: t.mediaMenu.fileInfo));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user