refactor: remove unused convenience APIs
This commit is contained in:
@@ -118,13 +118,6 @@ class ConnectionRegistry {
|
||||
return all.whereType<PlexAccountConnection>().toList();
|
||||
}
|
||||
|
||||
/// All Jellyfin connections in insertion order. Symmetric helper to
|
||||
/// [listPlexAccounts].
|
||||
Future<List<JellyfinConnection>> listJellyfin() async {
|
||||
final all = await list();
|
||||
return all.whereType<JellyfinConnection>().toList();
|
||||
}
|
||||
|
||||
/// Lookup a [PlexAccountConnection] by id. Returns `null` if no row
|
||||
/// matches OR the row exists but isn't a Plex account.
|
||||
Future<PlexAccountConnection?> getPlexAccount(String id) async {
|
||||
@@ -132,13 +125,6 @@ class ConnectionRegistry {
|
||||
return c is PlexAccountConnection ? c : null;
|
||||
}
|
||||
|
||||
/// Lookup a [JellyfinConnection] by id. Returns `null` if no row matches
|
||||
/// OR the row exists but isn't a Jellyfin connection.
|
||||
Future<JellyfinConnection?> getJellyfin(String id) async {
|
||||
final c = await get(id);
|
||||
return c is JellyfinConnection ? c : null;
|
||||
}
|
||||
|
||||
Future<Connection?> _rowToConnection(ConnectionRow row) async {
|
||||
try {
|
||||
final json = jsonDecode(row.configJson) as Map<String, dynamic>;
|
||||
|
||||
@@ -47,32 +47,4 @@ class MediaLibrary {
|
||||
});
|
||||
|
||||
String get globalKey => serverId != null ? buildGlobalKey(ServerId(serverId!), id) : id;
|
||||
|
||||
MediaLibrary copyWith({
|
||||
String? id,
|
||||
MediaBackend? backend,
|
||||
String? title,
|
||||
MediaKind? kind,
|
||||
String? language,
|
||||
int? updatedAt,
|
||||
int? createdAt,
|
||||
bool? hidden,
|
||||
bool? isShared,
|
||||
String? serverId,
|
||||
String? serverName,
|
||||
}) {
|
||||
return MediaLibrary(
|
||||
id: id ?? this.id,
|
||||
backend: backend ?? this.backend,
|
||||
title: title ?? this.title,
|
||||
kind: kind ?? this.kind,
|
||||
language: language ?? this.language,
|
||||
updatedAt: updatedAt ?? this.updatedAt,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
hidden: hidden ?? this.hidden,
|
||||
isShared: isShared ?? this.isShared,
|
||||
serverId: serverId ?? this.serverId,
|
||||
serverName: serverName ?? this.serverName,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,6 @@ mixin ControllerDisposerMixin<T extends StatefulWidget> on State<T> {
|
||||
return controller;
|
||||
}
|
||||
|
||||
TextEditingController registerTextEditingController(TextEditingController controller) {
|
||||
_textEditingControllers.add(controller);
|
||||
return controller;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
for (final controller in _textEditingControllers.reversed) {
|
||||
|
||||
@@ -28,8 +28,4 @@ enum AudioQualityPreset {
|
||||
}
|
||||
return AudioQualityPreset.original;
|
||||
}
|
||||
|
||||
/// Order shared by every picker surface: [original] first, then capped
|
||||
/// presets highest-bitrate first.
|
||||
static final List<AudioQualityPreset> displayOrder = List.unmodifiable(values);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -66,11 +65,6 @@ class ExternalPlayer {
|
||||
if (customType != null) 'customType': customType == CustomPlayerType.urlScheme ? 'urlScheme' : 'command',
|
||||
};
|
||||
|
||||
String toJsonString() => json.encode(toJson());
|
||||
|
||||
static ExternalPlayer fromJsonString(String jsonString) =>
|
||||
ExternalPlayer.fromJson(json.decode(jsonString) as Map<String, dynamic>);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) || other is ExternalPlayer && runtimeType == other.runtimeType && id == other.id;
|
||||
|
||||
@@ -45,6 +45,4 @@ class SubtitleFontLoader {
|
||||
}
|
||||
|
||||
static String get fontName => _fontName;
|
||||
|
||||
static String get fontAssetPath => _fontAssetPath;
|
||||
}
|
||||
|
||||
@@ -47,12 +47,6 @@ sealed class AudioTrack with _$AudioTrack {
|
||||
static const off = AudioTrack(id: 'no', title: 'Off');
|
||||
|
||||
int? get channelsCount => channels;
|
||||
|
||||
String get displayName {
|
||||
if (title != null && title!.isNotEmpty) return title!;
|
||||
if (language != null && language!.isNotEmpty) return language!;
|
||||
return 'Track $id';
|
||||
}
|
||||
}
|
||||
|
||||
@freezed
|
||||
@@ -91,13 +85,6 @@ sealed class SubtitleTrack with _$SubtitleTrack {
|
||||
static const auto = SubtitleTrack(id: 'auto', title: 'Auto');
|
||||
|
||||
static const off = SubtitleTrack(id: 'no', title: 'Off');
|
||||
|
||||
String get displayName {
|
||||
if (title != null && title!.isNotEmpty) return title!;
|
||||
if (language != null && language!.isNotEmpty) return language!;
|
||||
if (isExternal) return 'External';
|
||||
return 'Track $id';
|
||||
}
|
||||
}
|
||||
|
||||
@Freezed(toStringOverride: false)
|
||||
|
||||
@@ -73,8 +73,6 @@ class JellyfinApiCache extends ApiCache {
|
||||
/// [ApiCache.isPinned]'s identical Dart signature.
|
||||
Future<bool> isPinnedItemId(ServerId serverId, String itemId) => hasPinnedMatching(_itemPattern(serverId, itemId));
|
||||
|
||||
Future<Set<String>> getPinnedItemIds(ServerId serverId) => extractPinnedIds(serverId, _itemKeyPattern);
|
||||
|
||||
/// Fetch and parse a [MediaItem] from cache.
|
||||
///
|
||||
/// Returns `null` when no matching row is cached, the row's JSON is
|
||||
|
||||
@@ -777,8 +777,6 @@ class PlexMetadataDto {
|
||||
|
||||
String get globalKey => serverId != null ? buildGlobalKey(ServerId(serverId!), ratingKey) : ratingKey;
|
||||
|
||||
bool get isLibrarySection => key != null && key!.startsWith('/library/sections/');
|
||||
|
||||
bool get isUnmatched => guid == null || guid!.isEmpty || guid!.contains(_unmatchedAgentMarker);
|
||||
|
||||
/// Top-level scalar fields surface as a plain Plex JSON map. Used by the
|
||||
|
||||
@@ -257,24 +257,6 @@ class ShaderAssetLoader {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pre-extract all shader files to the cache.
|
||||
/// Call this at startup to avoid extraction delay during playback.
|
||||
static Future<void> preloadShaders() async {
|
||||
try {
|
||||
await _extractShader(_nvscalerShader);
|
||||
|
||||
for (final shaderPath in _artcnnShaders.values) {
|
||||
await _extractShader(shaderPath);
|
||||
}
|
||||
|
||||
for (final shaderPath in _anime4kShaders.values) {
|
||||
await _extractShader(shaderPath);
|
||||
}
|
||||
} catch (e, st) {
|
||||
appLogger.w('Failed to preload shaders', error: e, stackTrace: st);
|
||||
}
|
||||
}
|
||||
|
||||
/// Clear cached shader directory reference.
|
||||
/// Call when clearing app cache.
|
||||
static void clearCache() {
|
||||
|
||||
@@ -109,11 +109,6 @@ class UpdateService {
|
||||
return prefs.getString(_keySkippedVersion);
|
||||
}
|
||||
|
||||
static Future<void> clearSkippedVersion() async {
|
||||
final prefs = await BaseSharedPreferencesService.sharedCache();
|
||||
await prefs.remove(_keySkippedVersion);
|
||||
}
|
||||
|
||||
/// Check if cooldown period has passed since last check
|
||||
static Future<bool> shouldCheckForUpdates() async {
|
||||
final prefs = await BaseSharedPreferencesService.sharedCache();
|
||||
|
||||
@@ -275,15 +275,6 @@ class MediaImageHelper {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Optimized URL for hero/background art ([ImageType.art]).
|
||||
static String heroArtUrl({
|
||||
required MediaServerClient? client,
|
||||
required String? thumbPath,
|
||||
required BuildContext context,
|
||||
required double containerWidth,
|
||||
required double containerHeight,
|
||||
}) => _typedUrl(client, thumbPath, context, containerWidth, containerHeight, ImageType.art);
|
||||
|
||||
/// Optimized URL for clear-logo overlays ([ImageType.logo]).
|
||||
static String logoUrl({
|
||||
required MediaServerClient? client,
|
||||
|
||||
@@ -249,9 +249,6 @@ class MediaServerHttpClient {
|
||||
}
|
||||
}
|
||||
|
||||
/// Send a streamed request (for image cache etc).
|
||||
Future<http.StreamedResponse> sendStreamed(http.BaseRequest request) => _client.send(request);
|
||||
|
||||
void close() {
|
||||
_closing = true;
|
||||
_abortActiveRequests();
|
||||
|
||||
@@ -9,7 +9,6 @@ import '../services/settings_service.dart';
|
||||
/// [SettingValueBuilder] / [SettingsBuilder] so only the dependent subtree rebuilds.
|
||||
extension SettingsContextRead on BuildContext {
|
||||
T settingsRead<T>(Pref<T> pref) => SettingsService.instance.read(pref);
|
||||
Future<void> settingsWrite<T>(Pref<T> pref, T value) => SettingsService.instance.write(pref, value);
|
||||
}
|
||||
|
||||
/// Rebuild [builder] when any of [prefs] changes. Use when a widget's output
|
||||
|
||||
@@ -295,12 +295,6 @@ class DesktopVideoControlsState extends State<DesktopVideoControls> {
|
||||
_timelineFocusNode.requestFocus();
|
||||
}
|
||||
|
||||
/// Get focus node for volume control
|
||||
FocusNode get volumeFocusNode => _volumeFocusNode;
|
||||
|
||||
/// Get focus nodes for track controls
|
||||
List<FocusNode> get trackControlFocusNodes => _trackControlFocusNodes;
|
||||
|
||||
/// Hide content strip (called by parent when controls hide)
|
||||
void hideContentStrip() {
|
||||
if (_contentStripVisible) {
|
||||
|
||||
Reference in New Issue
Block a user