2021-11-01 05:28:40 +00:00
|
|
|
-- name: GetMediaSet :one
|
|
|
|
SELECT * FROM media_sets WHERE id = $1;
|
|
|
|
|
|
|
|
-- name: GetMediaSetByYoutubeID :one
|
|
|
|
SELECT * FROM media_sets WHERE youtube_id = $1;
|
|
|
|
|
|
|
|
-- name: CreateMediaSet :one
|
2022-01-13 19:05:09 +00:00
|
|
|
INSERT INTO media_sets (youtube_id, title, description, author, audio_youtube_itag, audio_channels, audio_frames_approx, audio_sample_rate, audio_content_length, audio_encoded_mime_type, video_youtube_itag, video_content_length, video_mime_type, video_duration_nanos, created_at, updated_at)
|
|
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, NOW(), NOW())
|
2021-11-01 05:28:40 +00:00
|
|
|
RETURNING *;
|
2021-11-02 16:20:47 +00:00
|
|
|
|
2021-11-29 13:59:05 +00:00
|
|
|
-- name: SetRawAudioUploaded :one
|
2021-11-02 16:20:47 +00:00
|
|
|
UPDATE media_sets
|
2021-12-13 03:28:14 +00:00
|
|
|
SET audio_raw_s3_key = $2, audio_frames = $3, audio_raw_s3_uploaded_at = NOW(), updated_at = NOW()
|
2021-11-29 13:59:05 +00:00
|
|
|
WHERE id = $1
|
|
|
|
RETURNING *;
|
|
|
|
|
|
|
|
-- name: SetEncodedAudioUploaded :one
|
|
|
|
UPDATE media_sets
|
2021-12-13 03:28:14 +00:00
|
|
|
SET audio_encoded_s3_key = $2, audio_encoded_s3_uploaded_at = NOW(), updated_at = NOW()
|
2021-11-04 06:13:00 +00:00
|
|
|
WHERE id = $1
|
2021-11-02 16:20:47 +00:00
|
|
|
RETURNING *;
|
2021-11-20 18:29:34 +00:00
|
|
|
|
|
|
|
-- name: SetVideoUploaded :one
|
|
|
|
UPDATE media_sets
|
2021-12-13 03:28:14 +00:00
|
|
|
SET video_s3_key = $2, video_s3_uploaded_at = NOW(), updated_at = NOW()
|
2021-11-20 18:29:34 +00:00
|
|
|
WHERE id = $1
|
|
|
|
RETURNING *;
|
2021-11-21 19:43:40 +00:00
|
|
|
|
|
|
|
-- name: SetVideoThumbnailUploaded :one
|
|
|
|
UPDATE media_sets
|
2021-12-13 03:28:14 +00:00
|
|
|
SET video_thumbnail_width = $2, video_thumbnail_height = $3, video_thumbnail_mime_type = $4, video_thumbnail_s3_key = $5, video_thumbnail_s3_uploaded_at = NOW(), updated_at = NOW()
|
2021-11-21 19:43:40 +00:00
|
|
|
WHERE id = $1
|
|
|
|
RETURNING *;
|