Separate metadata from collections #209

Merged
wojtek merged 6 commits from 187---make-fetch-asynchronous into main 2024-08-31 22:55:25 +02:00
2 changed files with 9 additions and 4 deletions
Showing only changes of commit 13a31e0d7f - Show all commits

View File

@ -316,6 +316,7 @@ mod tests {
assert_ne!(album_1, album_2); assert_ne!(album_1, album_2);
assert!(album_1 < album_2); assert!(album_1 < album_2);
assert!(album_1.meta < album_2.meta);
} }
#[test] #[test]

View File

@ -257,6 +257,8 @@ mod tests {
assert_eq!(artist.get_sort_key(), (&artist_id,)); assert_eq!(artist.get_sort_key(), (&artist_id,));
assert!(artist < Artist::new(sort_id_1.clone())); assert!(artist < Artist::new(sort_id_1.clone()));
assert!(artist < Artist::new(sort_id_2.clone())); assert!(artist < Artist::new(sort_id_2.clone()));
assert!(artist.meta < ArtistMeta::new(sort_id_1.clone()));
assert!(artist.meta < ArtistMeta::new(sort_id_2.clone()));
artist.set_sort_key(sort_id_1.clone()); artist.set_sort_key(sort_id_1.clone());
@ -265,22 +267,24 @@ mod tests {
assert_eq!(artist.get_sort_key(), (&sort_id_1,)); assert_eq!(artist.get_sort_key(), (&sort_id_1,));
assert!(artist > Artist::new(artist_id.clone())); assert!(artist > Artist::new(artist_id.clone()));
assert!(artist < Artist::new(sort_id_2.clone())); assert!(artist < Artist::new(sort_id_2.clone()));
assert!(artist.meta > ArtistMeta::new(artist_id.clone()));
assert!(artist.meta < ArtistMeta::new(sort_id_2.clone()));
artist.set_sort_key(sort_id_2.clone()); artist.set_sort_key(sort_id_2.clone());
assert_eq!(artist.meta.id, artist_id); assert_eq!(artist.meta.id, artist_id);
assert_eq!(artist.meta.sort.as_ref(), Some(&sort_id_2)); assert_eq!(artist.meta.sort.as_ref(), Some(&sort_id_2));
assert_eq!(artist.get_sort_key(), (&sort_id_2,)); assert_eq!(artist.get_sort_key(), (&sort_id_2,));
assert!(artist > Artist::new(artist_id.clone())); assert!(artist.meta > ArtistMeta::new(artist_id.clone()));
assert!(artist > Artist::new(sort_id_1.clone())); assert!(artist.meta > ArtistMeta::new(sort_id_1.clone()));
artist.clear_sort_key(); artist.clear_sort_key();
assert_eq!(artist.meta.id, artist_id); assert_eq!(artist.meta.id, artist_id);
assert_eq!(artist.meta.sort, None); assert_eq!(artist.meta.sort, None);
assert_eq!(artist.get_sort_key(), (&artist_id,)); assert_eq!(artist.get_sort_key(), (&artist_id,));
assert!(artist < Artist::new(sort_id_1.clone())); assert!(artist.meta < ArtistMeta::new(sort_id_1.clone()));
assert!(artist < Artist::new(sort_id_2.clone())); assert!(artist.meta < ArtistMeta::new(sort_id_2.clone()));
} }
#[test] #[test]