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:
2026-05-09 11:36:15 -04:00
parent 5613fec5ef
commit d872a30506
2 changed files with 35 additions and 0 deletions
+11
View File
@@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
import '../../models/history_event.dart';
import '../../models/quarantine_mine.dart';
import '../../models/system_playlists_status.dart';
/// /api/me/* endpoints — caller-scoped data (history, profile, etc.).
class MeApi {
@@ -27,4 +28,14 @@ class MeApi {
QuarantineMineRow.fromJson((e as Map).cast<String, dynamic>()))
.toList(growable: false);
}
/// GET /api/me/system-playlists-status. Returns the caller's most
/// recent system-playlist build state. Used by the home Playlists
/// row to choose between real and placeholder cards.
Future<SystemPlaylistsStatus> systemPlaylistsStatus() async {
final r = await _dio.get<Map<String, dynamic>>(
'/api/me/system-playlists-status',
);
return SystemPlaylistsStatus.fromJson(r.data ?? const {});
}
}