music: fix incorrect cache fields
Fix incorrectly populated cache fields.
This commit is contained in:
parent
57ed102cda
commit
6db50a0e45
3 changed files with 5 additions and 5 deletions
|
@ -48,6 +48,7 @@ audio focus was lost
|
||||||
|
|
||||||
#### Dev/Meta
|
#### Dev/Meta
|
||||||
- Created new wiki with more information about app functionality
|
- Created new wiki with more information about app functionality
|
||||||
|
- Switched to issue forms
|
||||||
- Completed migration to reactive playback system
|
- Completed migration to reactive playback system
|
||||||
- Refactor music backends into a unified chain of extractors
|
- Refactor music backends into a unified chain of extractors
|
||||||
- Add bluetooth connection reciever (No functionality in app yet)
|
- Add bluetooth connection reciever (No functionality in app yet)
|
||||||
|
|
|
@ -23,7 +23,6 @@ import android.database.sqlite.SQLiteDatabase
|
||||||
import android.database.sqlite.SQLiteOpenHelper
|
import android.database.sqlite.SQLiteOpenHelper
|
||||||
import androidx.core.database.getIntOrNull
|
import androidx.core.database.getIntOrNull
|
||||||
import androidx.core.database.getStringOrNull
|
import androidx.core.database.getStringOrNull
|
||||||
import java.io.File
|
|
||||||
import org.oxycblt.auxio.music.Song
|
import org.oxycblt.auxio.music.Song
|
||||||
import org.oxycblt.auxio.util.*
|
import org.oxycblt.auxio.util.*
|
||||||
|
|
||||||
|
@ -247,7 +246,7 @@ private class CacheDatabase(context: Context) :
|
||||||
cursor.getColumnIndexOrThrow(Columns.ALBUM_MUSIC_BRAINZ_ID)
|
cursor.getColumnIndexOrThrow(Columns.ALBUM_MUSIC_BRAINZ_ID)
|
||||||
val albumNameIndex = cursor.getColumnIndexOrThrow(Columns.ALBUM_NAME)
|
val albumNameIndex = cursor.getColumnIndexOrThrow(Columns.ALBUM_NAME)
|
||||||
val albumSortNameIndex = cursor.getColumnIndexOrThrow(Columns.ALBUM_SORT_NAME)
|
val albumSortNameIndex = cursor.getColumnIndexOrThrow(Columns.ALBUM_SORT_NAME)
|
||||||
val albumReleaseTypesIndex = cursor.getColumnIndexOrThrow(Columns.ALBUM_TYPES)
|
val albumTypesIndex = cursor.getColumnIndexOrThrow(Columns.ALBUM_TYPES)
|
||||||
|
|
||||||
val artistMusicBrainzIdsIndex =
|
val artistMusicBrainzIdsIndex =
|
||||||
cursor.getColumnIndexOrThrow(Columns.ARTIST_MUSIC_BRAINZ_IDS)
|
cursor.getColumnIndexOrThrow(Columns.ARTIST_MUSIC_BRAINZ_IDS)
|
||||||
|
@ -284,7 +283,7 @@ private class CacheDatabase(context: Context) :
|
||||||
raw.albumMusicBrainzId = cursor.getStringOrNull(albumMusicBrainzIdIndex)
|
raw.albumMusicBrainzId = cursor.getStringOrNull(albumMusicBrainzIdIndex)
|
||||||
raw.albumName = cursor.getString(albumNameIndex)
|
raw.albumName = cursor.getString(albumNameIndex)
|
||||||
raw.albumSortName = cursor.getStringOrNull(albumSortNameIndex)
|
raw.albumSortName = cursor.getStringOrNull(albumSortNameIndex)
|
||||||
cursor.getStringOrNull(albumReleaseTypesIndex)?.parseSQLMultiValue()?.let {
|
cursor.getStringOrNull(albumTypesIndex)?.parseSQLMultiValue()?.let {
|
||||||
raw.albumTypes = it
|
raw.albumTypes = it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +337,7 @@ private class CacheDatabase(context: Context) :
|
||||||
put(Columns.SIZE, rawSong.size)
|
put(Columns.SIZE, rawSong.size)
|
||||||
put(Columns.DURATION, rawSong.durationMs)
|
put(Columns.DURATION, rawSong.durationMs)
|
||||||
|
|
||||||
put(Columns.MUSIC_BRAINZ_ID, rawSong.name)
|
put(Columns.MUSIC_BRAINZ_ID, rawSong.musicBrainzId)
|
||||||
put(Columns.NAME, rawSong.name)
|
put(Columns.NAME, rawSong.name)
|
||||||
put(Columns.SORT_NAME, rawSong.sortName)
|
put(Columns.SORT_NAME, rawSong.sortName)
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ fun String.parseTimestamp() = Date.from(this)
|
||||||
* @param selector A block that determines if the string should be split at a given character.
|
* @param selector A block that determines if the string should be split at a given character.
|
||||||
* @return One or more [String]s split by the selector.
|
* @return One or more [String]s split by the selector.
|
||||||
*/
|
*/
|
||||||
inline fun String.splitEscaped(selector: (Char) -> Boolean): MutableList<String> {
|
inline fun String.splitEscaped(selector: (Char) -> Boolean): List<String> {
|
||||||
val split = mutableListOf<String>()
|
val split = mutableListOf<String>()
|
||||||
var currentString = ""
|
var currentString = ""
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|
Loading…
Reference in a new issue