chore: pre-commit ci hook, dart format

This commit is contained in:
edde746
2026-04-18 12:40:35 +02:00
parent 2bd9e6655f
commit 3da51f9d64
128 changed files with 2056 additions and 2048 deletions
+10 -15
View File
@@ -13,11 +13,8 @@ class DownloadVersionConfig {
final Set<String> acceptedSignatures;
final Future<int?> Function(PlexMetadata episode, List<PlexMediaVersion> versions)? onVersionMismatch;
DownloadVersionConfig({
this.mediaIndex = 0,
Set<String>? acceptedSignatures,
this.onVersionMismatch,
}) : acceptedSignatures = acceptedSignatures ?? {};
DownloadVersionConfig({this.mediaIndex = 0, Set<String>? acceptedSignatures, this.onVersionMismatch})
: acceptedSignatures = acceptedSignatures ?? {};
/// Create from a selected version's signature.
factory DownloadVersionConfig.fromSignature(
@@ -84,11 +81,10 @@ Future<int?> showVersionPickerDialog(BuildContext context, List<PlexMediaVersion
return showOptionPickerDialog<int>(
context,
title: title,
options: List.generate(versions.length, (index) => (
icon: Symbols.video_file_rounded,
label: versions[index].displayLabel,
value: index,
)),
options: List.generate(
versions.length,
(index) => (icon: Symbols.video_file_rounded, label: versions[index].displayLabel, value: index),
),
);
}
@@ -105,13 +101,12 @@ Future<List<PlexMediaVersion>?> fetchRepresentativeVersions(PlexClient client, P
final seasons = await client.getChildren(metadata.ratingKey);
// Skip Season 0 (Specials) as it may have different encoding
final firstSeason = seasons.cast<PlexMetadata?>().firstWhere(
(s) => s?.type == 'season' && (s?.index ?? 0) > 0,
orElse: () => seasons.cast<PlexMetadata?>().firstWhere((s) => s?.type == 'season', orElse: () => null),
);
(s) => s?.type == 'season' && (s?.index ?? 0) > 0,
orElse: () => seasons.cast<PlexMetadata?>().firstWhere((s) => s?.type == 'season', orElse: () => null),
);
if (firstSeason != null) {
final episodes = await client.getChildren(firstSeason.ratingKey);
final firstEpisode =
episodes.cast<PlexMetadata?>().firstWhere((e) => e?.type == 'episode', orElse: () => null);
final firstEpisode = episodes.cast<PlexMetadata?>().firstWhere((e) => e?.type == 'episode', orElse: () => null);
episodeRatingKey = firstEpisode?.ratingKey;
}
}