Make Entry always have an id
This commit is contained in:
parent
5ac36b749b
commit
3257fb9153
|
@ -36,7 +36,7 @@ class MusicDirectory {
|
||||||
}
|
}
|
||||||
|
|
||||||
data class Entry(
|
data class Entry(
|
||||||
override var id: String? = null,
|
override var id: String,
|
||||||
var parent: String? = null,
|
var parent: String? = null,
|
||||||
var isDirectory: Boolean = false,
|
var isDirectory: Boolean = false,
|
||||||
var title: String? = null,
|
var title: String? = null,
|
||||||
|
|
|
@ -13,8 +13,7 @@ internal val dateFormat: DateFormat by lazy {
|
||||||
SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.getDefault())
|
SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.getDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun MusicDirectoryChild.toDomainEntity(): MusicDirectory.Entry = MusicDirectory.Entry().apply {
|
fun MusicDirectoryChild.toDomainEntity(): MusicDirectory.Entry = MusicDirectory.Entry(id).apply {
|
||||||
id = this@toDomainEntity.id
|
|
||||||
parent = this@toDomainEntity.parent
|
parent = this@toDomainEntity.parent
|
||||||
isDirectory = this@toDomainEntity.isDir
|
isDirectory = this@toDomainEntity.isDir
|
||||||
title = this@toDomainEntity.title
|
title = this@toDomainEntity.title
|
||||||
|
|
|
@ -57,7 +57,7 @@ class AlbumRowAdapter(
|
||||||
|
|
||||||
imageLoader.loadImage(
|
imageLoader.loadImage(
|
||||||
holder.coverArt,
|
holder.coverArt,
|
||||||
MusicDirectory.Entry().apply { coverArt = holder.coverArtId },
|
MusicDirectory.Entry("-1").apply { coverArt = holder.coverArtId },
|
||||||
false, 0, false, true, R.drawable.unknown_album
|
false, 0, false, true, R.drawable.unknown_album
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ArtistRowAdapter(
|
||||||
holder.coverArt.visibility = View.VISIBLE
|
holder.coverArt.visibility = View.VISIBLE
|
||||||
imageLoader.loadImage(
|
imageLoader.loadImage(
|
||||||
holder.coverArt,
|
holder.coverArt,
|
||||||
MusicDirectory.Entry().apply { coverArt = holder.coverArtId },
|
MusicDirectory.Entry("-1").apply { coverArt = holder.coverArtId },
|
||||||
false, 0, false, true, R.drawable.ic_contact_picture
|
false, 0, false, true, R.drawable.ic_contact_picture
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue