Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for a new API: Update captions by transcription ID #134

Open
yiyanglin98 opened this issue Oct 11, 2020 · 5 comments
Open

Request for a new API: Update captions by transcription ID #134

yiyanglin98 opened this issue Oct 11, 2020 · 5 comments
Assignees

Comments

@yiyanglin98
Copy link
Collaborator

yiyanglin98 commented Oct 11, 2020

The current caption updating API in /api/Captions can only update a single caption line with one API call, which is insufficient for frontend issue #103 for two reasons.

  1. Bulk editing of captions needs to update multiple caption lines (text, start time and end time) by transcription ID, with a single API call.
  2. User should be able to upload new caption document by transcription ID.

Therefore, it would be great to have a new API that can do PUT requests by transcription ID, to update/create captions efficiently.

Specification:

  • The API should take a transcription ID, an index of caption array in the transcription array (for instance, currently, index 0 is for English caption array in a transcription array), and an array of caption object. In the frontend, the form of the caption objects in the caption array should be:
    { begin: "00:00:00.0400000", end: "00:00:03.2400000", index: 1, id: "4d5a6020-2fb1-4dc3-93f8-4845bbc2c131", text: "Reflecting on what makes an activity or hobby or what" }

  • Frontend will provide a complete array of caption object, including the objects that are not modified. Backend should modify the captions according to the input. For captions that are deleted, the index should be -1, and the backend should handle the change of index accordingly. For new insertion, an id for the caption line should be generated.

More spec will be added...

@angrave
Copy link
Collaborator

angrave commented Oct 11, 2020

Agreed! How should it work? Replace only captions that are different?Or does the frontend only provide inserts? How are soft deletes handled? Some thought needs to be put into creating a spec for this. So why not draft what it should do...

@yiyanglin98
Copy link
Collaborator Author

yiyanglin98 commented Oct 11, 2020

Agreed! How should it work? Replace only captions that are different?Or does the frontend only provide inserts? How are soft deletes handled? Some thought needs to be put into creating a spec for this. So why not draft what it should do...

Sure. I will add more details in the next few days.

Also, I am not sure why soft deletion is necessary here. Is that for data recovery? Do we need to offer an interface for the users to undo their deletion? Or there are other purposes for soft deletion here, e.g. counting the deleted captions for some reason.

@angrave
Copy link
Collaborator

angrave commented Oct 11, 2020

Undo. We actually want a full revision history not just soft delete: e.g. want to be able to review changes made by a particular (or all) contributors or changes since date. Be able roll-back or undo a set of changes.

Also changes in main transcription suggest where changes should be made in translations

@tdy
Copy link
Collaborator

tdy commented Oct 12, 2020

Will WebVTT just piggyback off this API spec, or are there other needs/considerations for a WebVTT API?

@angrave
Copy link
Collaborator

angrave commented Oct 12, 2020

Yes, WebVTT uploaded to the frontend could piggyback off this API. So the ability to upload a vtt into the frontend would be useful.

(However we will need to support extracting captions from mp4 / upstream sources - so I imagine the backend will need some native WebVTT support to.)

@aiB0ld aiB0ld self-assigned this Oct 15, 2020
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

No branches or pull requests

4 participants