fix(music): keep now playing state current

close #1600
This commit is contained in:
edde746
2026-07-17 16:30:10 +02:00
parent 5b90c4bca0
commit 70cd7e8c67
18 changed files with 741 additions and 67 deletions
+14
View File
@@ -15,6 +15,7 @@ import '../test_helpers/media_items.dart';
MediaItem _movie({
String id = 'm1',
String? title = 'Movie',
int? year,
int? viewCount,
int? leafCount,
int? viewedLeafCount,
@@ -29,6 +30,7 @@ MediaItem _movie({
backend: backend,
kind: MediaKind.movie,
title: title,
year: year,
viewCount: viewCount,
leafCount: leafCount,
viewedLeafCount: viewedLeafCount,
@@ -446,4 +448,16 @@ void main() {
expect(movie.displayTitle, '');
});
});
group('MediaItem music metadata', () {
test('album year is exposed only for tracks and albums', () {
final track = testMediaItem(kind: MediaKind.track, parentTitle: 'Album', year: 2001);
final album = testMediaItem(kind: MediaKind.album, title: 'Album', year: 2001);
expect(track.albumTitle, 'Album');
expect(track.albumYear, 2001);
expect(album.albumYear, 2001);
expect(_movie(year: 2001).albumYear, isNull);
});
});
}