feat: respect per media language preference

This commit is contained in:
edde746
2025-11-14 22:27:12 +01:00
parent 173ab59007
commit a618218828
15 changed files with 407 additions and 71 deletions
+8
View File
@@ -38,6 +38,8 @@ class PlexMetadata {
final int? viewedLeafCount; // Number of watched episodes in a series/season
@JsonKey(name: 'Role')
final List<PlexRole>? role; // Cast members
final String? audioLanguage; // Per-media preferred audio language
final String? subtitleLanguage; // Per-media preferred subtitle language
// Transient field for clear logo (extracted from Image array)
String? _clearLogo;
@@ -75,6 +77,8 @@ class PlexMetadata {
this.leafCount,
this.viewedLeafCount,
this.role,
this.audioLanguage,
this.subtitleLanguage,
});
/// Create a copy of this metadata with optional field overrides
@@ -110,6 +114,8 @@ class PlexMetadata {
int? leafCount,
int? viewedLeafCount,
List<PlexRole>? role,
String? audioLanguage,
String? subtitleLanguage,
}) {
final copy = PlexMetadata(
ratingKey: ratingKey ?? this.ratingKey,
@@ -143,6 +149,8 @@ class PlexMetadata {
leafCount: leafCount ?? this.leafCount,
viewedLeafCount: viewedLeafCount ?? this.viewedLeafCount,
role: role ?? this.role,
audioLanguage: audioLanguage ?? this.audioLanguage,
subtitleLanguage: subtitleLanguage ?? this.subtitleLanguage,
);
// Preserve clearLogo
copy._clearLogo = _clearLogo;