Commit 256e9cde authored by Geoffrey Métais's avatar Geoffrey Métais Committed by Geoffrey Métais
Browse files

Add sort by release year for tracks

parent 229d92fe
......@@ -37,6 +37,7 @@ class TracksProvider(val parent : MediaLibraryItem?, context: Context, scope: So
override fun canSortByDuration() = true
override fun canSortByAlbum() = parent !== null
override fun canSortByLastModified() = true
override fun canSortByReleaseDate() = true
override fun isByDisc(): Boolean {
return parent is Album
......
......@@ -222,8 +222,8 @@ object ModelsHelper {
}
private fun MediaLibraryItem.getYear() = when (itemType) {
MediaLibraryItem.TYPE_ALBUM -> if ((this as AbstractAlbum).releaseYear == 0) "-" else releaseYear.toString()
MediaLibraryItem.TYPE_MEDIA -> if ((this as AbstractMediaWrapper).date == null) "-" else date
MediaLibraryItem.TYPE_ALBUM -> if ((this as AbstractAlbum).releaseYear <= 0) "-" else releaseYear.toString()
MediaLibraryItem.TYPE_MEDIA -> if ((this as AbstractMediaWrapper).releaseYear <= 0) "-" else releaseYear.toString()
else -> "-"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment