mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Prefer thumb art for movies for Watch Next (#1456)
## Description Prefer using thumb image types for movies when adding to Watch Next android OS channel. The primary/poster image will be used if there is no thumb. ### Related issues Fixes #1425 Fixes #1403 ### Testing Emulator, verified a movie was showing its primary image, then ran this PR ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
ebcc2f324a
commit
656393fa1d
1 changed files with 13 additions and 13 deletions
|
|
@ -93,19 +93,19 @@ class TvProviderWorker
|
||||||
val currentItems = getCurrentTvChannelNextUp()
|
val currentItems = getCurrentTvChannelNextUp()
|
||||||
val currentItemIds = currentItems.map { it.internalProviderId }
|
val currentItemIds = currentItems.map { it.internalProviderId }
|
||||||
|
|
||||||
// TODO Remove after v0.3.10 release
|
// TODO Remove after v0.6.5 release
|
||||||
// This cleans up duplicates added to the watch next due a bug in https://github.com/damontecres/Wholphin/pull/372
|
// This cleans up movies that are using the poster image, see https://github.com/damontecres/Wholphin/issues/1425
|
||||||
currentItems.groupBy { it.internalProviderId }.forEach { (id, items) ->
|
currentItems
|
||||||
if (items.size > 1) {
|
.filter {
|
||||||
Timber.v("Duplicate ID %s", id)
|
it.type == WatchNextPrograms.TYPE_MOVIE &&
|
||||||
items
|
it.posterArtUri
|
||||||
.subList(1, items.size)
|
.toString()
|
||||||
.map { TvContractCompat.buildWatchNextProgramUri(it.id) }
|
.lowercase()
|
||||||
.forEach {
|
.contains("primary")
|
||||||
context.contentResolver.delete(it, null, null)
|
}.map { TvContractCompat.buildWatchNextProgramUri(it.id) }
|
||||||
}
|
.forEach {
|
||||||
|
context.contentResolver.delete(it, null, null)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// End temporary clean up
|
// End temporary clean up
|
||||||
|
|
||||||
val toRemove =
|
val toRemove =
|
||||||
|
|
@ -220,7 +220,7 @@ class TvProviderWorker
|
||||||
val imageType =
|
val imageType =
|
||||||
when (item.type) {
|
when (item.type) {
|
||||||
BaseItemKind.EPISODE -> ImageType.THUMB
|
BaseItemKind.EPISODE -> ImageType.THUMB
|
||||||
else -> ImageType.PRIMARY
|
else -> if (ImageType.THUMB in item.data.imageTags.orEmpty()) ImageType.THUMB else ImageType.PRIMARY
|
||||||
}
|
}
|
||||||
setPosterArtUri(imageUrlService.getItemImageUrl(item, imageType)!!.toUri())
|
setPosterArtUri(imageUrlService.getItemImageUrl(item, imageType)!!.toUri())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue