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

31 lines
811 B
Dart
Raw Normal View History

import 'package:json_annotation/json_annotation.dart';
part 'plex_activity.g.dart';
2026-03-25 11:33:01 -04:00
/// Represents a running background task on a Plex Media Server (from /activities endpoint).
@JsonSerializable(createToJson: false)
2026-03-25 11:33:01 -04:00
class PlexActivity {
@JsonKey(defaultValue: '')
2026-03-25 11:33:01 -04:00
final String uuid;
@JsonKey(defaultValue: '')
2026-03-25 11:33:01 -04:00
final String type;
@JsonKey(defaultValue: '')
2026-03-25 11:33:01 -04:00
final String title;
final String? subtitle;
@JsonKey(defaultValue: 0)
2026-03-25 11:33:01 -04:00
final int progress; // 0–100
@JsonKey(defaultValue: false)
2026-03-25 11:33:01 -04:00
final bool cancellable;
const PlexActivity({
required this.uuid,
required this.type,
required this.title,
this.subtitle,
required this.progress,
required this.cancellable,
});
factory PlexActivity.fromJson(Map<String, dynamic> json) => _$PlexActivityFromJson(json);
2026-03-25 11:33:01 -04:00
}