Add batch action routes for multi-selection Kitsu operations#1145
Open
frankrousseau wants to merge 4 commits into
Open
Add batch action routes for multi-selection Kitsu operations#1145frankrousseau wants to merge 4 commits into
frankrousseau wants to merge 4 commits into
Conversation
Adding a selection or a whole episode to a playlist required one add-entity call per entity, or client-side rewrites of the full playlist. The new route appends several entities in one database write under the playlist lock, picking for each one its latest uploaded preview file, restricted to the playlist task type when one is set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deleting a selection of assets, shots, edits or concepts required one request per entity. The new route accepts an id list and applies the same rules as the single deletion routes: entities with tasks are canceled first, then removed for real when already canceled, concepts are always removed, and the creator-or-manager permission is checked per entity before anything is deleted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Updating the casting of a selection (add an asset to several shots, paste a casting) required one full-replace request per entity. The new route accepts a map of entity ids to casting arrays and updates them all in one request, validating project membership for every entity before writing anything. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Changing the priority of a task selection required one update request per task. The new route mirrors clear-assignation: it takes a task id list plus a priority, applies the same per-task supervisor permission check as the single task update, skips forbidden tasks and returns the updated tasks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Solution
POST /actions/playlists/<id>/add-entities: appends several entities in one write under the playlist lock, each getting its latest uploaded preview file (restricted to the playlist task type when set), skipping entities already present.POST /actions/projects/<id>/delete-entities: deletes assets/shots/edits/concepts by id list, with the same cancel-then-remove semantics and per-entity creator-or-manager permission check as the single deletion routes, validating everything before deleting anything.PUT /data/projects/<id>/entities/casting: updates several entities' casting in one request from an entity-id to casting-array map, validating project membership for every entity up front.PUT /actions/tasks/set-priority: sets the priority of a task id list, mirroring clear-assignation's per-task supervisor permission check and skipping forbidden tasks.