feat(flutter): SystemPlaylistsStatus model + endpoint method
Adds the model + MeApi.systemPlaylistsStatus() for the home Playlists row's placeholder-variant logic (building / failed / pending / seed-needed). Mirrors GET /api/me/system-playlists-status which returns the caller's most recent system_playlist_runs row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/// Mirrors `systemPlaylistsStatusResp` from internal/api/me_system_playlists.go.
|
||||
/// Reflects the caller's most recent system_playlist_runs row, or zero
|
||||
/// values when no row exists yet (the user has never had a build attempted).
|
||||
class SystemPlaylistsStatus {
|
||||
const SystemPlaylistsStatus({
|
||||
required this.inFlight,
|
||||
this.lastRunAt,
|
||||
this.lastError,
|
||||
});
|
||||
|
||||
final bool inFlight;
|
||||
final String? lastRunAt;
|
||||
final String? lastError;
|
||||
|
||||
factory SystemPlaylistsStatus.empty() =>
|
||||
const SystemPlaylistsStatus(inFlight: false);
|
||||
|
||||
factory SystemPlaylistsStatus.fromJson(Map<String, dynamic> j) =>
|
||||
SystemPlaylistsStatus(
|
||||
inFlight: j['in_flight'] as bool? ?? false,
|
||||
lastRunAt: j['last_run_at'] as String?,
|
||||
lastError: j['last_error'] as String?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user