Add Crop Action Type and Parameters for Video Segment Cropping#1
Merged
Add Crop Action Type and Parameters for Video Segment Cropping#1
Conversation
…tegories - Add Crop to ActionType enum - Add windowbox category with full and crop action support - Extend segment interfaces with optional crop parameters (cropLeft, cropRight, cropTop, cropBottom) - Add database migration to add crop fields to sponsorTimes table - Add validation for crop parameters (0-255 range, left+right ≤ 256, top+bottom ≤ 256) - Update database insertion and retrieval logic for crop fields Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
…s table - Update migration to add crop fields to both sponsorTimes and archivedSponsorTimes - Ensures archive job SELECT * operations work correctly with new crop parameters - Maintains transaction consistency as requested Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Crop Action Type and Parameters for Video Segment Cropping
Summary
This PR extends the SponsorBlockServer to support a new
Cropaction type and crop parameters for video segments, enabling users to define crop regions for both timestamp-bound cropping (chapter + crop) and full-video cropping (windowbox + crop).Changes Made
Type System Updates
Crop = "crop"to theActionTypeenumwindowboxcategory to the category list and type definitionsIncomingSegment,Segment, andDBSegmentinterfaces with optional crop parameters:cropLeft?: number(0-255, left crop ratio * 256)cropRight?: number(0-255, right crop ratio * 256)cropTop?: number(0-255, top crop ratio * 256)cropBottom?: number(0-255, bottom crop ratio * 256)Category Support Configuration
windowboxcategory with support forfullandcropactionscropaction support to existingchaptercategoryDatabase Schema
_upgrade_sponsorTimes_45.sqlto add crop fields tosponsorTimestableServer-Side Logic
Testing
Implementation Details
The crop parameters use integer values 0-255 representing crop ratios multiplied by 256, allowing precise crop region definitions while maintaining efficient storage and transmission.
Link to Devin run: https://app.devin.ai/sessions/d603923e56b246339b2c69516e4818c1
Requested by: Erkin Alp Güney (erkinalp9035@gmail.com)