Skip to content

Conversation

@FineFindus
Copy link
Collaborator

Displays an icon on the thumbnail for fully sponsored videos. This allows users to easily identify and avoid these videos, if they prefer so. This works similarly to how the SponsorBlock extension works for the website.

SponsorBlock icon on thumbnail

This is still marked as a draft as:

  • it always uses the official SponsorBlock server, as Piped does not support the required API (not sure if it is worth fixing, with the current state of the Piped backend?)
  • it increases the number of requests made, we should probably cache or store them directly in the DB (though that might lead to outdated data)
  • it's only shown for VideoCards (not sure if it even makes sense for the 'normal' video adapter)
  • the icon position and size feels suboptimal, due to the difference to the duration
  • not sure if that is something that we even want to implement :)

Fixes a crash, where, if the segment timing was null, the
`segmentStartAndEnd` would crash, as it directly accesses the data.
Displays an icon on the thumbnail for fully sponsored videos. This
allows users to easily identify and avoid these videos, if they prefer
so. This works similarly to how the SponsorBlock extension works for the
website.
@Bnyro
Copy link
Member

Bnyro commented Apr 21, 2025

it always uses the official SponsorBlock server, as Piped does not support the required API (not sure if it is worth fixing, with the current state of the Piped backend?)

I'm not planning to continue Piped Backend development, and it doesn't seem like anybody else does. So I think we should just implement this as a helper function and use it in both, the local and the piped media repo. (Let me know if you have a better idea though)

it increases the number of requests made, we should probably cache or store them directly in the DB (though that might lead to outdated data)

We could possibly create a new cache file and http client for it (https://square.github.io/okhttp/features/caching/), though that'd only work if SponsorBlock's backend has the caching headers set accordingly (Cache-Control:max-age=...).
Storing this data inside a database is an overkill for such a small/simple feature imo.

it's only shown for VideoCards (not sure if it even makes sense for the 'normal' video adapter)

It probably makes the most sense for the feed I guess 🤷, other places are probably not worth the additional requests.

the icon position and size feels suboptimal, due to the difference to the duration

The card behind could maybe be replaced with a shape that's similar to the SponsorBlock shield? Or we directly edit the SVG, though I'm not sure if Android XML/SVG files support transparency/alpha channels.

@FineFindus
Copy link
Collaborator Author

We could possibly create a new cache file and http client for it (https://square.github.io/okhttp/features/caching/), though that'd only work if SponsorBlock's backend has the caching headers set accordingly (Cache-Control:max-age=...).

I feel like most of the request made from ExternalApi should be cached. From my testing SponsorBlock doesn't seem to set Cache-Control anywhere (ajayyy/SponsorBlockServer#576, CC: @ajayyy: the issue was closed but seems to not have been fully resolved :))
I might have a patch to add ETags to /getVideoLabels, but I'm having trouble getting the server up and running to test my changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants