Make parentId nullable in TrackCollectionModel

This commit is contained in:
tzugen 2021-05-28 12:35:29 +02:00
parent e21ae1299b
commit ee9c478bfe
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
2 changed files with 6 additions and 6 deletions

View File

@ -281,12 +281,12 @@ class TrackCollectionFragment : Fragment() {
setTitle(name) setTitle(name)
if (!isOffline() && Util.getShouldUseId3Tags()) { if (!isOffline() && Util.getShouldUseId3Tags()) {
if (isAlbum) { if (isAlbum) {
model.getAlbum(refresh, id!!, name, parentId!!) model.getAlbum(refresh, id!!, name, parentId)
} else { } else {
model.getArtist(refresh, id!!, name) model.getArtist(refresh, id!!, name)
} }
} else { } else {
model.getMusicDirectory(refresh, id!!, name, parentId!!) model.getMusicDirectory(refresh, id!!, name, parentId)
} }
} }

View File

@ -45,7 +45,7 @@ class TrackCollectionModel(application: Application) : GenericListModel(applicat
refresh: Boolean, refresh: Boolean,
id: String, id: String,
name: String?, name: String?,
parentId: String parentId: String?
) { ) {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
@ -53,7 +53,7 @@ class TrackCollectionModel(application: Application) : GenericListModel(applicat
var root = MusicDirectory() var root = MusicDirectory()
if (allSongsId == id) { if (allSongsId == id && parentId != null) {
val musicDirectory = service.getMusicDirectory( val musicDirectory = service.getMusicDirectory(
parentId, name, refresh parentId, name, refresh
) )
@ -152,7 +152,7 @@ class TrackCollectionModel(application: Application) : GenericListModel(applicat
} }
} }
suspend fun getAlbum(refresh: Boolean, id: String, name: String?, parentId: String) { suspend fun getAlbum(refresh: Boolean, id: String, name: String?, parentId: String?) {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
@ -160,7 +160,7 @@ class TrackCollectionModel(application: Application) : GenericListModel(applicat
val musicDirectory: MusicDirectory val musicDirectory: MusicDirectory
if (allSongsId == id) { if (allSongsId == id && parentId != null) {
val root = MusicDirectory() val root = MusicDirectory()
val songs: MutableCollection<MusicDirectory.Entry> = LinkedList() val songs: MutableCollection<MusicDirectory.Entry> = LinkedList()