refactor: centralize globalKey construction via buildGlobalKey()
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'mixins/multi_server_fields.dart';
|
||||
import '../utils/global_key_utils.dart';
|
||||
|
||||
part 'plex_library.g.dart';
|
||||
|
||||
@@ -26,7 +27,7 @@ class PlexLibrary with MultiServerFields {
|
||||
final String? serverName;
|
||||
|
||||
/// Global unique identifier across all servers (serverId:key)
|
||||
String get globalKey => serverId != null ? '$serverId:$key' : key;
|
||||
String get globalKey => serverId != null ? buildGlobalKey(serverId!, key) : key;
|
||||
|
||||
PlexLibrary({
|
||||
required this.key,
|
||||
|
||||
@@ -4,6 +4,7 @@ import '../services/settings_service.dart' show EpisodePosterMode;
|
||||
import '../widgets/plex_optimized_image.dart' show kBlurArtwork, obfuscateText;
|
||||
import 'mixins/multi_server_fields.dart';
|
||||
import 'plex_role.dart';
|
||||
import '../utils/global_key_utils.dart';
|
||||
|
||||
part 'plex_metadata.g.dart';
|
||||
|
||||
@@ -111,7 +112,7 @@ class PlexMetadata with MultiServerFields {
|
||||
final String? clearLogo;
|
||||
|
||||
/// Global unique identifier across all servers (serverId:ratingKey)
|
||||
String get globalKey => serverId != null ? '$serverId:$ratingKey' : ratingKey;
|
||||
String get globalKey => serverId != null ? buildGlobalKey(serverId!, ratingKey) : ratingKey;
|
||||
|
||||
/// Parsed media type enum for type-safe comparisons
|
||||
PlexMediaType get mediaType {
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import '../widgets/plex_optimized_image.dart' show kBlurArtwork, obfuscateText;
|
||||
import 'mixins/multi_server_fields.dart';
|
||||
import '../utils/global_key_utils.dart';
|
||||
|
||||
part 'plex_playlist.g.dart';
|
||||
|
||||
@@ -65,7 +66,7 @@ class PlexPlaylist with MultiServerFields {
|
||||
bool get isEditable => !smart;
|
||||
|
||||
/// Get globally unique key across all servers
|
||||
String get globalKey => serverId != null ? '$serverId:$ratingKey' : ratingKey;
|
||||
String get globalKey => serverId != null ? buildGlobalKey(serverId!, ratingKey) : ratingKey;
|
||||
|
||||
// Properties for MediaCard compatibility with PlexMetadata interface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user