videostorage

package
v0.0.0-...-e934dfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(db *sqlx.DB, video *Video, step string) (sql.Result, error)

Add puts a new video into the database.

func PrepareLookupByURL

func PrepareLookupByURL(db *sqlx.DB) (*sqlx.NamedStmt, error)

PrepareLookupByURL returns a reusable statement for looking up a video by url.

func SetupTable

func SetupTable(db *sqlx.DB)

SetupTable creates the shows table if it does not exist.

func Update

func Update(db *sqlx.DB, video *Video, step string) (sql.Result, error)

Update stores new data in the database.

Types

type Video

type Video struct {
	ID            int     `db:"id"`
	URL           string  `db:"url"`
	Show          string  `db:"show"`
	Filename      string  `db:"filename"`
	Title         string  `db:"title"`
	Description   string  `db:"description"`
	AverageRating float64 `db:"average_rating"`
	UploadDate    string  `db:"upload_date"`
	SeasonNum     int     `db:"season_num"`
	EpisodeNum    int     `db:"episode_num"`
	Step          string  `db:"step"`
}

Video represents a video file and metadata.

func Find

func Find(stmt *sqlx.NamedStmt, video *Video) ([]Video, error)

Find looks up a video by url.

func FindForStep

func FindForStep(db *sqlx.DB, step string) ([]Video, error)

FindForStep returns all videos for the step.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL