|
54 | 54 |
|
55 | 55 | (ert-deftest libmpdel-test-artist () |
56 | 56 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
57 | | - (album (libmpdel--album-create :name "The Album" :artist artist)) |
58 | | - (song (libmpdel--song-create :name "The song" :album album))) |
| 57 | + (album (libmpdel--album-create :name "The Album" :artists (list artist))) |
| 58 | + (song (libmpdel--song-create :name "The song" :album album :artists (list artist)))) |
59 | 59 | (should (equal artist (libmpdel-artist artist))) |
60 | 60 | (should (equal artist (libmpdel-artist album))) |
61 | 61 | (should (equal artist (libmpdel-artist song))))) |
62 | 62 |
|
63 | 63 | (ert-deftest libmpdel-test-artist-name () |
64 | 64 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
65 | | - (album (libmpdel--album-create :name "The Album" :artist artist)) |
| 65 | + (album (libmpdel--album-create :name "The Album" :artists (list artist))) |
66 | 66 | (song (libmpdel--song-create :name "The song" :album album))) |
67 | 67 | (should (equal "The Artist" (libmpdel-artist-name artist))) |
68 | 68 | (should (equal "The Artist" (libmpdel-artist-name album))) |
69 | 69 | (should (equal "The Artist" (libmpdel-artist-name song))))) |
70 | 70 |
|
71 | 71 | (ert-deftest libmpdel-test-album-name () |
72 | 72 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
73 | | - (album (libmpdel--album-create :name "The Album" :artist artist)) |
| 73 | + (album (libmpdel--album-create :name "The Album" :artists (list artist))) |
74 | 74 | (song (libmpdel--song-create :name "The song" :album album))) |
75 | 75 | (should-error (libmpdel-album-name artist)) |
76 | 76 | (should (equal "The Album" (libmpdel-album-name album))) |
77 | 77 | (should (equal "The Album" (libmpdel-album-name song))))) |
78 | 78 |
|
79 | 79 | (ert-deftest libmpdel-test-album () |
80 | 80 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
81 | | - (album (libmpdel--album-create :name "The Album" :artist artist)) |
| 81 | + (album (libmpdel--album-create :name "The Album" :artists (list artist))) |
82 | 82 | (song (libmpdel--song-create :name "The song" :album album))) |
83 | 83 | (should-error (libmpdel-album artist)) |
84 | 84 | (should (equal album (libmpdel-album album))) |
85 | 85 | (should (equal album (libmpdel-album song))))) |
86 | 86 |
|
87 | 87 | (ert-deftest libmpdel-test-entity-name () |
88 | 88 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
89 | | - (album (libmpdel--album-create :name "The Album" :artist artist)) |
| 89 | + (album (libmpdel--album-create :name "The Album" :artists (list artist))) |
90 | 90 | (song (libmpdel--song-create :name "The song" :album album)) |
91 | 91 | (stored-playlist (libmpdel--stored-playlist-create :name "The playlist"))) |
92 | 92 | (should (equal "The Artist" (libmpdel-entity-name artist))) |
|
101 | 101 |
|
102 | 102 | (ert-deftest libmpdel-test-entity-parent () |
103 | 103 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
104 | | - (album (libmpdel--album-create :name "The Album" :artist artist)) |
| 104 | + (album (libmpdel--album-create :name "The Album" :artists (list artist))) |
105 | 105 | (song (libmpdel--song-create :name "The song" :album album)) |
106 | 106 | (stored-playlist (libmpdel--stored-playlist-create :name "The playlist"))) |
107 | 107 | (should (equal 'artists (libmpdel-entity-parent artist))) |
|
118 | 118 | (file . "foo/song.ogg") |
119 | 119 | (Date . "1970-01-01") |
120 | 120 | (Album . "The Album") |
| 121 | + (AlbumArtist . "The Albumartist") |
121 | 122 | (Genre . "The Genre") |
122 | 123 | (Artist . "The Artist"))))) |
123 | 124 | (should (equal "The song" (libmpdel-entity-name song))) |
|
126 | 127 | (should (equal "1970-01-01" (libmpdel-entity-date (libmpdel-album song)))) |
127 | 128 | (should (equal (list "The Genre") (mapcar #'libmpdel-entity-name (libmpdel-genres song)))) |
128 | 129 | (should (equal "The Album" (libmpdel-entity-name (libmpdel-album song)))) |
129 | | - (should (equal "The Artist" (libmpdel-entity-name (libmpdel-artist (libmpdel-album song))))))) |
| 130 | + (should (equal "The Albumartist" (libmpdel-entity-name (libmpdel-artist (libmpdel-album song))))))) |
130 | 131 |
|
131 | 132 | (ert-deftest libmpdel-test-current-playlist-p () |
132 | 133 | (should (libmpdel-current-playlist-p 'current-playlist)) |
|
274 | 275 |
|
275 | 276 | (ert-deftest libmpdel-test-playlist-add-no-string-id-sends-findadd () |
276 | 277 | (let* ((artist (libmpdel--artist-create :name "The Artist")) |
277 | | - (album (libmpdel--album-create :name "The Album" :artist artist))) |
| 278 | + (album (libmpdel--album-create :name "The Album" :artists (list artist)))) |
278 | 279 | (libmpdel-test--with-connection |
279 | 280 | (libmpdel-playlist-add album 'current-playlist) |
280 | | - (should (equal '("findadd artist \"The Artist\" album \"The Album\"") |
| 281 | + (should (equal '("findadd albumartist \"The Artist\" album \"The Album\"") |
281 | 282 | (last commands)))))) |
282 | 283 |
|
283 | 284 | (ert-deftest libmpdel-test-playlist-add-sends-findadd () |
284 | 285 | (let ((song (libmpdel--create-song-from-data |
285 | 286 | '((Title . "S") |
286 | 287 | (Album . "A") |
| 288 | + (AlbumArtist . "Art") |
| 289 | + (AlbumArtist . "Bart") |
287 | 290 | (Artist . "Art"))))) |
288 | 291 | (libmpdel-test--with-connection |
289 | 292 | (libmpdel-playlist-add song 'current-playlist) |
290 | | - (should (equal '("findadd artist \"Art\" album \"A\" title \"S\"") |
| 293 | + (should (equal '("findadd albumartist \"Art\" albumartist \"Bart\" album \"A\" title \"S\"") |
291 | 294 | (last commands)))))) |
292 | 295 |
|
293 | 296 |
|
|
328 | 331 | (let* ((artist1 (libmpdel--artist-create :name "artist1")) |
329 | 332 | (artist1-bis (libmpdel--artist-create :name "artist1")) |
330 | 333 | (artist2 (libmpdel--artist-create :name "artist2")) |
331 | | - (album1 (libmpdel--album-create :name "album1" :artist artist1)) |
332 | | - (album1-bis (libmpdel--album-create :name "album1" :artist artist1)) |
333 | | - (album2 (libmpdel--album-create :name "album2" :artist artist1)) |
| 334 | + (album1 (libmpdel--album-create :name "album1" :artists (list artist1))) |
| 335 | + (album1-bis (libmpdel--album-create :name "album1" :artists (list artist1))) |
| 336 | + (album2 (libmpdel--album-create :name "album2" :artists (list artist1))) |
334 | 337 | (song1 (libmpdel--song-create |
335 | 338 | :name "name" |
336 | 339 | :file "file" |
|
0 commit comments