// playlist-name playlist exists-or-not
// | | |
// v v v
struct Playlists(BTreeMap<String, VecDeque<PlaylistEntry>>);
where PlaylistEntry is an enum:
enum PlaylistEntry {
// This is a known song in the current `Collection`
Key(SongKey),
// This song is missing, this was the
// artist name, album title, song title.
Missing((Arc<str>, Arc<str>, Arc<str>)),
}
Lifetime
Playlists has no lifetime relation to Collection.
Each SongKey is shukusai::validate'd on startup
After Collection resets, missing keys are marked as such, and saved indefinitely
After Collection resets, if missing objects are found, they are recovered
Missing
A Collection across resets may not be the same, and even given the same inputs/files, the indices are not stable.
Songs that have have non-matching metadata in the current Collection will indefinitely be Missing, and will only recover to Key form after a Collection reset brings songs in that match that metadata.
What
Branch implementing playlists.
Closes https://github.com/hinto-janai/festival/issues/4.
Definition
where
PlaylistEntry
is an enum:Lifetime
Playlists
has no lifetime relation toCollection
.SongKey
isshukusai::validate
'd on startupCollection
resets, missing keys are marked as such, and saved indefinitelyCollection
resets, if missing objects are found, they are recoveredMissing
A
Collection
across resets may not be the same, and even given the same inputs/files, the indices are not stable.Upon a
Collection
reset, playlists will:Artist
,Album
andSong
names byArc<str>
Collection
reset, use the newMap
to reconnect those names with the new indicesSongs that have have non-matching metadata in the current
Collection
will indefinitely beMissing
, and will only recover toKey
form after aCollection
reset brings songs in that match that metadata.