When a user clicks transfer, register their YT video for transcoding
The api api/v3/media/youtube-importer/transfer
should take ids and queue them up for transcoding.
PUT should queue / requeue the video for transcoding (where each user can only have one video instance)
DELETE should Cancel / delete the underlying entity before it's transcoded ??? do we want to provide the user's ability to delete previously imported videos on this screen @markeharding
When the user clicks all, this will need to be a batched job that creates video records for all videos on their channel and then queues them up for processing over (# of videos / 10) days
This will be a fixed daily limit of 10 at the MVP, but then be based on their number of subscribers later.
When the user transfers all
We'll need to extend the video entity to track:
The Video string id for youtube The transcoder status
Mapped to elastic search
Then we should be able to query elastic search when the queue runner run.
A queue runner job should run to a give user and a give timespan. This one should run through the elastic search and find up to the user's daily transcode limit and queue them up for transcoding. It should create the video, set the status and then publish the video only when it's done transcoding (because a user could have many videos on their channel and scheduled them all for importing). Note it should only schedule up to the allowed daily allotment (oldest first).
Up to the configured limit, queue up transcoder requests.
For scale reasons, we don't want to write anything other than the video string and the transcoder status (so we know what needs to be processed)
When the video is transcoded, publish the video
Wht
Warning: There is a youtube quota that is variable based on our usage.
I am hoping this won't be a problem because we can download the videos directly from the extracted information request https://developers.google.com/youtube/v3/getting-started#calculating-quota-usage
-
youtube_id
andyoutube_channel_id
flag on Entities/Video objects -
youtube_id
andyoutube_channel_id
keyword field for elasticsearch (only index if exists, empty strings cause issues) -
Do a bulk terms query of the youtube_channel_id to get a list of all there transcoded videos -
Consider adding a youtube_importer_queued
field for ease in running daily jobs?