Make parentId nullable in TrackCollectionModel
This commit is contained in:
parent
e21ae1299b
commit
ee9c478bfe
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue