style: apply dart format to eight drifted sources

`dart format --set-exit-if-changed` over lib and test rewrites these.
The analysis job never reached its formatting step, so the drift went
unnoticed. No behaviour changes.
This commit is contained in:
edde746
2026-07-26 23:05:53 +02:00
parent e7f97cc090
commit 78eedd21d3
8 changed files with 13 additions and 47 deletions
+1 -6
View File
@@ -137,12 +137,7 @@ class _DownloadMetadataStore extends ChangeNotifier {
? buildGlobalKey(ServerId(latest.clientScopeId!), latest.ratingKey)
: latest.globalKey;
hydrated.add(
HydratedWatchStatePatch(
globalKey: scopedKey,
patch: snapshot,
updatedAt: latest.updatedAt,
order: latest.id,
),
HydratedWatchStatePatch(globalKey: scopedKey, patch: snapshot, updatedAt: latest.updatedAt, order: latest.id),
);
}
_watchStateStore.setHydratedPatches(hydrated);
+1 -2
View File
@@ -116,8 +116,7 @@ class MultiServerProvider extends ChangeNotifier with DisposableChangeNotifierMi
}
/// Keep only ids the manager considers visible under the active filter.
List<String> _visible(List<String> ids) =>
ids.where((id) => _serverManager.isServerVisible(ServerId(id))).toList();
List<String> _visible(List<String> ids) => ids.where((id) => _serverManager.isServerVisible(ServerId(id))).toList();
void _pruneLiveTvServersForVisibility() {
if (_visibleServerIds == null) return;
@@ -26,11 +26,7 @@ import 'base_library_tab.dart';
/// [BaseLibraryTabState].
abstract class PaginatedCardGridTabState<T extends Object, W extends BaseLibraryTab<T>>
extends BaseLibraryTabState<T, W>
with
LibraryTabFocusMixin<W>,
PaginatedItemLoader<T, W>,
StandardPaginatedView<T, W>,
SkeletonUpgradeScheduler<W> {
with LibraryTabFocusMixin<W>, PaginatedItemLoader<T, W>, StandardPaginatedView<T, W>, SkeletonUpgradeScheduler<W> {
static const double _focusDecorationPadding = 3.0;
/// Reuses card widgets across delegate swaps so tab-level setStates
@@ -458,11 +458,7 @@ class JellyfinEndpointDiscovery {
/// Splits a raw add/edit form field into the individual URLs the user typed.
/// Entries are separated by newlines and/or commas; blanks are dropped.
static List<String> parseUserEnteredUrls(String raw) {
return raw
.split(RegExp(r'[\n,]+'))
.map((url) => url.trim())
.where((url) => url.isNotEmpty)
.toList(growable: false);
return raw.split(RegExp(r'[\n,]+')).map((url) => url.trim()).where((url) => url.isNotEmpty).toList(growable: false);
}
static JellyfinEndpointUserInputCandidates buildUserInputCandidates(Iterable<String> input) {
@@ -169,9 +169,7 @@ class JellyfinSequentialLauncher extends MediaListPlaybackLauncher {
: await client.fetchClientSideEpisodeQueue(seriesId);
abort.throwIfAborted();
if (raw == null) return const <MediaItem>[];
return raw
.map((e) => e.copyWith(serverId: serverId, serverName: metadata.serverName ?? e.serverName))
.toList();
return raw.map((e) => e.copyWith(serverId: serverId, serverName: metadata.serverName ?? e.serverName)).toList();
},
);
}
+1 -3
View File
@@ -104,9 +104,7 @@ class DeviceIdentityService {
/// remains.
String? sanitizeHeaderValue(String? value) {
if (value == null) return null;
final filtered = String.fromCharCodes(
value.codeUnits.where((unit) => unit >= 0x20 && unit != 0x7F && unit <= 0xFF),
);
final filtered = String.fromCharCodes(value.codeUnits.where((unit) => unit >= 0x20 && unit != 0x7F && unit <= 0xFF));
final trimmed = filtered.trim();
return trimmed.isEmpty ? null : trimmed;
}
+3 -11
View File
@@ -1140,11 +1140,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
item: item,
client: client,
result: result,
createPrompt: (
title: t.playlists.create,
label: t.playlists.playlistName,
hint: t.playlists.enterPlaylistName,
),
createPrompt: (title: t.playlists.create, label: t.playlists.playlistName, hint: t.playlists.enterPlaylistName),
create: (name) => client.createPlaylist(title: name, items: [item]),
createdLog: (playlist) => 'Successfully created playlist: ${playlist.title}',
eagerSyncId: (_) => null,
@@ -1225,12 +1221,8 @@ class MediaContextMenuState extends State<MediaContextMenu> {
label: t.collections.collectionName,
hint: t.collections.enterCollectionName,
),
create: (name) => client.createCollection(
libraryId: resolvedLibraryId,
title: name,
items: [item],
itemKind: itemKind,
),
create: (name) =>
client.createCollection(libraryId: resolvedLibraryId, title: name, items: [item], itemKind: itemKind),
createdLog: (id) => 'Successfully created collection with ID: $id',
eagerSyncId: (id) => id,
add: () => client.addToCollection(collectionId: result, items: [item]),
@@ -314,25 +314,17 @@ Future<List<DiscoveredJellyfinServer>> _noLocalServers() async => const [];
void main() {
group('resolveJellyfinClientVersion', () {
PackageInfo packageInfo(String version) => PackageInfo(
appName: 'Plezy',
packageName: 'com.example.plezy',
version: version,
buildNumber: '1',
);
PackageInfo packageInfo(String version) =>
PackageInfo(appName: 'Plezy', packageName: 'com.example.plezy', version: version, buildNumber: '1');
test('uses a non-empty package version', () async {
final version = await resolveJellyfinClientVersion(
packageInfoLoader: () async => packageInfo(' 2.9.1 '),
);
final version = await resolveJellyfinClientVersion(packageInfoLoader: () async => packageInfo(' 2.9.1 '));
expect(version, '2.9.1');
});
test('falls back when the package version is empty', () async {
for (final packageVersion in ['', ' ']) {
final version = await resolveJellyfinClientVersion(
packageInfoLoader: () async => packageInfo(packageVersion),
);
final version = await resolveJellyfinClientVersion(packageInfoLoader: () async => packageInfo(packageVersion));
expect(version, '1.0');
}
});