You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: category_dl_request.go
    path of file: ./repos/horahora/scheduler/internal/models
    
    the code of the file until where you have to start completion: package models

import (
	"context"
	"errors"
	"time"

	"github.com/jmoiron/sqlx"
)

type CategoryDLRequest struct {
	Url     string
	Website string
	Id      string
	Db      *sqlx.DB
}

// RefreshLock refreshes the lock for this download request, preventing it from being acquired by another scheduler.
func (v *
    
func (v *CategoryDLRequest) AddVideo(videoID, url string) (bool, error) {
	tx, err := v.Db.BeginTx(context.Background(), nil)
	if err != nil {
		return false, err
	}

	if url == "" {
		return false, errors.New("url cannot be blank")
	}

	if videoID == "" {
		return false, errors.New("video ID cannot be blank")
	}

	var id uint32
	sql := "INSERT INTO videos (video_ID, Url, website) VALUES ($1, $2, $3) " +
		"ON CONFLICT (video_ID, website) DO UPDATE set video_ID = EXCLUDED.video_ID RETURNING id"
	row := tx.QueryRow(sql, videoID, url, v.Website)
	err = row.Scan(&id)
	if err != nil {
		return false, err
	}

	sql = "INSERT INTO downloads_to_videos (download_id, video_id) VALUES ($1, $2) ON CONFLICT DO NOTHING"
	res, err := tx.Exec(sql, v.Id, id)
	if err != nil {
		tx.Rollback()
		return false, err
	}

	rowsAffected, err := res.RowsAffected()
	if err != nil {
		tx.Rollback()
		return false, err
	}

	err = tx.Commit()
	if err != nil {
		tx.Rollback()
		return false, err
	}

	return rowsAffected >= 1, nil
}