Files
plezy/lib/media/media_stream.dart
edde746 fc061dc38d refactor(media): merge the two MediaStreamKind enums into one shared enum
lib/media declared two different enums named MediaStreamKind — a 4-value one in media_stream.dart and a 7-value one in media_file_info.dart — so any file importing both libraries silently picked one by import order.

media_stream.dart's enum now carries the full member set (image/data/lyric added before unknown; the original four ordinals are preserved) and media_file_info.dart re-exports it instead of declaring its own.
2026-08-16 16:48:01 +02:00

55 lines
1.3 KiB
Dart

/// Type of an embedded or sidecar stream within a media file.
enum MediaStreamKind { video, audio, subtitle, image, data, lyric, unknown }
/// A single audio, video, or subtitle stream inside a media part.
class MediaStream {
/// Backend-opaque stream identifier.
final String id;
final MediaStreamKind kind;
final int? index;
final String? codec;
final String? language;
final String? languageCode;
final String? title;
final String? displayTitle;
final bool selected;
// Audio
final int? channels;
// Video
final double? frameRate;
final bool hdr;
final bool dolbyVision;
final int? dolbyVisionProfile;
// Subtitle
final bool forced;
/// Backend-resolved location for true sidecar subtitle download. Null for
/// embedded streams, even when Jellyfin can expose them through temporary
/// external delivery URLs during playback negotiation.
final String? sidecarPath;
const MediaStream({
required this.id,
required this.kind,
this.index,
this.codec,
this.language,
this.languageCode,
this.title,
this.displayTitle,
this.selected = false,
this.channels,
this.frameRate,
this.hdr = false,
this.dolbyVision = false,
this.dolbyVisionProfile,
this.forced = false,
this.sidecarPath,
});
bool get isExternal => sidecarPath != null && sidecarPath!.isNotEmpty;
}