ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.3k stars 268 forks source link

feat(YouTube - SponsorBlock): Allow creating video highlights #996

Open LisoUseInAIKyrios opened 1 year ago

LisoUseInAIKyrios commented 1 year ago

Application

YouTube

Issue

ReVanced can view and skip to video highlights, but currently ReVanced users cannot submit new highlights.

Patch

Add support to create highlight segments.

Motivation

Add more features.

Acknowledgements

LisoUseInAIKyrios commented 1 year ago

The only issue needed to resolve, is figuring out how to present the UI for creating highlight.

The create new segment UI expects a segment start and end. But with highlights there is no end point, it's just a start time. This creates an issue of how to present the UI for such a situation.

A possible solution with 2 paths to create a highlight:

Use case A:

After selecting a start time (but not an end time) and pressing the submit button, show a dialog asking to pick the segment type. Give two options:

If the user picks highlight segment, then send the highlight segment off to the SB api and close the new segment picker. If the user picks 'other type', then prompt them to pick an end time (and continue creating a new segment with start and end as they normally would)

Use case B:

If the user picks both a start and end time for a highlight (since picking both start and end is what they already understand), then show them all the segment types (including highlight). If they pick highlight segment, then show another dialog informing them the end time is ignored and only the start time will be used. Then send the highlight as usual.

oSumAtrIX commented 1 year ago

I believe a more intuitive approach would be to select the segment type first, then create a new submission UI based on that. All segment enum types except highlights have two timestamps, start and end, except for the highlights segment:

showSubmissionUI(twoTimeTamps = segment is TwoTimeStampSegment)

LisoUseInAIKyrios commented 1 year ago

That would change the steps that segments are created, but I think that's a better approach.

oSumAtrIX commented 1 year ago

What do you mean by "steps"?

LisoUseInAIKyrios commented 1 year ago

Change the order of things a user does. Not really a big deal.

What if the user presses the wrong segment type, how would they change? I suppose it could reset if the new segment picker is closed then reopened.

oSumAtrIX commented 1 year ago

First, the user chooses to submit a segment by clicking on the SponsorBlock overlay icon. That shows a list of segment types to submit. Based on the selection, the upper pseudocode can be implemented. If the user chooses the wrong type, they have to cancel and reselect the correct type.

LisoUseInAIKyrios commented 1 year ago

That makes sense. Show the segment picker first thing, and if creating a hightlight then don't show any UI controls for picking an end time.

rexamidalion commented 2 months ago

Any progress on this?.. it's been almost a year

tEctutoRIt commented 2 months ago

Please a little update on this feature request would be nice! Also, the button for start time, i.e., 00:00.000 and end time, would make editing segments more intuitive.