fix(jellyfin): hide unsupported continue watching removal

close #995
This commit is contained in:
edde746
2026-05-09 04:41:13 +02:00
parent 5d2302b322
commit c38c0cf55d
5 changed files with 33 additions and 14 deletions
+17 -2
View File
@@ -399,7 +399,6 @@ void main() {
await scoped.fetchClientSideEpisodeQueue('folder/show #1?x');
await scoped.markWatched(item);
await scoped.markUnwatched(item);
await scoped.removeFromContinueWatching(item);
await scoped.rate(item, 7);
await scoped.rate(item, -1);
@@ -408,10 +407,26 @@ void main() {
expect(paths, contains('/Shows/folder%2Fshow%20%231%3Fx/Episodes'));
expect(paths, contains('/UserPlayedItems/folder%2Fitem%20%231%3Fx'));
expect(paths.where((p) => p == '/UserPlayedItems/folder%2Fitem%20%231%3Fx'), hasLength(2));
expect(paths, contains('/UserItems/folder%2Fitem%20%231%3Fx/HideFromResume'));
expect(paths.where((p) => p == '/UserItems/folder%2Fitem%20%231%3Fx/Rating'), hasLength(2));
});
test('removeFromContinueWatching is unsupported for Jellyfin and does not call the server', () async {
var requested = false;
final scoped = JellyfinClient.forTesting(
connection: _conn(),
httpClient: MockClient((request) async {
requested = true;
return http.Response('', 500);
}),
);
addTearDown(scoped.close);
final item = MediaItem(id: 'item-1', backend: MediaBackend.jellyfin, kind: MediaKind.movie, serverId: 'srv-1');
await expectLater(scoped.removeFromContinueWatching(item), throwsA(isA<UnsupportedError>()));
expect(requested, isFalse);
});
test('getPlaybackInitialization URL-encodes appended api_key', () async {
final scoped = JellyfinClient.forTesting(
connection: _conn(accessToken: 'tok+with spaces/?&'),