|
|
@ -13,7 +13,7 @@ import (
|
|
|
|
const createMediaSet = `-- name: CreateMediaSet :one
|
|
|
|
const createMediaSet = `-- name: CreateMediaSet :one
|
|
|
|
INSERT INTO media_sets (youtube_id, 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)
|
|
|
|
INSERT INTO media_sets (youtube_id, 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, NOW(), NOW())
|
|
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, NOW(), NOW())
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type CreateMediaSetParams struct {
|
|
|
|
type CreateMediaSetParams struct {
|
|
|
@ -53,17 +53,14 @@ func (q *Queries) CreateMediaSet(ctx context.Context, arg CreateMediaSetParams)
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -73,7 +70,6 @@ func (q *Queries) CreateMediaSet(ctx context.Context, arg CreateMediaSetParams)
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -81,7 +77,7 @@ func (q *Queries) CreateMediaSet(ctx context.Context, arg CreateMediaSetParams)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const getMediaSet = `-- name: GetMediaSet :one
|
|
|
|
const getMediaSet = `-- name: GetMediaSet :one
|
|
|
|
SELECT id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at FROM media_sets WHERE id = $1
|
|
|
|
SELECT id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at FROM media_sets WHERE id = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaSet(ctx context.Context, id uuid.UUID) (MediaSet, error) {
|
|
|
|
func (q *Queries) GetMediaSet(ctx context.Context, id uuid.UUID) (MediaSet, error) {
|
|
|
@ -95,17 +91,14 @@ func (q *Queries) GetMediaSet(ctx context.Context, id uuid.UUID) (MediaSet, erro
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -115,7 +108,6 @@ func (q *Queries) GetMediaSet(ctx context.Context, id uuid.UUID) (MediaSet, erro
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -123,7 +115,7 @@ func (q *Queries) GetMediaSet(ctx context.Context, id uuid.UUID) (MediaSet, erro
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const getMediaSetByYoutubeID = `-- name: GetMediaSetByYoutubeID :one
|
|
|
|
const getMediaSetByYoutubeID = `-- name: GetMediaSetByYoutubeID :one
|
|
|
|
SELECT id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at FROM media_sets WHERE youtube_id = $1
|
|
|
|
SELECT id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at FROM media_sets WHERE youtube_id = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaSetByYoutubeID(ctx context.Context, youtubeID string) (MediaSet, error) {
|
|
|
|
func (q *Queries) GetMediaSetByYoutubeID(ctx context.Context, youtubeID string) (MediaSet, error) {
|
|
|
@ -137,17 +129,14 @@ func (q *Queries) GetMediaSetByYoutubeID(ctx context.Context, youtubeID string)
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -157,7 +146,6 @@ func (q *Queries) GetMediaSetByYoutubeID(ctx context.Context, youtubeID string)
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -166,19 +154,18 @@ func (q *Queries) GetMediaSetByYoutubeID(ctx context.Context, youtubeID string)
|
|
|
|
|
|
|
|
|
|
|
|
const setEncodedAudioUploaded = `-- name: SetEncodedAudioUploaded :one
|
|
|
|
const setEncodedAudioUploaded = `-- name: SetEncodedAudioUploaded :one
|
|
|
|
UPDATE media_sets
|
|
|
|
UPDATE media_sets
|
|
|
|
SET audio_encoded_s3_bucket = $2, audio_encoded_s3_key = $3, audio_encoded_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
SET audio_encoded_s3_key = $2, audio_encoded_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type SetEncodedAudioUploadedParams struct {
|
|
|
|
type SetEncodedAudioUploadedParams struct {
|
|
|
|
ID uuid.UUID
|
|
|
|
ID uuid.UUID
|
|
|
|
AudioEncodedS3Bucket sql.NullString
|
|
|
|
AudioEncodedS3Key sql.NullString
|
|
|
|
AudioEncodedS3Key sql.NullString
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) SetEncodedAudioUploaded(ctx context.Context, arg SetEncodedAudioUploadedParams) (MediaSet, error) {
|
|
|
|
func (q *Queries) SetEncodedAudioUploaded(ctx context.Context, arg SetEncodedAudioUploadedParams) (MediaSet, error) {
|
|
|
|
row := q.db.QueryRow(ctx, setEncodedAudioUploaded, arg.ID, arg.AudioEncodedS3Bucket, arg.AudioEncodedS3Key)
|
|
|
|
row := q.db.QueryRow(ctx, setEncodedAudioUploaded, arg.ID, arg.AudioEncodedS3Key)
|
|
|
|
var i MediaSet
|
|
|
|
var i MediaSet
|
|
|
|
err := row.Scan(
|
|
|
|
err := row.Scan(
|
|
|
|
&i.ID,
|
|
|
|
&i.ID,
|
|
|
@ -188,17 +175,14 @@ func (q *Queries) SetEncodedAudioUploaded(ctx context.Context, arg SetEncodedAud
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -208,7 +192,6 @@ func (q *Queries) SetEncodedAudioUploaded(ctx context.Context, arg SetEncodedAud
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -217,25 +200,19 @@ func (q *Queries) SetEncodedAudioUploaded(ctx context.Context, arg SetEncodedAud
|
|
|
|
|
|
|
|
|
|
|
|
const setRawAudioUploaded = `-- name: SetRawAudioUploaded :one
|
|
|
|
const setRawAudioUploaded = `-- name: SetRawAudioUploaded :one
|
|
|
|
UPDATE media_sets
|
|
|
|
UPDATE media_sets
|
|
|
|
SET audio_raw_s3_bucket = $2, audio_raw_s3_key = $3, audio_frames = $4, audio_raw_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
SET audio_raw_s3_key = $2, audio_frames = $3, audio_raw_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type SetRawAudioUploadedParams struct {
|
|
|
|
type SetRawAudioUploadedParams struct {
|
|
|
|
ID uuid.UUID
|
|
|
|
ID uuid.UUID
|
|
|
|
AudioRawS3Bucket sql.NullString
|
|
|
|
AudioRawS3Key sql.NullString
|
|
|
|
AudioRawS3Key sql.NullString
|
|
|
|
AudioFrames sql.NullInt64
|
|
|
|
AudioFrames sql.NullInt64
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) SetRawAudioUploaded(ctx context.Context, arg SetRawAudioUploadedParams) (MediaSet, error) {
|
|
|
|
func (q *Queries) SetRawAudioUploaded(ctx context.Context, arg SetRawAudioUploadedParams) (MediaSet, error) {
|
|
|
|
row := q.db.QueryRow(ctx, setRawAudioUploaded,
|
|
|
|
row := q.db.QueryRow(ctx, setRawAudioUploaded, arg.ID, arg.AudioRawS3Key, arg.AudioFrames)
|
|
|
|
arg.ID,
|
|
|
|
|
|
|
|
arg.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
arg.AudioRawS3Key,
|
|
|
|
|
|
|
|
arg.AudioFrames,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
var i MediaSet
|
|
|
|
var i MediaSet
|
|
|
|
err := row.Scan(
|
|
|
|
err := row.Scan(
|
|
|
|
&i.ID,
|
|
|
|
&i.ID,
|
|
|
@ -245,17 +222,14 @@ func (q *Queries) SetRawAudioUploaded(ctx context.Context, arg SetRawAudioUpload
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -265,7 +239,6 @@ func (q *Queries) SetRawAudioUploaded(ctx context.Context, arg SetRawAudioUpload
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -274,9 +247,9 @@ func (q *Queries) SetRawAudioUploaded(ctx context.Context, arg SetRawAudioUpload
|
|
|
|
|
|
|
|
|
|
|
|
const setVideoThumbnailUploaded = `-- name: SetVideoThumbnailUploaded :one
|
|
|
|
const setVideoThumbnailUploaded = `-- name: SetVideoThumbnailUploaded :one
|
|
|
|
UPDATE media_sets
|
|
|
|
UPDATE media_sets
|
|
|
|
SET video_thumbnail_width = $2, video_thumbnail_height = $3, video_thumbnail_mime_type = $4, video_thumbnail_s3_bucket = $5, video_thumbnail_s3_key = $6, video_thumbnail_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
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()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type SetVideoThumbnailUploadedParams struct {
|
|
|
|
type SetVideoThumbnailUploadedParams struct {
|
|
|
@ -284,7 +257,6 @@ type SetVideoThumbnailUploadedParams struct {
|
|
|
|
VideoThumbnailWidth sql.NullInt32
|
|
|
|
VideoThumbnailWidth sql.NullInt32
|
|
|
|
VideoThumbnailHeight sql.NullInt32
|
|
|
|
VideoThumbnailHeight sql.NullInt32
|
|
|
|
VideoThumbnailMimeType sql.NullString
|
|
|
|
VideoThumbnailMimeType sql.NullString
|
|
|
|
VideoThumbnailS3Bucket sql.NullString
|
|
|
|
|
|
|
|
VideoThumbnailS3Key sql.NullString
|
|
|
|
VideoThumbnailS3Key sql.NullString
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -294,7 +266,6 @@ func (q *Queries) SetVideoThumbnailUploaded(ctx context.Context, arg SetVideoThu
|
|
|
|
arg.VideoThumbnailWidth,
|
|
|
|
arg.VideoThumbnailWidth,
|
|
|
|
arg.VideoThumbnailHeight,
|
|
|
|
arg.VideoThumbnailHeight,
|
|
|
|
arg.VideoThumbnailMimeType,
|
|
|
|
arg.VideoThumbnailMimeType,
|
|
|
|
arg.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
arg.VideoThumbnailS3Key,
|
|
|
|
arg.VideoThumbnailS3Key,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
var i MediaSet
|
|
|
|
var i MediaSet
|
|
|
@ -306,17 +277,14 @@ func (q *Queries) SetVideoThumbnailUploaded(ctx context.Context, arg SetVideoThu
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -326,7 +294,6 @@ func (q *Queries) SetVideoThumbnailUploaded(ctx context.Context, arg SetVideoThu
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -335,19 +302,18 @@ func (q *Queries) SetVideoThumbnailUploaded(ctx context.Context, arg SetVideoThu
|
|
|
|
|
|
|
|
|
|
|
|
const setVideoUploaded = `-- name: SetVideoUploaded :one
|
|
|
|
const setVideoUploaded = `-- name: SetVideoUploaded :one
|
|
|
|
UPDATE media_sets
|
|
|
|
UPDATE media_sets
|
|
|
|
SET video_s3_bucket = $2, video_s3_key = $3, video_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
SET video_s3_key = $2, video_s3_uploaded_at = NOW(), updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_key, audio_encoded_s3_uploaded_at
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type SetVideoUploadedParams struct {
|
|
|
|
type SetVideoUploadedParams struct {
|
|
|
|
ID uuid.UUID
|
|
|
|
ID uuid.UUID
|
|
|
|
VideoS3Bucket sql.NullString
|
|
|
|
VideoS3Key sql.NullString
|
|
|
|
VideoS3Key sql.NullString
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) SetVideoUploaded(ctx context.Context, arg SetVideoUploadedParams) (MediaSet, error) {
|
|
|
|
func (q *Queries) SetVideoUploaded(ctx context.Context, arg SetVideoUploadedParams) (MediaSet, error) {
|
|
|
|
row := q.db.QueryRow(ctx, setVideoUploaded, arg.ID, arg.VideoS3Bucket, arg.VideoS3Key)
|
|
|
|
row := q.db.QueryRow(ctx, setVideoUploaded, arg.ID, arg.VideoS3Key)
|
|
|
|
var i MediaSet
|
|
|
|
var i MediaSet
|
|
|
|
err := row.Scan(
|
|
|
|
err := row.Scan(
|
|
|
|
&i.ID,
|
|
|
|
&i.ID,
|
|
|
@ -357,17 +323,14 @@ func (q *Queries) SetVideoUploaded(ctx context.Context, arg SetVideoUploadedPara
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFramesApprox,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioFrames,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioSampleRate,
|
|
|
|
&i.AudioRawS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3Key,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioRawS3UploadedAt,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.AudioEncodedMimeType,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoYoutubeItag,
|
|
|
|
&i.VideoS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3Key,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoS3UploadedAt,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoMimeType,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoDurationNanos,
|
|
|
|
&i.VideoThumbnailS3Bucket,
|
|
|
|
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3Key,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailS3UploadedAt,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
|
&i.VideoThumbnailMimeType,
|
|
|
@ -377,7 +340,6 @@ func (q *Queries) SetVideoUploaded(ctx context.Context, arg SetVideoUploadedPara
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.UpdatedAt,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.AudioContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.VideoContentLength,
|
|
|
|
&i.AudioEncodedS3Bucket,
|
|
|
|
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3Key,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
&i.AudioEncodedS3UploadedAt,
|
|
|
|
)
|
|
|
|
)
|
|
|
|