Fixed advent mode and persistence stuff.
This commit is contained in:
@ -317,12 +317,19 @@ void Playlist::shuffle(uint8_t random_offset) {
|
||||
}
|
||||
|
||||
void Playlist::advent_shuffle(uint8_t day) {
|
||||
if (day > 24) day = 24;
|
||||
TRACE("advent_shuffle running...\n");
|
||||
|
||||
// Not enough songs till the current day? Play all songs in the default order.
|
||||
if (day > _files.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We are in the "different playlist every day" mode. So we don't persist it in order to not miss changes.
|
||||
persistence = PERSIST_NONE;
|
||||
|
||||
if (day > _files.size()) return;
|
||||
|
||||
_files.insert(_files.begin(), _files[day - 1]);
|
||||
_files.erase(_files.begin() + day - 1, _files.end());
|
||||
_files.erase(_files.begin() + day, _files.end());
|
||||
}
|
||||
|
||||
void Playlist::reset() {
|
||||
|
Reference in New Issue
Block a user