Add spoiler-related options - hide unwatched item titles, overviews, and thumbnails#811
Add spoiler-related options - hide unwatched item titles, overviews, and thumbnails#811skoshy wants to merge 1 commit intodamontecres:mainfrom
Conversation
|
So you're also working on one to blur/hide the thumbnails? Either way, this is a good step towards solving one of the more major missing things that most clients ignore. |
b6f7aa8 to
8a64d87
Compare
|
I've updated the PR, there's now more granular control for movies, episodes, and also episode titles which can also be a source of spoilers. I've also added the ability to hide thumbnails for episodes - either by blurring them or by using the series thumbnail |
77ca56a to
a359e9a
Compare
a359e9a to
16b84c8
Compare
|
I have built and tested this on the latest git as of today's 0.4.2 and this is working on my onn 4k Pro Android 14. However is the title being hidden also supposed to hide the title of the episode in the player? Right now it doesn't. So if I bring up the media controls the title still shows even with the option to hide them enabled. Also still shows the thumbnail, episode info, and title in the next up box at the end of watching an episode. I have title, description hidden and thumbnail blur on but seems to not apply to the next up for some reason. Otherwise, seems good here. |
damontecres
left a comment
There was a problem hiding this comment.
A good start, but needs some work.
| interactionSource = interactionSource ?: remember { MutableInteractionSource() }, | ||
| colors = | ||
| CardDefaults.colors( | ||
| // containerColor = Color.Transparent, | ||
| containerColor = androidx.compose.ui.graphics.Color.Transparent, |
There was a problem hiding this comment.
Your AI/LLM is making unnecessary changes.
| modifier = | ||
| Modifier | ||
| .fillMaxSize() | ||
| .dimAndBlur(finalBlur), |
There was a problem hiding this comment.
The blur effect does not work for Android before 12, so a lot of the features implemented in this PR won't work for many users.
| val isEpisode = item?.type == org.jellyfin.sdk.model.api.BaseItemKind.EPISODE | ||
| val isUnwatched = item?.data?.userData?.played == false | ||
| val isEpisodeThumbnail = | ||
| isEpisode && | ||
| !item.useSeriesForPrimary && | ||
| imageType == ImageType.PRIMARY | ||
|
|
||
| val useSeriesThumbnail = | ||
| isEpisodeThumbnail && isUnwatched && spoilerMode == EpisodeThumbnailSpoilerMode.SPOILER_SERIES_THUMBNAIL | ||
| val finalBlur = | ||
| isEpisodeThumbnail && isUnwatched && spoilerMode == EpisodeThumbnailSpoilerMode.SPOILER_BLUR | ||
|
|
There was a problem hiding this comment.
This composable really shouldn't have logic to it. Callers further up the chain should be telling it what to do.
| ) { | ||
| Text( | ||
| text = episodeName ?: "", | ||
| text = if (isHidden) stringResource(com.github.damontecres.wholphin.R.string.title_hidden) else (episodeName ?: ""), |
There was a problem hiding this comment.
Move logic up in the chain or make a new composable since you are also adjusting the font style
There was a problem hiding this comment.
Does it make sense to apply this to the Discover related pages?
| return result | ||
| } | ||
|
|
||
| fun shouldHideOverview(preferences: UserPreferences): Boolean { |
There was a problem hiding this comment.
This is a weird place to implement this logic.
Maybe move the spoiler settings into their own object and add extension functions to that for this logic.
|
Thanks! Have some other things going on at the moment, but I'll be going through these and making the necessary changes hopefully soon. |
Description
To prevent spoilers, I wanted to add an option to hide unwatched item overviews / descriptions. I also added the ability to hide unwatched episode thumbnails, either with a blur effect or by using the series thumbnail.
This also addresses items without an overview by giving them a "No overview" text.
I intentionally left the overview still visible when viewing an item's media information, so the user can still look at the overview if they really intend to dig deeper into the item.
Related issues
#810
#360
Screenshots
Menu items:
Hidden overview, blurred thumbnail:
Hidden overview, hidden title, series thumbnail:
AI/LLM usage
I used Gemini to help with this PR. I've tested the code manually in Android Studio (how I generated the screenshots).