feat: add totalTracks to Track model and refine EP/single classification (#202)

This commit is contained in:
zarzet
2026-03-11 01:14:12 +07:00
parent f2ae1398db
commit 8d45e023b2
6 changed files with 41 additions and 10 deletions
@@ -2362,6 +2362,7 @@ class DownloadQueueNotifier extends Notifier<DownloadQueueState> {
deezerId: baseTrack.deezerId,
availability: baseTrack.availability,
albumType: baseTrack.albumType,
totalTracks: baseTrack.totalTracks,
source: baseTrack.source,
);
}
@@ -3274,6 +3275,8 @@ class DownloadQueueNotifier extends Notifier<DownloadQueueState> {
albumType:
(data['album_type'] as String?) ??
trackToDownload.albumType,
totalTracks:
data['total_tracks'] as int? ?? trackToDownload.totalTracks,
source: trackToDownload.source,
);
_log.d(
@@ -3488,6 +3491,7 @@ class DownloadQueueNotifier extends Notifier<DownloadQueueState> {
deezerId: deezerTrackId,
availability: trackToDownload.availability,
albumType: trackToDownload.albumType,
totalTracks: trackToDownload.totalTracks,
source: trackToDownload.source,
);
_log.d(
+4
View File
@@ -816,6 +816,7 @@ class TrackNotifier extends Notifier<TrackState> {
discNumber: track.discNumber,
releaseDate: track.releaseDate,
albumType: track.albumType,
totalTracks: track.totalTracks,
source: track.source,
availability: ServiceAvailability(
tidal: availability['tidal'] as bool? ?? false,
@@ -897,6 +898,8 @@ class TrackNotifier extends Notifier<TrackState> {
trackNumber: data['track_number'] as int?,
discNumber: data['disc_number'] as int?,
releaseDate: data['release_date'] as String?,
albumType: data['album_type'] as String?,
totalTracks: data['total_tracks'] as int?,
);
}
@@ -919,6 +922,7 @@ class TrackNotifier extends Notifier<TrackState> {
trackNumber: data['track_number'] as int?,
discNumber: data['disc_number'] as int?,
releaseDate: data['release_date']?.toString(),
totalTracks: data['total_tracks'] as int?,
source:
source ??
data['source']?.toString() ??