Files
plezy/lib/models/seerr/seerr_public_settings.dart
T
edde746 a029b1a7c8 fix(seerr): decode media status per product and model failed/completed request states
Jellyseerr shifts MediaStatus codes 6/7 relative to Overseerr (6=blocklisted, 7=deleted vs 6=deleted), and the shared unconditional mapping misread both. The product is now detected from the presence of mediaServerType in /settings/public, persisted on the session, and used to resolve raw wire codes; blocklisted titles are shown as non-requestable.

Request statuses failed(4) and completed(5) previously decoded as pending, blocking re-requests and mislabeling failures; both are now modeled and active requests are defined positively as pending or approved. Seerr also marks a request Failed on arr-push failure while leaving the media status Processing, and precedence checked processing first, so failed titles rendered as Processing and the request sheet kept blocking re-requests; a failed request with no live pending/approved request now wins over stale pipeline status in both the catalog state and the sheet's blocked labels.

Reauthentication completing from a stale session snapshot wholesale-replaced the session and could downgrade a concurrently detected product discriminator back to unknown permanently (the settings cache never reapplies it); adoption now merges the known product.
2026-08-21 19:23:42 +02:00

52 lines
1.8 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
import 'seerr_session.dart';
part 'seerr_public_settings.g.dart';
/// `GET /settings/public` — unauthenticated instance metadata. The connect
/// flow keys the offered sign-in methods off it; the request sheet keys the
/// 4K toggle and per-season selection off it.
@JsonSerializable(createToJson: false)
class SeerrPublicSettings {
final bool initialized;
final String? applicationTitle;
/// Whether `/auth/local` is enabled.
final bool localLogin;
/// Whether signing in through the linked media server is enabled.
final bool mediaServerLogin;
/// `SeerrMediaServerType` of the linked media server.
final int? mediaServerType;
final bool movie4kEnabled;
final bool series4kEnabled;
/// Whether users may request individual seasons rather than whole shows.
final bool partialRequestsEnabled;
const SeerrPublicSettings({
this.initialized = false,
this.applicationTitle,
this.localLogin = true,
this.mediaServerLogin = true,
this.mediaServerType,
this.movie4kEnabled = false,
this.series4kEnabled = false,
this.partialRequestsEnabled = true,
});
String get instanceLabel => (applicationTitle?.isNotEmpty ?? false) ? applicationTitle! : 'Seerr';
/// Which product answered the probe. Jellyseerr/Seerr always include a
/// numeric `mediaServerType` (4 = NOT_CONFIGURED even before setup);
/// Overseerr's `FullPublicSettings` has no such key, so key presence is the
/// only trustworthy discriminator — titles and version strings are
/// user-editable.
SeerrProduct get product => mediaServerType != null ? SeerrProduct.jellyseerr : SeerrProduct.overseerr;
factory SeerrPublicSettings.fromJson(Map<String, dynamic> json) => _$SeerrPublicSettingsFromJson(json);
}