feat(flutter): library screen with 5 tabs (Artists/Albums/History/Liked/Hidden)
Models: - history_event.dart (HistoryEvent + HistoryPage envelope) - quarantine_mine.dart (QuarantineMineRow for /api/quarantine/mine) - Renamed Page<T> -> Paged<T> to avoid collision with Material's Page Endpoints: - library_lists.dart: listArtists / listAlbums (paged) - me.dart: history + quarantineMine - likes.dart: extended with listTracks/Albums/Artists (paged) UI: - library_screen.dart: TabBar over 5 tabs - Artists tab: 3-col grid - Albums tab: 2-col grid - History tab: list with relative-time formatting (matches HistoryRow.svelte) - Liked tab: 3 stacked sections (artists scroll-row, albums scroll-row, tracks list) - Hidden tab: list of quarantined tracks with reason pill - /library route + library_music icon on home AppBar First page only for v1 (limit 50). Infinite scroll deferred.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/// Mirrors web/src/lib/api/types.ts LidarrQuarantineMineRow. One row
|
||||
/// per quarantined track owned by the caller. Server returns a flat
|
||||
/// list (no Page envelope) at /api/quarantine/mine.
|
||||
class QuarantineMineRow {
|
||||
const QuarantineMineRow({
|
||||
required this.trackId,
|
||||
required this.reason,
|
||||
this.notes,
|
||||
required this.createdAt,
|
||||
required this.trackTitle,
|
||||
required this.trackDurationMs,
|
||||
required this.albumId,
|
||||
required this.albumTitle,
|
||||
this.albumCoverArtPath,
|
||||
required this.artistId,
|
||||
required this.artistName,
|
||||
});
|
||||
|
||||
final String trackId;
|
||||
/// One of: bad_rip / wrong_file / wrong_tags / duplicate / other.
|
||||
final String reason;
|
||||
final String? notes;
|
||||
final String createdAt;
|
||||
final String trackTitle;
|
||||
final int trackDurationMs;
|
||||
final String albumId;
|
||||
final String albumTitle;
|
||||
final String? albumCoverArtPath;
|
||||
final String artistId;
|
||||
final String artistName;
|
||||
|
||||
factory QuarantineMineRow.fromJson(Map<String, dynamic> j) =>
|
||||
QuarantineMineRow(
|
||||
trackId: j['track_id'] as String? ?? '',
|
||||
reason: j['reason'] as String? ?? 'other',
|
||||
notes: j['notes'] as String?,
|
||||
createdAt: j['created_at'] as String? ?? '',
|
||||
trackTitle: j['track_title'] as String? ?? '',
|
||||
trackDurationMs: (j['track_duration_ms'] as num?)?.toInt() ?? 0,
|
||||
albumId: j['album_id'] as String? ?? '',
|
||||
albumTitle: j['album_title'] as String? ?? '',
|
||||
albumCoverArtPath: j['album_cover_art_path'] as String?,
|
||||
artistId: j['artist_id'] as String? ?? '',
|
||||
artistName: j['artist_name'] as String? ?? '',
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user