Use media item name as title when available (#461)

Fallback to filename if missing
This commit is contained in:
Carlos Olivo authored and GitHub committed 2021-07-06 09:49:40 +02:00
1 parent cbd6dc8027
commit 8d79f663d7
1 file changed
+1 -1
@@ -18,7 +18,7 @@ class JellyfinMediaSource(
subtitleStreamIndex: Int? = null,
) {
val id: String = requireNotNull(sourceInfo.id) { "Media source has no id" }
val name: String = sourceInfo.name.orEmpty()
val name: String = item?.name ?: sourceInfo.name.orEmpty()
val playMethod: PlayMethod = when {
sourceInfo.supportsDirectPlay -> PlayMethod.DIRECT_PLAY