Recording indicators never appeared in the EPG and the program sheet kept offering "Record" for already-subscribed programmes, so rules were created repeatedly (nine duplicate subscriptions in the linked report). Two defects, both confirmed against the official web client bundle: - The sheet's scheduled-state check called /media/providers/<identifier>/media/subscriptions/mapping/<ratingKey>, which 404s: PMS mounts that route under the numeric MediaProvider id from /media/providers. The check failed instantly and unconditionally on every platform, so the button always read "Record". - The guide derived its dot solely from cross-matching grab metadata, and the grab refresh issued right after scheduling raced the server materializing the grab, wiping the optimistic key before one frame showed. The grid response already tags subscribed airings with subscriptionID / grandparentSubscriptionID - the signal the official client renders from. LiveTvProgram now carries those attributes; the guide checks them first (grab matching stays as the secondary signal) and keeps local schedule/cancel actions authoritative until the next grid load. The sheet resolves Record vs Manage from the tagged rule key without a network call, falling back to the fixed numeric-id mapping route for untagged airings. Grab parsing also accepts the nested airing under "Video", which PMS uses for every non-scheduled grab status in JSON. close #2009
59 lines
2.3 KiB
Dart
59 lines
2.3 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'media_subscription.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
SubscriptionTemplate _$SubscriptionTemplateFromJson(
|
|
Map<String, dynamic> json,
|
|
) => SubscriptionTemplate(
|
|
subscriptions: json['MediaSubscription'] == null
|
|
? const []
|
|
: _parseSubscriptions(json['MediaSubscription']),
|
|
);
|
|
|
|
MediaSubscription _$MediaSubscriptionFromJson(Map<String, dynamic> json) =>
|
|
MediaSubscription(
|
|
key: _readSubscriptionKey(json, 'key') as String? ?? '',
|
|
type: flexibleInt(json['type']),
|
|
provider: json['provider'] as String?,
|
|
targetLibrarySectionID: flexibleInt(json['targetLibrarySectionID']),
|
|
targetSectionLocationID: flexibleInt(json['targetSectionLocationID']),
|
|
title: json['title'] as String?,
|
|
selected: flexibleBoolNullable(json['selected']),
|
|
parameters: json['parameters'] as String?,
|
|
createdAt: flexibleInt(json['createdAt']),
|
|
storageTotal: flexibleInt(json['storageTotal']),
|
|
durationTotal: flexibleInt(json['durationTotal']),
|
|
airingsType: json['airingsType'] as String?,
|
|
librarySectionTitle: json['librarySectionTitle'] as String?,
|
|
locationPath: json['locationPath'] as String?,
|
|
video: _mapFromJson(json['Video']),
|
|
directory: _mapFromJson(json['Directory']),
|
|
playlist: _mapFromJson(json['Playlist']),
|
|
settings: json['Setting'] == null
|
|
? const []
|
|
: _parseSettings(json['Setting']),
|
|
grabOperations: json['MediaGrabOperation'] == null
|
|
? const []
|
|
: _parseGrabOperations(json['MediaGrabOperation']),
|
|
);
|
|
|
|
SubscriptionSetting _$SubscriptionSettingFromJson(Map<String, dynamic> json) =>
|
|
SubscriptionSetting(
|
|
id: json['id'] as String? ?? '',
|
|
label: json['label'] as String?,
|
|
summary: json['summary'] as String?,
|
|
type: json['type'] as String?,
|
|
defaultValue: json['default'],
|
|
value: json['value'],
|
|
hidden: json['hidden'] == null ? false : flexibleBool(json['hidden']),
|
|
advanced: json['advanced'] == null
|
|
? false
|
|
: flexibleBool(json['advanced']),
|
|
group: json['group'] as String?,
|
|
enumValues: json['enumValues'] as String?,
|
|
);
|