refactor: remove unreachable code paths and unused members

Drops dead code across services, models, utils and widgets, including the
connection auth service, which had no implementer, and the Live TV DVR
provisioning models, which had no caller.

Tests that only covered deleted behaviour are removed or trimmed. No
behaviour change.
This commit is contained in:
edde746
2026-07-26 06:09:47 +02:00
parent 9a6f48a4cb
commit 4307c49cd2
53 changed files with 59 additions and 1118 deletions
-4
View File
@@ -51,10 +51,6 @@ class MemoryLogOutput extends LogOutput {
_currentSize = 0;
}
static int getCurrentSize() => _currentSize;
static double getCurrentSizeMB() => _currentSize / (1024 * 1024);
@override
void output(OutputEvent event) {
// Only print to console — storage is done in MemoryAwareLogPrinter.log()
-1
View File
@@ -17,7 +17,6 @@ class ContentTypes {
static const Set<String> musicTypes = {artist, album, track};
static const Set<String> videoTypes = {movie, show, season, episode};
static const Set<String> playableTypes = {movie, episode, clip, track};
}
class ContentTypeHelper {
@@ -37,14 +37,12 @@ class ContinuationPaginationCoordinator<T> {
bool _disposed = false;
bool _isLoading = false;
Object? _error;
StackTrace? _errorStackTrace;
int? get nextStartIndex => _nextStartIndex;
int? get totalCount => _totalCount;
bool get hasMore => _nextStartIndex != null;
bool get isLoading => _isLoading;
Object? get error => _error;
StackTrace? get errorStackTrace => _errorStackTrace;
/// Invalidates all prior work, runs [request], and reports whether its result
/// still belongs to the current generation.
@@ -65,7 +63,6 @@ class ContinuationPaginationCoordinator<T> {
_totalCount = totalCount;
_nextStartIndex = startIndex < totalCount ? startIndex : null;
_error = null;
_errorStackTrace = null;
onStateChanged?.call();
}
@@ -99,7 +96,6 @@ class ContinuationPaginationCoordinator<T> {
_inFlightGeneration = null;
_isLoading = false;
_error = null;
_errorStackTrace = null;
}
int _beginGeneration() {
@@ -110,7 +106,6 @@ class ContinuationPaginationCoordinator<T> {
_inFlightGeneration = null;
_isLoading = false;
_error = null;
_errorStackTrace = null;
if (!_disposed) onStateChanged?.call();
return _generation;
}
@@ -120,7 +115,6 @@ class ContinuationPaginationCoordinator<T> {
Future<ContinuationLoadStatus> _loadRemaining(int generation) async {
_isLoading = true;
_error = null;
_errorStackTrace = null;
onStateChanged?.call();
try {
@@ -148,7 +142,6 @@ class ContinuationPaginationCoordinator<T> {
} catch (exception, stackTrace) {
if (!_isCurrent(generation)) return ContinuationLoadStatus.stale;
_error = exception;
_errorStackTrace = stackTrace;
onError?.call(exception, stackTrace);
return ContinuationLoadStatus.failed;
} finally {
-4
View File
@@ -23,10 +23,6 @@ mixin HierarchicalEventMixin {
/// Check if this event affects a specific item by id.
bool affectsItem(String itemId) => this.itemId == itemId || parentChain.contains(itemId);
/// Check if this event affects a specific globalKey.
bool affectsGlobalKey(String globalKey) =>
this.globalKey == globalKey || parentChain.any((pk) => buildGlobalKey(serverId, pk) == globalKey);
/// Check if this event affects any item in a collection.
bool affectsAnyOf(Iterable<String> itemIds) {
if (itemIds.contains(itemId)) return true;
-1
View File
@@ -31,7 +31,6 @@ class ScreenBreakpoints {
/// Animation and notification durations.
class AppDurations {
static const Duration animFast = Duration(milliseconds: 200);
static const Duration animMedium = Duration(milliseconds: 300);
static const Duration animSlow = Duration(milliseconds: 500);
static const Duration snackBarDefault = Duration(seconds: 3);
-27
View File
@@ -334,31 +334,4 @@ class MediaImageHelper {
return true;
}
/// Optimized URL for clear-logo overlays ([ImageType.logo]).
static String logoUrl({
required MediaServerClient? client,
required String? thumbPath,
required BuildContext context,
required double containerWidth,
required double containerHeight,
}) => _typedUrl(client, thumbPath, context, containerWidth, containerHeight, ImageType.logo);
static String _typedUrl(
MediaServerClient? client,
String? thumbPath,
BuildContext context,
double containerWidth,
double containerHeight,
ImageType type,
) {
return getOptimizedImageUrl(
client: client,
thumbPath: thumbPath,
maxWidth: containerWidth,
maxHeight: containerHeight,
devicePixelRatio: effectiveDevicePixelRatio(context),
imageType: type,
);
}
}
-2
View File
@@ -112,8 +112,6 @@ class TvDetectionService {
bool get isTV => _isTV;
List<String> get tvDetectionReasons => _effectiveDetectionReasons;
List<String> get _effectiveDetectionReasons {
final reasons = <String>[..._detectionReasons];
if (_forceTv && !reasons.contains('force_tv')) reasons.add('force_tv');