fix(review): resolve post-consolidation regressions
This commit is contained in:
@@ -140,7 +140,6 @@ class MediaVersion {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<MediaPart> _partsFromJson(Object? raw) {
|
||||
return raw is List
|
||||
? [
|
||||
|
||||
@@ -5,13 +5,8 @@ part of 'download_provider.dart';
|
||||
/// orchestration; this store keeps cache hydration and watch synchronization in
|
||||
/// one lifecycle-bound component.
|
||||
class _DownloadMetadataStore extends ChangeNotifier {
|
||||
_DownloadMetadataStore({
|
||||
required DownloadManagerService downloadManager,
|
||||
required AppDatabase database,
|
||||
String? activeProfileId,
|
||||
}) : _downloadManager = downloadManager,
|
||||
_database = database,
|
||||
_activeProfileId = activeProfileId {
|
||||
_DownloadMetadataStore(this._downloadManager, this._database, {String? activeProfileId})
|
||||
: _activeProfileId = activeProfileId {
|
||||
_watchStateSubscription = WatchStateNotifier().stream.listen(_onWatchStateChanged);
|
||||
_watchStateStore.addListener(notifyListeners);
|
||||
_watchStateStore.setActiveProfileId(activeProfileId);
|
||||
|
||||
@@ -100,8 +100,7 @@ class DownloadProvider extends ChangeNotifier with DisposableChangeNotifierMixin
|
||||
|
||||
DownloadProvider({required this._downloadManager, required this._database})
|
||||
: _syncRuleExecutor = SyncRuleExecutor(database: _database) {
|
||||
_metadataStore = _DownloadMetadataStore(downloadManager: _downloadManager, database: _database)
|
||||
..addListener(_onMetadataStoreChanged);
|
||||
_metadataStore = _DownloadMetadataStore(_downloadManager, _database)..addListener(_onMetadataStoreChanged);
|
||||
// Listen to progress updates from the download manager
|
||||
_progressSubscription = _downloadManager.progressStream.listen(_onProgressUpdate);
|
||||
|
||||
@@ -123,11 +122,8 @@ class DownloadProvider extends ChangeNotifier with DisposableChangeNotifierMixin
|
||||
required this._database,
|
||||
this._activeProfileId = 'test-profile',
|
||||
}) : _syncRuleExecutor = SyncRuleExecutor(database: _database) {
|
||||
_metadataStore = _DownloadMetadataStore(
|
||||
downloadManager: _downloadManager,
|
||||
database: _database,
|
||||
activeProfileId: _activeProfileId,
|
||||
)..addListener(_onMetadataStoreChanged);
|
||||
_metadataStore = _DownloadMetadataStore(_downloadManager, _database, activeProfileId: _activeProfileId)
|
||||
..addListener(_onMetadataStoreChanged);
|
||||
_progressSubscription = _downloadManager.progressStream.listen(_onProgressUpdate);
|
||||
_deletionProgressSubscription = _downloadManager.deletionProgressStream.listen(_onDeletionProgressUpdate);
|
||||
_initFuture = _loadProfileScopedState();
|
||||
|
||||
@@ -18,7 +18,6 @@ import '../providers/catalog_sources_provider.dart';
|
||||
import '../providers/explore_provider.dart';
|
||||
import '../services/catalog/catalog_source.dart';
|
||||
import '../services/settings_service.dart';
|
||||
import '../utils/layout_constants.dart';
|
||||
import '../utils/platform_detector.dart';
|
||||
import '../utils/provider_extensions.dart';
|
||||
import '../widgets/app_icon.dart';
|
||||
|
||||
@@ -237,6 +237,7 @@ class PlexClient
|
||||
final String? serverName;
|
||||
|
||||
/// API response cache for offline support
|
||||
@override
|
||||
final PlexApiCache _cache = PlexApiCache.instance;
|
||||
|
||||
/// Expose the cache through the [MediaServerClient] interface so the shared
|
||||
@@ -680,6 +681,7 @@ class PlexClient
|
||||
@override
|
||||
PlexMetadataDto _createTaggedMetadata(Map<String, dynamic> json) => _tagMetadata(PlexMetadataDto.fromJson(json));
|
||||
|
||||
@override
|
||||
PlexMetadataDto _createTaggedMetadataWithLibrary(
|
||||
Map<String, dynamic> json, {
|
||||
int? librarySectionID,
|
||||
@@ -784,6 +786,7 @@ class PlexClient
|
||||
return fallbackPageTotal(offset: offset, itemCount: itemCount, requestedSize: requestedSize);
|
||||
}
|
||||
|
||||
@override
|
||||
({List<PlexPlaylistDto> items, int totalSize}) _extractPlaylistListResult(
|
||||
MediaServerResponse response, {
|
||||
int? start,
|
||||
@@ -890,6 +893,7 @@ class PlexClient
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> _buildPaginationParams(int? start, int? size) {
|
||||
final params = <String, dynamic>{};
|
||||
if (start != null) params['X-Plex-Container-Start'] = start;
|
||||
@@ -897,6 +901,7 @@ class PlexClient
|
||||
return params;
|
||||
}
|
||||
|
||||
@override
|
||||
_LibraryContentResult _extractLibraryContentResult(
|
||||
MediaServerResponse response, {
|
||||
int? librarySectionID,
|
||||
@@ -913,6 +918,7 @@ class PlexClient
|
||||
return _LibraryContentResult(items: items, totalSize: totalSize);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<_LibraryContentResult> _fetchPaginatedList(
|
||||
String path, {
|
||||
int? start,
|
||||
@@ -974,6 +980,7 @@ class PlexClient
|
||||
|
||||
/// Build a proper metadata URI for adding to playlists
|
||||
/// Returns URI in format: server://{machineId}/com.plexapp.plugins.library/library/metadata/{ratingKey}
|
||||
@override
|
||||
Future<String> buildMetadataUri(String ratingKey) async {
|
||||
// Use cached machine identifier from config if available
|
||||
final machineId = config.machineIdentifier ?? await getMachineIdentifier();
|
||||
@@ -1119,6 +1126,7 @@ class PlexClient
|
||||
/// - Non-2xx success that the server reports without an error code is
|
||||
/// vanishingly rare for these endpoints; we still return `false` so
|
||||
/// callers don't celebrate a non-200 silently.
|
||||
@override
|
||||
Future<bool> _wrapBoolApiCall(Future<MediaServerResponse> Function() apiCall, String errorMessage) async {
|
||||
try {
|
||||
final response = await apiCall();
|
||||
@@ -1146,15 +1154,13 @@ class PlexClient
|
||||
}
|
||||
}
|
||||
|
||||
/// Default cap for list-style endpoints when a caller doesn't pass a size.
|
||||
static const int _defaultListContainerSize = 1000;
|
||||
|
||||
/// Page size used when walking all pages of a paginated endpoint.
|
||||
static const int _fetchAllPageSize = 200;
|
||||
|
||||
/// Iterate every page of a paginated endpoint and concatenate the results.
|
||||
/// Stops as soon as [_LibraryContentResult.totalSize] is reached or a page
|
||||
/// returns no items. Errors propagate.
|
||||
@override
|
||||
Future<List<PlexMetadataDto>> _fetchAllPages(
|
||||
Future<_LibraryContentResult> Function(int start, int size, AbortController? abort) fetchPage, {
|
||||
AbortController? abort,
|
||||
|
||||
@@ -6,9 +6,12 @@ mixin _PlexCollectionMethods on MediaServerCacheMixin {
|
||||
Future<MediaServerResponse> _getWithFailover(
|
||||
String path, {
|
||||
Map<String, dynamic>? queryParameters,
|
||||
// ignore: unused_element_parameter
|
||||
Map<String, String>? headers,
|
||||
// ignore: unused_element_parameter
|
||||
Duration? timeout,
|
||||
AbortController? abort,
|
||||
// ignore: unused_element_parameter
|
||||
bool allowEndpointFailover = true,
|
||||
});
|
||||
|
||||
@@ -18,6 +21,7 @@ mixin _PlexCollectionMethods on MediaServerCacheMixin {
|
||||
_LibraryContentResult _extractLibraryContentResult(
|
||||
MediaServerResponse response, {
|
||||
int? librarySectionID,
|
||||
// ignore: unused_element_parameter
|
||||
String? librarySectionTitle,
|
||||
int? start,
|
||||
int? requestedSize,
|
||||
@@ -34,6 +38,7 @@ mixin _PlexCollectionMethods on MediaServerCacheMixin {
|
||||
|
||||
Future<List<PlexMetadataDto>> _fetchAllPages(
|
||||
Future<_LibraryContentResult> Function(int start, int size, AbortController? abort) fetchPage, {
|
||||
// ignore: unused_element_parameter
|
||||
AbortController? abort,
|
||||
});
|
||||
|
||||
|
||||
@@ -3,14 +3,19 @@ part of '../../plex_client.dart';
|
||||
mixin _PlexMetadataEditMethods on MediaServerCacheMixin {
|
||||
FailoverHttpClient get _http;
|
||||
PlexApiCache get _cache;
|
||||
@override
|
||||
ServerId get serverId;
|
||||
|
||||
Future<MediaServerResponse> _getWithFailover(
|
||||
String path, {
|
||||
Map<String, dynamic>? queryParameters,
|
||||
// ignore: unused_element_parameter
|
||||
Map<String, String>? headers,
|
||||
// ignore: unused_element_parameter
|
||||
Duration? timeout,
|
||||
// ignore: unused_element_parameter
|
||||
AbortController? abort,
|
||||
// ignore: unused_element_parameter
|
||||
bool allowEndpointFailover = true,
|
||||
});
|
||||
|
||||
|
||||
@@ -6,9 +6,13 @@ mixin _PlexPlayQueueMethods on MediaServerCacheMixin {
|
||||
Future<MediaServerResponse> _getWithFailover(
|
||||
String path, {
|
||||
Map<String, dynamic>? queryParameters,
|
||||
// ignore: unused_element_parameter
|
||||
Map<String, String>? headers,
|
||||
// ignore: unused_element_parameter
|
||||
Duration? timeout,
|
||||
// ignore: unused_element_parameter
|
||||
AbortController? abort,
|
||||
// ignore: unused_element_parameter
|
||||
bool allowEndpointFailover = true,
|
||||
});
|
||||
|
||||
@@ -77,9 +81,9 @@ mixin _PlexPlayQueueMethods on MediaServerCacheMixin {
|
||||
'shuffle': shuffle,
|
||||
'repeat': repeat,
|
||||
'continuous': continuous,
|
||||
if (uri != null) 'uri': uri,
|
||||
if (playlistID != null) 'playlistID': playlistID,
|
||||
if (key != null) 'key': key,
|
||||
'uri': ?uri,
|
||||
'playlistID': ?playlistID,
|
||||
'key': ?key,
|
||||
};
|
||||
final response = await _http.post('/playQueues', queryParameters: queryParameters);
|
||||
throwIfHttpError(response);
|
||||
@@ -108,7 +112,7 @@ mixin _PlexPlayQueueMethods on MediaServerCacheMixin {
|
||||
'window': window,
|
||||
'includeBefore': includeBefore,
|
||||
'includeAfter': includeAfter,
|
||||
if (center != null) 'center': center,
|
||||
'center': ?center,
|
||||
};
|
||||
final response = await _getWithFailover('/playQueues/$playQueueId', queryParameters: queryParameters);
|
||||
return _parsePlayQueueResponse(
|
||||
|
||||
@@ -5,15 +5,20 @@ mixin _PlexPlaylistMethods on MediaServerCacheMixin {
|
||||
static const int _defaultPlaylistContainerSize = 100;
|
||||
|
||||
FailoverHttpClient get _http;
|
||||
@override
|
||||
ServerId get serverId;
|
||||
@override
|
||||
String? get serverName;
|
||||
|
||||
Future<MediaServerResponse> _getWithFailover(
|
||||
String path, {
|
||||
Map<String, dynamic>? queryParameters,
|
||||
// ignore: unused_element_parameter
|
||||
Map<String, String>? headers,
|
||||
// ignore: unused_element_parameter
|
||||
Duration? timeout,
|
||||
AbortController? abort,
|
||||
// ignore: unused_element_parameter
|
||||
bool allowEndpointFailover = true,
|
||||
});
|
||||
|
||||
@@ -161,8 +166,8 @@ mixin _PlexPlaylistMethods on MediaServerCacheMixin {
|
||||
'type': type,
|
||||
'title': title,
|
||||
'smart': '0',
|
||||
if (uri != null) 'uri': uri,
|
||||
if (playQueueId != null) 'playQueueID': playQueueId.toString(),
|
||||
'uri': ?uri,
|
||||
'playQueueID': ?playQueueId?.toString(),
|
||||
};
|
||||
final response = await _http.post('/playlists', queryParameters: queryParameters);
|
||||
throwIfHttpError(response);
|
||||
|
||||
@@ -21,12 +21,3 @@ String buildProfileScopedGlobalKey(String profileId, ServerId serverId, String r
|
||||
if (idx <= 0) return null;
|
||||
return (serverId: ServerId(globalKey.substring(0, idx)), ratingKey: globalKey.substring(idx + 1));
|
||||
}
|
||||
|
||||
/// Parses a profile-owned sync-rule key, returning `null` for legacy public keys.
|
||||
({String profileId, ServerId serverId, String ratingKey})? parseProfileScopedGlobalKey(String globalKey) {
|
||||
final idx = globalKey.indexOf(profileScopedGlobalKeySeparator);
|
||||
if (idx < 0) return null;
|
||||
final publicKey = parseGlobalKey(globalKey.substring(idx + 1));
|
||||
if (publicKey == null) return null;
|
||||
return (profileId: globalKey.substring(0, idx), serverId: publicKey.serverId, ratingKey: publicKey.ratingKey);
|
||||
}
|
||||
|
||||
@@ -519,7 +519,6 @@ class DesktopVideoControlsState extends State<DesktopVideoControls> {
|
||||
}
|
||||
|
||||
final duration = widget.player.state.duration;
|
||||
final position = widget.player.state.position;
|
||||
|
||||
// UP arrow - hide controls and reset seek state
|
||||
if (key == LogicalKeyboardKey.arrowUp) {
|
||||
|
||||
@@ -18,14 +18,14 @@ void main() {
|
||||
);
|
||||
|
||||
test('uses the authoritative fallback when both items omit server identity', () {
|
||||
final merged = mergeFetchedtestMediaItem(fetched: item(), fallbackServerId: ServerId('fallback'));
|
||||
final merged = mergeFetchedMediaItem(fetched: item(), fallbackServerId: ServerId('fallback'));
|
||||
|
||||
expect(merged.serverId, 'fallback');
|
||||
expect(merged.globalKey, 'fallback:item');
|
||||
});
|
||||
|
||||
test('preserves existing identity while preferring fetched library context', () {
|
||||
final merged = mergeFetchedtestMediaItem(
|
||||
final merged = mergeFetchedMediaItem(
|
||||
fetched: item(serverId: 'fetched', serverName: 'Fetched', libraryId: 'new-lib', libraryTitle: 'New'),
|
||||
existing: item(serverId: 'existing', serverName: 'Existing', libraryId: 'old-lib', libraryTitle: 'Old'),
|
||||
fallbackServerId: ServerId('fallback'),
|
||||
@@ -38,7 +38,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('fills missing fetched library context from the existing item', () {
|
||||
final merged = mergeFetchedtestMediaItem(
|
||||
final merged = mergeFetchedMediaItem(
|
||||
fetched: item(),
|
||||
existing: item(libraryId: 'old-lib', libraryTitle: 'Old'),
|
||||
fallbackServerId: ServerId('fallback'),
|
||||
|
||||
@@ -217,7 +217,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('preserves Plex-only fields when omitted', () {
|
||||
const original = PlextestMediaItem(
|
||||
const original = PlexMediaItem(
|
||||
id: 'p1',
|
||||
kind: MediaKind.movie,
|
||||
title: 'Old',
|
||||
@@ -251,7 +251,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('preserves Jellyfin playlist item id when omitted', () {
|
||||
const original = JellyfintestMediaItem(
|
||||
const original = JellyfinMediaItem(
|
||||
id: 'j1',
|
||||
kind: MediaKind.movie,
|
||||
title: 'Old',
|
||||
@@ -277,7 +277,7 @@ void main() {
|
||||
|
||||
group('MediaItem JSON', () {
|
||||
test('round-trips Plex-only fields', () {
|
||||
const original = PlextestMediaItem(
|
||||
const original = PlexMediaItem(
|
||||
id: 'p1',
|
||||
kind: MediaKind.movie,
|
||||
title: 'Movie',
|
||||
@@ -328,12 +328,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('round-trips Jellyfin playlist item id', () {
|
||||
const original = JellyfintestMediaItem(
|
||||
id: 'j1',
|
||||
kind: MediaKind.movie,
|
||||
title: 'Movie',
|
||||
playlistItemId: 'entry-1',
|
||||
);
|
||||
const original = JellyfinMediaItem(id: 'j1', kind: MediaKind.movie, title: 'Movie', playlistItemId: 'entry-1');
|
||||
|
||||
final json = original.toJson();
|
||||
final decoded = MediaItem.fromJson(json);
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
import 'package:plezy/connection/connection.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/metadata_edit/jellyfin_metadata_edit_adapter.dart';
|
||||
import 'package:plezy/metadata_edit/metadata_edit_models.dart';
|
||||
|
||||
@@ -18,11 +18,12 @@ void main() {
|
||||
);
|
||||
|
||||
registry.attachNavigator(firstKey);
|
||||
firstKey.currentState!.push(MaterialPageRoute<void>(builder: (_) => const Text('second')));
|
||||
final pushedRoute = firstKey.currentState!.push(MaterialPageRoute<void>(builder: (_) => const Text('second')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('second'), findsOneWidget);
|
||||
|
||||
expect(await registry.maybePopProfileRoute(), isTrue);
|
||||
await pushedRoute;
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('second'), findsNothing);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:plezy/models/plex/play_queue_response.dart';
|
||||
import 'package:plezy/providers/playback_state_provider.dart';
|
||||
import '../test_helpers/media_items.dart';
|
||||
|
||||
PlexMediaItem _item(String ratingKey, int playQueueItemID) => PlextestMediaItem(
|
||||
PlexMediaItem _item(String ratingKey, int playQueueItemID) => PlexMediaItem(
|
||||
id: ratingKey,
|
||||
kind: MediaKind.episode,
|
||||
playQueueItemId: playQueueItemID,
|
||||
@@ -19,7 +19,7 @@ PlexMediaItem _item(String ratingKey, int playQueueItemID) => PlextestMediaItem(
|
||||
/// Episode queue entry carrying file identity, as Plex play-queue items do.
|
||||
/// Episodes of a multi-episode file (`S02E24-E25.mkv`) get *distinct* part
|
||||
/// ids (`part-<ratingKey>` here, mirroring real servers) but share [file].
|
||||
PlexMediaItem _itemWithFile(String ratingKey, int playQueueItemID, String file) => PlextestMediaItem(
|
||||
PlexMediaItem _itemWithFile(String ratingKey, int playQueueItemID, String file) => PlexMediaItem(
|
||||
id: ratingKey,
|
||||
kind: MediaKind.episode,
|
||||
playQueueItemId: playQueueItemID,
|
||||
@@ -33,7 +33,7 @@ PlexMediaItem _itemWithFile(String ratingKey, int playQueueItemID, String file)
|
||||
);
|
||||
|
||||
PlexMediaItem _miItem(String id, int playQueueItemId) =>
|
||||
PlextestMediaItem(id: id, kind: MediaKind.episode, playQueueItemId: playQueueItemId);
|
||||
PlexMediaItem(id: id, kind: MediaKind.episode, playQueueItemId: playQueueItemId);
|
||||
|
||||
PlayQueueResponse _queue({
|
||||
int playQueueID = 1,
|
||||
@@ -299,7 +299,7 @@ void main() {
|
||||
// A real-world non-queue item (e.g. tapped from media detail) carries
|
||||
// no `playQueueItemId` — that's how the helper distinguishes it from
|
||||
// a launcher-seeded queue member.
|
||||
final outsider = PlextestMediaItem(id: 'ep-different-show', kind: MediaKind.episode);
|
||||
final outsider = PlexMediaItem(id: 'ep-different-show', kind: MediaKind.episode);
|
||||
|
||||
await p.setPlaybackFromPlayQueue(
|
||||
_queue(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/ids.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/providers/watch_state_store.dart';
|
||||
import 'package:plezy/utils/watch_state_notifier.dart';
|
||||
|
||||
@@ -10,7 +10,6 @@ import 'package:plezy/services/catalog/catalog_source.dart';
|
||||
import 'package:plezy/services/catalog/trakt_catalog_source.dart';
|
||||
import 'package:plezy/services/trackers/tracker_session.dart';
|
||||
import 'package:plezy/services/trakt/trakt_client.dart';
|
||||
import '../../test_helpers/media_items.dart';
|
||||
|
||||
TrackerSession _session() {
|
||||
final now = DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
@@ -106,7 +105,7 @@ void main() {
|
||||
expect(show.rating, 8.5);
|
||||
expect(page.items[0].airStatus, isNull);
|
||||
|
||||
final rendered = page.items[0].totestMediaItem();
|
||||
final rendered = page.items[0].toMediaItem();
|
||||
expect(rendered.serverId, isNull);
|
||||
expect(rendered.title, 'The Matrix');
|
||||
expect(rendered.isCatalogItem, isTrue);
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:path_provider_platform_interface/path_provider_platform_interfac
|
||||
import 'package:plezy/exceptions/media_server_exceptions.dart';
|
||||
import 'package:plezy/media/download_resolution.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/services/download_artwork_helpers.dart';
|
||||
import 'package:plezy/services/download_artwork_service.dart';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/testing.dart';
|
||||
|
||||
import 'package:plezy/connection/connection.dart';
|
||||
import 'package:plezy/models/livetv_channel.dart';
|
||||
import 'package:plezy/services/jellyfin_client.dart';
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
import 'package:drift/native.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
|
||||
import 'package:plezy/connection/connection.dart';
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/services/jellyfin_api_cache.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:drift/native.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
import 'package:plezy/connection/connection.dart';
|
||||
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/media/ids.dart';
|
||||
import 'package:plezy/media/media_server_client.dart';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/services/local_playback_history.dart';
|
||||
import 'package:plezy/services/settings_service.dart';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/services/play_queue_launcher.dart';
|
||||
import 'package:plezy/services/plex_client.dart';
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/media/media_server_client.dart';
|
||||
import 'package:plezy/models/download_models.dart';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/media/media_version.dart';
|
||||
import 'package:plezy/models/transcode_quality_preset.dart';
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:plezy/media/ids.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/media/media_server_client.dart';
|
||||
import 'package:plezy/models/transcode_quality_preset.dart';
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/media/media_source_info.dart';
|
||||
import 'package:plezy/mpv/mpv.dart';
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/media/ids.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/models/transcode_quality_preset.dart';
|
||||
import 'package:plezy/services/playback_initialization_types.dart';
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/ids.dart';
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/services/watch_state_resolver.dart';
|
||||
import 'package:plezy/utils/watch_state_notifier.dart';
|
||||
|
||||
@@ -2,10 +2,9 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/database/app_database.dart';
|
||||
import 'package:plezy/models/download_models.dart';
|
||||
import 'package:plezy/utils/downloaded_version_match.dart';
|
||||
import '../test_helpers/media_items.dart';
|
||||
|
||||
DownloadedMediaItem _row({int mediaIndex = 0, String? mediaSourceId}) {
|
||||
return DownloadedtestMediaItem(
|
||||
return DownloadedMediaItem(
|
||||
id: 1,
|
||||
serverId: 'srv',
|
||||
ratingKey: 'movie-1',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/services/settings_service.dart';
|
||||
import 'package:plezy/utils/media_navigation_helper.dart';
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/media/media_version.dart';
|
||||
import 'package:plezy/services/settings_service.dart';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/screens/libraries/folder_tree_item.dart';
|
||||
import '../test_helpers/media_items.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:plezy/focus/focus_glow_overlay.dart';
|
||||
import 'package:plezy/focus/focus_theme.dart';
|
||||
import 'package:plezy/focus/input_mode_tracker.dart';
|
||||
import 'package:plezy/media/media_backend.dart';
|
||||
import 'package:plezy/media/media_item.dart';
|
||||
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/services/settings_service.dart';
|
||||
import 'package:plezy/theme/mono_theme.dart';
|
||||
|
||||
@@ -49,11 +49,7 @@ void main() {
|
||||
final profile = Profile.virtualPlexHome(connectionId: 'plex-1', homeUser: _homeUser(admin: false));
|
||||
|
||||
expect(
|
||||
isAdminActionAllowedFortestMediaItem(
|
||||
isOwnerOrAdmin: true,
|
||||
itemBackend: MediaBackend.plex,
|
||||
activeProfile: profile,
|
||||
),
|
||||
isAdminActionAllowedForMediaItem(isOwnerOrAdmin: true, itemBackend: MediaBackend.plex, activeProfile: profile),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
@@ -62,7 +58,7 @@ void main() {
|
||||
final profile = Profile.virtualPlexHome(connectionId: 'plex-1', homeUser: _homeUser(admin: false));
|
||||
|
||||
expect(
|
||||
isAdminActionAllowedFortestMediaItem(
|
||||
isAdminActionAllowedForMediaItem(
|
||||
isOwnerOrAdmin: true,
|
||||
itemBackend: MediaBackend.jellyfin,
|
||||
activeProfile: profile,
|
||||
@@ -75,11 +71,7 @@ void main() {
|
||||
final profile = Profile.virtualPlexHome(connectionId: 'plex-1', homeUser: _homeUser(admin: true));
|
||||
|
||||
expect(
|
||||
isAdminActionAllowedFortestMediaItem(
|
||||
isOwnerOrAdmin: true,
|
||||
itemBackend: MediaBackend.plex,
|
||||
activeProfile: profile,
|
||||
),
|
||||
isAdminActionAllowedForMediaItem(isOwnerOrAdmin: true, itemBackend: MediaBackend.plex, activeProfile: profile),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/widgets/video_controls/helpers/two_finger_double_tap_tracker.dart';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user