Make Entry always have an id

This commit is contained in:
tzugen 2021-05-26 23:20:19 +02:00
parent 3257fb9153
commit b30584f99c
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 2 additions and 4 deletions

View File

@ -73,12 +73,11 @@ class TrackCollectionModel(application: Application) : GenericListModel(applicat
musicDirectory.findChild(allSongsId) == null && musicDirectory.findChild(allSongsId) == null &&
hasOnlyFolders(musicDirectory) hasOnlyFolders(musicDirectory)
) { ) {
val allSongs = MusicDirectory.Entry() val allSongs = MusicDirectory.Entry(allSongsId)
allSongs.isDirectory = true allSongs.isDirectory = true
allSongs.artist = name allSongs.artist = name
allSongs.parent = id allSongs.parent = id
allSongs.id = allSongsId
allSongs.title = String.format( allSongs.title = String.format(
context.resources.getString(R.string.select_album_all_songs), name context.resources.getString(R.string.select_album_all_songs), name
) )
@ -135,12 +134,11 @@ class TrackCollectionModel(application: Application) : GenericListModel(applicat
musicDirectory.findChild(allSongsId) == null && musicDirectory.findChild(allSongsId) == null &&
hasOnlyFolders(musicDirectory) hasOnlyFolders(musicDirectory)
) { ) {
val allSongs = MusicDirectory.Entry() val allSongs = MusicDirectory.Entry(allSongsId)
allSongs.isDirectory = true allSongs.isDirectory = true
allSongs.artist = name allSongs.artist = name
allSongs.parent = id allSongs.parent = id
allSongs.id = allSongsId
allSongs.title = String.format( allSongs.title = String.format(
context.resources.getString(R.string.select_album_all_songs), name context.resources.getString(R.string.select_album_all_songs), name
) )