Skip to content

Commit c4689ba

Browse files
Updated ratings to use the local icon first then fall back to server side icons
1 parent 1baf492 commit c4689ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/src/main/java/org/jellyfin/androidtv/data/repository/RatingIconProvider.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ object RatingIconProvider {
1010
}
1111

1212
fun getIcon(baseUrl: String?, source: String, scorePercent: Int? = null): RatingIcon? {
13+
// Prefer local drawable when available (always works, no plugin dependency)
14+
val localIcon = getLocalFallbackIcon(source, scorePercent)
15+
if (localIcon != null) return localIcon
16+
17+
// Fall back to server-hosted icon (requires Moonfin plugin)
1318
if (baseUrl != null) {
1419
getServerIconFile(source, scorePercent)?.let { file ->
1520
return RatingIcon.ServerUrl("$baseUrl/Moonfin/Assets/$file")
1621
}
1722
}
18-
return getLocalFallbackIcon(source, scorePercent)
23+
return null
1924
}
2025

2126
private fun getServerIconFile(source: String, scorePercent: Int?): String? = when (source) {

0 commit comments

Comments
 (0)