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
+3 -96
View File
@@ -5,45 +5,13 @@ import 'seerr_media.dart';
part 'seerr_details.g.dart';
/// Full movie detail from `GET /movie/{tmdbId}` — the subset the catalog
/// surfaces need (credits, external ids, availability, air status).
/// surfaces need (credits, availability).
@JsonSerializable(createToJson: false)
class SeerrMovieDetails {
final int id;
final String? title;
final String? overview;
final String? posterPath;
final String? backdropPath;
final String? releaseDate;
/// Minutes.
final int? runtime;
/// `Released` / `In Production` / `Post Production` / `Planned` /
/// `Canceled` / `Rumored`.
final String? status;
final double? voteAverage;
final int? voteCount;
final List<SeerrGenre>? genres;
final SeerrCredits? credits;
final SeerrExternalIds? externalIds;
final SeerrMediaInfo? mediaInfo;
const SeerrMovieDetails({
required this.id,
this.title,
this.overview,
this.posterPath,
this.backdropPath,
this.releaseDate,
this.runtime,
this.status,
this.voteAverage,
this.voteCount,
this.genres,
this.credits,
this.externalIds,
this.mediaInfo,
});
const SeerrMovieDetails({this.credits, this.mediaInfo});
factory SeerrMovieDetails.fromJson(Map<String, dynamic> json) => _$SeerrMovieDetailsFromJson(json);
}
@@ -51,66 +19,15 @@ class SeerrMovieDetails {
/// Full TV detail from `GET /tv/{tmdbId}`.
@JsonSerializable(createToJson: false)
class SeerrTvDetails {
final int id;
final String? name;
final String? overview;
final String? posterPath;
final String? backdropPath;
final String? firstAirDate;
final List<int>? episodeRunTime;
/// `Returning Series` / `Ended` / `Canceled` / `In Production` /
/// `Planned` / `Pilot`.
final String? status;
final double? voteAverage;
final int? voteCount;
final List<SeerrGenre>? genres;
final List<SeerrNetwork>? networks;
final int? numberOfEpisodes;
final int? numberOfSeasons;
final List<SeerrSeason>? seasons;
final SeerrCredits? credits;
final SeerrExternalIds? externalIds;
final SeerrMediaInfo? mediaInfo;
const SeerrTvDetails({
required this.id,
this.name,
this.overview,
this.posterPath,
this.backdropPath,
this.firstAirDate,
this.episodeRunTime,
this.status,
this.voteAverage,
this.voteCount,
this.genres,
this.networks,
this.numberOfEpisodes,
this.numberOfSeasons,
this.seasons,
this.credits,
this.externalIds,
this.mediaInfo,
});
const SeerrTvDetails({this.seasons, this.credits, this.mediaInfo});
factory SeerrTvDetails.fromJson(Map<String, dynamic> json) => _$SeerrTvDetailsFromJson(json);
}
@JsonSerializable(createToJson: false)
class SeerrGenre {
final String? name;
const SeerrGenre({this.name});
factory SeerrGenre.fromJson(Map<String, dynamic> json) => _$SeerrGenreFromJson(json);
}
@JsonSerializable(createToJson: false)
class SeerrNetwork {
final String? name;
const SeerrNetwork({this.name});
factory SeerrNetwork.fromJson(Map<String, dynamic> json) => _$SeerrNetworkFromJson(json);
}
/// One TMDB season entry (`TvDetails.seasons[]`). Season 0 is specials.
@JsonSerializable(createToJson: false)
class SeerrSeason {
@@ -141,13 +58,3 @@ class SeerrCastMember {
factory SeerrCastMember.fromJson(Map<String, dynamic> json) => _$SeerrCastMemberFromJson(json);
}
@JsonSerializable(createToJson: false)
class SeerrExternalIds {
final String? imdbId;
final int? tvdbId;
const SeerrExternalIds({this.imdbId, this.tvdbId});
factory SeerrExternalIds.fromJson(Map<String, dynamic> json) => _$SeerrExternalIdsFromJson(json);
}
-55
View File
@@ -8,27 +8,9 @@ part of 'seerr_details.dart';
SeerrMovieDetails _$SeerrMovieDetailsFromJson(Map<String, dynamic> json) =>
SeerrMovieDetails(
id: (json['id'] as num).toInt(),
title: json['title'] as String?,
overview: json['overview'] as String?,
posterPath: json['posterPath'] as String?,
backdropPath: json['backdropPath'] as String?,
releaseDate: json['releaseDate'] as String?,
runtime: (json['runtime'] as num?)?.toInt(),
status: json['status'] as String?,
voteAverage: (json['voteAverage'] as num?)?.toDouble(),
voteCount: (json['voteCount'] as num?)?.toInt(),
genres: (json['genres'] as List<dynamic>?)
?.map((e) => SeerrGenre.fromJson(e as Map<String, dynamic>))
.toList(),
credits: json['credits'] == null
? null
: SeerrCredits.fromJson(json['credits'] as Map<String, dynamic>),
externalIds: json['externalIds'] == null
? null
: SeerrExternalIds.fromJson(
json['externalIds'] as Map<String, dynamic>,
),
mediaInfo: json['mediaInfo'] == null
? null
: SeerrMediaInfo.fromJson(json['mediaInfo'] as Map<String, dynamic>),
@@ -36,48 +18,17 @@ SeerrMovieDetails _$SeerrMovieDetailsFromJson(Map<String, dynamic> json) =>
SeerrTvDetails _$SeerrTvDetailsFromJson(Map<String, dynamic> json) =>
SeerrTvDetails(
id: (json['id'] as num).toInt(),
name: json['name'] as String?,
overview: json['overview'] as String?,
posterPath: json['posterPath'] as String?,
backdropPath: json['backdropPath'] as String?,
firstAirDate: json['firstAirDate'] as String?,
episodeRunTime: (json['episodeRunTime'] as List<dynamic>?)
?.map((e) => (e as num).toInt())
.toList(),
status: json['status'] as String?,
voteAverage: (json['voteAverage'] as num?)?.toDouble(),
voteCount: (json['voteCount'] as num?)?.toInt(),
genres: (json['genres'] as List<dynamic>?)
?.map((e) => SeerrGenre.fromJson(e as Map<String, dynamic>))
.toList(),
networks: (json['networks'] as List<dynamic>?)
?.map((e) => SeerrNetwork.fromJson(e as Map<String, dynamic>))
.toList(),
numberOfEpisodes: (json['numberOfEpisodes'] as num?)?.toInt(),
numberOfSeasons: (json['numberOfSeasons'] as num?)?.toInt(),
seasons: (json['seasons'] as List<dynamic>?)
?.map((e) => SeerrSeason.fromJson(e as Map<String, dynamic>))
.toList(),
credits: json['credits'] == null
? null
: SeerrCredits.fromJson(json['credits'] as Map<String, dynamic>),
externalIds: json['externalIds'] == null
? null
: SeerrExternalIds.fromJson(
json['externalIds'] as Map<String, dynamic>,
),
mediaInfo: json['mediaInfo'] == null
? null
: SeerrMediaInfo.fromJson(json['mediaInfo'] as Map<String, dynamic>),
);
SeerrGenre _$SeerrGenreFromJson(Map<String, dynamic> json) =>
SeerrGenre(name: json['name'] as String?);
SeerrNetwork _$SeerrNetworkFromJson(Map<String, dynamic> json) =>
SeerrNetwork(name: json['name'] as String?);
SeerrSeason _$SeerrSeasonFromJson(Map<String, dynamic> json) => SeerrSeason(
seasonNumber: (json['seasonNumber'] as num).toInt(),
name: json['name'] as String?,
@@ -97,9 +48,3 @@ SeerrCastMember _$SeerrCastMemberFromJson(Map<String, dynamic> json) =>
character: json['character'] as String?,
profilePath: json['profilePath'] as String?,
);
SeerrExternalIds _$SeerrExternalIdsFromJson(Map<String, dynamic> json) =>
SeerrExternalIds(
imdbId: json['imdbId'] as String?,
tvdbId: (json['tvdbId'] as num?)?.toInt(),
);