Skip to content

Commit

Permalink
refactor: save queue even if it is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Jan 11, 2024
1 parent fc971c5 commit c902efc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ data class Song(
val genreSeparators = symphony.settings.genreTagSeparators.value
return AdditionalMetadata(
albumArtists = attributes.albumArtist
?.let { Song.parseMultiValue(it, artistSeparators) }
?.let { parseMultiValue(it, artistSeparators) }
?: setOf(),
bitrate = attributes.bitrate,
genres = attributes.genre
?.let { Song.parseMultiValue(it, genreSeparators) }
?.let { parseMultiValue(it, genreSeparators) }
?: setOf(),
bitsPerSample = attributes.bitsPerSample,
samplingRate = attributes.samplingRate,
Expand Down Expand Up @@ -161,9 +161,9 @@ data class Song(
duration = shorty.getLong(AudioColumns.DURATION),
album = shorty.getStringNullable(AudioColumns.ALBUM),
artists = shorty.getStringNullable(AudioColumns.ARTIST)
?.let { Song.parseMultiValue(it, artistSeparators) } ?: setOf(),
?.let { parseMultiValue(it, artistSeparators) } ?: setOf(),
composers = shorty.getStringNullable(AudioColumns.COMPOSER)
?.let { Song.parseMultiValue(it, artistSeparators) } ?: setOf(),
?.let { parseMultiValue(it, artistSeparators) } ?: setOf(),
dateAdded = shorty.getLong(AudioColumns.DATE_ADDED),
dateModified = dateModified,
size = shorty.getLong(AudioColumns.SIZE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ class Radio(private val symphony: Symphony) : SymphonyHooks {
}

private fun saveCurrentQueue() {
if (queue.isEmpty()) return
symphony.settings.setPreviousSongQueue(
RadioQueue.Serialized.create(
queue = queue,
Expand Down

0 comments on commit c902efc

Please sign in to comment.