Files
plezy/lib/models/plex/plex_match_result.dart
T

41 lines
1.0 KiB
Dart
Raw Normal View History

import 'package:json_annotation/json_annotation.dart';
2026-04-26 02:34:09 +02:00
import '../../utils/json_utils.dart';
2026-04-23 19:02:14 +02:00
part 'plex_match_result.g.dart';
@JsonSerializable()
2026-04-23 19:02:14 +02:00
class PlexMatchResult {
@JsonKey(readValue: readStringField, defaultValue: '')
2026-04-23 19:02:14 +02:00
final String guid;
@JsonKey(readValue: readStringField, defaultValue: '')
2026-04-23 19:02:14 +02:00
final String name;
@JsonKey(fromJson: flexibleInt)
2026-04-23 19:02:14 +02:00
final int? year;
@JsonKey(fromJson: flexibleInt)
2026-04-23 19:02:14 +02:00
final int? score;
@JsonKey(readValue: readStringField)
2026-04-23 19:02:14 +02:00
final String? thumb;
@JsonKey(readValue: readStringField)
2026-04-23 19:02:14 +02:00
final String? summary;
@JsonKey(readValue: readStringField)
2026-04-23 19:02:14 +02:00
final String? type;
@JsonKey(fromJson: flexibleBool)
2026-04-23 19:02:14 +02:00
final bool matched;
PlexMatchResult({
required this.guid,
required this.name,
this.year,
this.score,
this.thumb,
this.summary,
this.type,
this.matched = false,
});
factory PlexMatchResult.fromJson(Map<String, dynamic> json) => _$PlexMatchResultFromJson(json);
Map<String, dynamic> toJson() => _$PlexMatchResultToJson(this);
2026-04-23 19:02:14 +02:00
}