database

package
v0.0.0-...-50f11f9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

movies

Index

Constants

This section is empty.

Variables

View Source
var DB *sqlx.DB
View Source
var DBImdb *sqlx.DB
View Source
var DBVersion string
View Source
var Getaudios []QualitiesRegex
View Source
var Getcodecs []QualitiesRegex
View Source
var Getqualities []QualitiesRegex
View Source
var Getresolutions []QualitiesRegex
View Source
var ListAudio = []Qualities{
	{Type: 4, Name: "mp3", Priority: 10, Regex: "(\\b|_)mp3(\\b|_)", Strings: "mp3"},
	{Type: 4, Name: "aac", Priority: 20, Regex: "(\\b|_)aac(s)?(\\b|_)", Strings: "aac,aacs"},
	{Type: 4, Name: "dd5.1", Priority: 30, Regex: "(\\b|_)dd[0-9\\.]+(\\b|_)"},
	{Type: 4, Name: "ac3", Priority: 40, Regex: "(\\b|_)ac3(s)?(\\b|_)", Strings: "ac3,ac3s"},
	{Type: 4, Name: "dd+5.1", Priority: 50, Regex: "(\\b|_)dd[p+][0-9\\.]+(\\b|_)"},
	{Type: 4, Name: "flac", Priority: 60, Regex: "(\\b|_)flac(s)?(\\b|_)", Strings: "flac,flacs"},
	{Type: 4, Name: "dtshd", Priority: 70, Regex: "(\\b|_)dts[^a-zA-Z0-9]?hd(?:[^a-zA-Z0-9]?ma)?(s)?(\\b|_)"},
	{Type: 4, Name: "dts", Priority: 80, Regex: "(\\b|_)dts(s)?(\\b|_)", Strings: "dts,dtss"},
	{Type: 4, Name: "truehd", Priority: 90, Regex: "(\\b|_)truehd(s)?(\\b|_)", Strings: "truehd"}}
View Source
var ListCodecs = []Qualities{
	{Type: 3, Name: "divx", Priority: 100, Regex: "(\\b|_)divx(\\b|_)", Strings: "divx"},
	{Type: 3, Name: "xvid", Priority: 200, Regex: "(\\b|_)xvid(\\b|_)", Strings: "xvid"},
	{Type: 3, Name: "h264", Priority: 300, Regex: "(\\b|_)(h|x)264(\\b|_)", Strings: "h264,x264"},
	{Type: 3, Name: "vp9", Priority: 400, Regex: "(\\b|_)vp9(\\b|_)", Strings: "vp9"},
	{Type: 3, Name: "h265", Priority: 500, Regex: "(\\b|_)((h|x)265|hevc)(\\b|_)", Strings: "h265,x265,hevc"},
	{Type: 3, Name: "10bit", Priority: 600, Regex: "(\\b|_)(10bit|hi10p)(\\b|_)", Strings: "10bit,hi10p"}}
View Source
var ListQualities = []Qualities{
	{Type: 2, Name: "workprint", Priority: 1000, Regex: "(\\b|_)workprint(\\b|_)", Strings: "workprint"},
	{Type: 2, Name: "cam", Priority: 1300, Regex: "(\\b|_)(?:web)?cam(\\b|_)", Strings: "webcam,cam"},
	{Type: 2, Name: "ts", Priority: 2000, Regex: "(\\b|_)(?:hd)?ts|telesync(\\b|_)", Strings: "hdts,ts,telesync"},
	{Type: 2, Name: "tc", Priority: 2300, Regex: "(\\b|_)(tc|telecine)(\\b|_)", Strings: "tc,telecine"},
	{Type: 2, Name: "r5", Priority: 3000, Regex: "(\\b|_)r[2-8c](\\b|_)", Strings: "r5,r6"},
	{Type: 2, Name: "hdrip", Priority: 3300, Regex: "(\\b|_)hd[^a-zA-Z0-9]?rip(\\b|_)", Strings: "hdrip,hd.rip,hd rip,hd-rip,hd_rip"},
	{Type: 2, Name: "ppvrip", Priority: 4000, Regex: "(\\b|_)ppv[^a-zA-Z0-9]?rip(\\b|_)", Strings: "ppvrip,ppv.rip,ppv rip,ppv-rip,ppv_rip"},
	{Type: 2, Name: "preair", Priority: 4300, Regex: "(\\b|_)preair(\\b|_)", Strings: "preair"},
	{Type: 2, Name: "tvrip", Priority: 5000, Regex: "(\\b|_)tv[^a-zA-Z0-9]?rip(\\b|_)", Strings: "tvrip,tv.rip,tv rip,tv-rip,tv_rip"},
	{Type: 2, Name: "dsr", Priority: 5300, Regex: "(\\b|_)(dsr|ds)[^a-zA-Z0-9]?rip(\\b|_)", Strings: "dsrip,ds.rip,ds rip,ds-rip,ds_rip,dsrrip,dsr.rip,dsr rip,dsr-rip,dsr_rip"},
	{Type: 2, Name: "sdtv", Priority: 6000, Regex: "(\\b|_)(?:[sp]dtv|dvb)(?:[^a-zA-Z0-9]?rip)?(\\b|_)", Strings: "sdtv,pdtv,dvb,sdtvrip,sdtv.rip,sdtv rip,sdtv-rip,sdtv_rip,pdtvrip,pdtv.rip,pdtv rip,pdtv-rip,pdtv_rip,dvbrip,dvb.rip,dvb rip,dvb-rip,dvb_rip"},
	{Type: 2, Name: "dvdscr", Priority: 6300, Regex: "(\\b|_)(?:(?:dvd|web)[^a-zA-Z0-9]?)?scr(?:eener)?(\\b|_)", Strings: "webscr,webscreener,web.scr,web.screener,web-scr,web-screener,web scr,web screener,web_scr,web_screener,dvdscr,dvdscreener,dvd.scr,dvd.screener,dvd-scr,dvd-screener,dvd scr,dvd screener,dvd_scr,dvd_screener"},
	{Type: 2, Name: "bdscr", Priority: 7000, Regex: "(\\b|_)bdscr(?:eener)?(\\b|_)", Strings: "bdscr,bdscreener"},
	{Type: 2, Name: "webrip", Priority: 7300, Regex: "(\\b|_)web[^a-zA-Z0-9]?rip(\\b|_)", Strings: "webrip,web.rip,web rip,web-rip,web_rip"},
	{Type: 2, Name: "hdtv", Priority: 8000, Regex: "(\\b|_)a?hdtv(?:[^a-zA-Z0-9]?rip)?(\\b|_)", Strings: "hdtv,hdtvrip,hdtv.rip,hdtv rip,hdtv-rip,hdtv_rip"},
	{Type: 2, Name: "webdl", Priority: 8300, Regex: "(\\b|_)web(?:[^a-zA-Z0-9]?(dl|hd))?(\\b|_)", Strings: "webdl,web dl,web.dl,web-dl,web_dl,webhd,web.hd,web hd,web-hd,web_hd"},
	{Type: 2, Name: "dvdrip", Priority: 9000, Regex: "(\\b|_)(dvd[^a-zA-Z0-9]?rip|hddvd)(\\b|_)", Strings: "dvdrip,dvd.rip,dvd rip,dvd-rip,dvd_rip,hddvd,dvd"},
	{Type: 2, Name: "remux", Priority: 9100, Regex: "(\\b|_)remux(\\b|_)", Strings: "remux"},
	{Type: 2, Name: "bluray", Priority: 9300, Regex: "(\\b|_)(?:b[dr][^a-zA-Z0-9]?rip|blu[^a-zA-Z0-9]?ray(?:[^a-zA-Z0-9]?rip)?)(\\b|_)", Strings: "bdrip,bd.rip,bd rip,bd-rip,bd_rip,brrip,br.rip,br rip,br-rip,br_rip,bluray,blu ray,blu.ray,blu-ray,blu_ray"}}
View Source
var ListResolutions = []Qualities{
	{Type: 1, Name: "360p", Priority: 10000, Regex: "(\\b|_)360p(\\b|_)", Strings: "360p,360i"},
	{Type: 1, Name: "368p", Priority: 20000, Regex: "(\\b|_)368p(\\b|_)", Strings: "368p,368i"},
	{Type: 1, Name: "480p", Priority: 30000, Regex: "(\\b|_)480p(\\b|_)", Strings: "480p,480i"},
	{Type: 1, Name: "576p", Priority: 40000, Regex: "(\\b|_)576p(\\b|_)", Strings: "576p,576i"},
	{Type: 1, Name: "720p", Priority: 50000, Regex: "(\\b|_)(1280x)?720(i|p)(\\b|_)", Strings: "720p,720i"},
	{Type: 1, Name: "1080p", Priority: 60000, Regex: "(\\b|_)(1920x)?1080(i|p)(\\b|_)", Strings: "1080p,1080i"},
	{Type: 1, Name: "2160p", Priority: 70000, Regex: "(\\b|_)((3840x)?2160p|4k)(\\b|_)", Strings: "2160p,2160i"}}
View Source
var ReadWriteMu *sync.RWMutex
View Source
var SQLDB *sql.DB
View Source
var WriteMu *sync.Mutex

Functions

func Backup

func Backup(db *sqlx.DB, backupPath string, maxbackups int) error

Backup the database. If db is nil, then uses the existing database connection.

func CountRows

func CountRows(table string, qu Query) (int, error)

Uses column id

func CountRowsStatic

func CountRowsStatic(query string, args ...interface{}) (int, error)

func DbIntegrityCheck

func DbIntegrityCheck() string

func DbQuickCheck

func DbQuickCheck() string

func DeleteRow

func DeleteRow(table string, qu Query) (sql.Result, error)

func GetVars

func GetVars()

func ImdbCountRows

func ImdbCountRows(table string, qu Query) (int, error)

Uses column id

func ImdbCountRowsStatic

func ImdbCountRowsStatic(query string, args ...interface{}) (int, error)

func ImdbDeleteRow

func ImdbDeleteRow(table string, qu Query) (sql.Result, error)

func ImdbInsertArray

func ImdbInsertArray(table string, columns []string, values []interface{}) (sql.Result, error)

func ImdbUpdateArray

func ImdbUpdateArray(table string, columns []string, values []interface{}, qu Query) (sql.Result, error)

func ImdbUpdateColumn

func ImdbUpdateColumn(table string, column string, value interface{}, qu Query) (sql.Result, error)

func InitDb

func InitDb(dbloglevel string)

func InitImdbdb

func InitImdbdb(dbloglevel string, dbfile string) *sqlx.DB

func InsertArray

func InsertArray(table string, columns []string, values []interface{}) (sql.Result, error)

func QueryColumnStatic

func QueryColumnStatic(query string, args ...interface{}) (interface{}, error)

func QueryStructStatic

func QueryStructStatic(query string, getstruct interface{}, args ...interface{}) error

func QueryStructStaticArray

func QueryStructStaticArray(query string, querycount string, getstruct interface{}, args ...interface{}) ([]interface{}, error)

func RemoveOldDbBackups

func RemoveOldDbBackups(max int) error

func UpdateArray

func UpdateArray(table string, columns []string, values []interface{}, qu Query) (sql.Result, error)

func UpdateColumn

func UpdateColumn(table string, column string, value interface{}, qu Query) (sql.Result, error)

func Upgrade

func Upgrade(c *gin.Context)

func UpgradeDB

func UpgradeDB()

func UpsertArray

func UpsertArray(table string, columns []string, values []interface{}, qu Query) (sql.Result, error)

Types

type Dbfiles

type Dbfiles struct {
	Location string
	ID       uint
}

func QueryDbfiles

func QueryDbfiles(query string, querycount string, args ...interface{}) ([]Dbfiles, error)

requires 2 columns - string and uint (location and id)

type Dbmovie

type Dbmovie struct {
	ID               uint
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
	Title            string
	ReleaseDate      sql.NullTime `db:"release_date" json:"release_date" time_format:"2006-01-02" time_utc:"1"`
	Year             int
	Adult            bool
	Budget           int
	Genres           string
	OriginalLanguage string `db:"original_language"`
	OriginalTitle    string `db:"original_title"`
	Overview         string
	Popularity       float32
	Revenue          int
	Runtime          int
	SpokenLanguages  string `db:"spoken_languages"`
	Status           string
	Tagline          string
	VoteAverage      float32 `db:"vote_average"`
	VoteCount        int     `db:"vote_count"`
	TraktID          int     `db:"trakt_id"`
	MoviedbID        int     `db:"moviedb_id"`
	ImdbID           string  `db:"imdb_id"`
	FreebaseMID      string  `db:"freebase_m_id"`
	FreebaseID       string  `db:"freebase_id"`
	FacebookID       string  `db:"facebook_id"`
	InstagramID      string  `db:"instagram_id"`
	TwitterID        string  `db:"twitter_id"`
	URL              string
	Backdrop         string
	Poster           string
	Slug             string
}

func GetDbmovie

func GetDbmovie(qu Query) (Dbmovie, error)

func QueryDbmovie

func QueryDbmovie(qu Query) ([]Dbmovie, error)

func (*Dbmovie) AddMissingMoviesMapping

func (dbmovie *Dbmovie) AddMissingMoviesMapping(listname string, quality string) []Movie

func (*Dbmovie) ClearAndGetTitles

func (movie *Dbmovie) ClearAndGetTitles(allowed []string, queryimdb bool, querytmdb bool, querytrakt bool) []DbmovieTitle

func (*Dbmovie) GetImdbMetadata

func (movie *Dbmovie) GetImdbMetadata(overwrite bool)

func (*Dbmovie) GetMetadata

func (movie *Dbmovie) GetMetadata(queryimdb bool, querytmdb bool, queryomdb bool, querytrakt bool)

func (*Dbmovie) GetOmdbMetadata

func (movie *Dbmovie) GetOmdbMetadata(overwrite bool)

func (*Dbmovie) GetTitles

func (movie *Dbmovie) GetTitles(allowed []string, queryimdb bool, querytmdb bool, querytrakt bool) []DbmovieTitle

func (*Dbmovie) GetTmdbMetadata

func (movie *Dbmovie) GetTmdbMetadata(overwrite bool)

func (*Dbmovie) GetTraktMetadata

func (movie *Dbmovie) GetTraktMetadata(overwrite bool)

type DbmovieJson

type DbmovieJson struct {
	ID               uint
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
	Title            string
	ReleaseDate      time.Time `db:"release_date" json:"release_date" time_format:"2006-01-02" time_utc:"1"`
	Year             int
	Adult            bool
	Budget           int
	Genres           string
	OriginalLanguage string `db:"original_language"`
	OriginalTitle    string `db:"original_title"`
	Overview         string
	Popularity       float32
	Revenue          int
	Runtime          int
	SpokenLanguages  string `db:"spoken_languages"`
	Status           string
	Tagline          string
	VoteAverage      float32 `db:"vote_average"`
	VoteCount        int     `db:"vote_count"`
	TraktID          int     `db:"trakt_id"`
	MoviedbID        int     `db:"moviedb_id"`
	ImdbID           string  `db:"imdb_id"`
	FreebaseMID      string  `db:"freebase_m_id"`
	FreebaseID       string  `db:"freebase_id"`
	FacebookID       string  `db:"facebook_id"`
	InstagramID      string  `db:"instagram_id"`
	TwitterID        string  `db:"twitter_id"`
	URL              string
	Backdrop         string
	Poster           string
	Slug             string
}

func QueryDbmovieJson

func QueryDbmovieJson(qu Query) ([]DbmovieJson, error)

type DbmovieTitle

type DbmovieTitle struct {
	ID        uint
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	DbmovieID uint      `db:"dbmovie_id"`
	Title     string
	Slug      string
	Region    string
}

func GetDbmovieTitle

func GetDbmovieTitle(qu Query) (DbmovieTitle, error)

func QueryDbmovieTitle

func QueryDbmovieTitle(qu Query) ([]DbmovieTitle, error)

type Dbserie

type Dbserie struct {
	ID              uint
	CreatedAt       time.Time `db:"created_at"`
	UpdatedAt       time.Time `db:"updated_at"`
	Seriename       string
	Aliases         string
	Season          string
	Status          string
	Firstaired      string
	Network         string
	Runtime         string
	Language        string
	Genre           string
	Overview        string
	Rating          string
	Siterating      string
	SiteratingCount string `db:"siterating_count"`
	Slug            string
	TraktID         int    `db:"trakt_id"`
	ImdbID          string `db:"imdb_id"`
	ThetvdbID       int    `db:"thetvdb_id"`
	FreebaseMID     string `db:"freebase_m_id"`
	FreebaseID      string `db:"freebase_id"`
	TvrageID        int    `db:"tvrage_id"`
	Facebook        string
	Instagram       string
	Twitter         string
	Banner          string
	Poster          string
	Fanart          string
	Identifiedby    string
}

func GetDbserie

func GetDbserie(qu Query) (Dbserie, error)

func QueryDbserie

func QueryDbserie(qu Query) ([]Dbserie, error)

func (*Dbserie) GetEpisodes

func (serie *Dbserie) GetEpisodes(language string, querytrakt bool) []DbserieEpisode

func (*Dbserie) GetMetadata

func (serie *Dbserie) GetMetadata(language string, querytmdb bool, allowed []string, querytrakt bool, overwrite bool) []string

func (*Dbserie) GetTitles

func (serie *Dbserie) GetTitles(allowed []string, queryimdb bool, querytrakt bool) []DbserieAlternate

type DbserieAlternate

type DbserieAlternate struct {
	ID        uint
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Title     string
	Slug      string
	Region    string
	DbserieID uint `db:"dbserie_id"`
}

func GetDbserieAlternates

func GetDbserieAlternates(qu Query) (DbserieAlternate, error)

func QueryDbserieAlternates

func QueryDbserieAlternates(qu Query) ([]DbserieAlternate, error)

type DbserieEpisode

type DbserieEpisode struct {
	ID         uint
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
	Episode    string
	Season     string
	Identifier string
	Title      string
	FirstAired sql.NullTime `db:"first_aired" json:"first_aired" time_format:"2006-01-02" time_utc:"1"`
	Overview   string
	Poster     string
	Runtime    int
	DbserieID  uint `db:"dbserie_id"`
}

func GetDbserieEpisodes

func GetDbserieEpisodes(qu Query) (DbserieEpisode, error)

func QueryDbserieEpisodes

func QueryDbserieEpisodes(qu Query) ([]DbserieEpisode, error)

type DbserieEpisodeJson

type DbserieEpisodeJson struct {
	ID         uint
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
	Episode    string
	Season     string
	Identifier string
	Title      string
	FirstAired time.Time `db:"first_aired" json:"first_aired" time_format:"2006-01-02" time_utc:"1"`
	Overview   string
	Poster     string
	DbserieID  uint `db:"dbserie_id"`
}

type Dbstatic_OneInt

type Dbstatic_OneInt struct {
	Num int
}

func QueryStaticColumnsOneInt

func QueryStaticColumnsOneInt(query string, querycount string, args ...interface{}) ([]Dbstatic_OneInt, error)

requires 1 column - int

type Dbstatic_OneString

type Dbstatic_OneString struct {
	Str string
}

func QueryImdbStaticColumnsOneString

func QueryImdbStaticColumnsOneString(query string, querycount string, args ...interface{}) ([]Dbstatic_OneString, error)

requires 1 column - string

func QueryStaticColumnsOneString

func QueryStaticColumnsOneString(query string, querycount string, args ...interface{}) ([]Dbstatic_OneString, error)

requires 1 column - string

func QueryStaticColumnsOneStringNoError

func QueryStaticColumnsOneStringNoError(query string, querycount string, args ...interface{}) []Dbstatic_OneString

requires 1 column - string

type Dbstatic_OneStringOneInt

type Dbstatic_OneStringOneInt struct {
	Str string
	Num int
}

func QueryImdbStaticColumnsOneStringOneInt

func QueryImdbStaticColumnsOneStringOneInt(query string, querycount string, args ...interface{}) ([]Dbstatic_OneStringOneInt, error)

requires 2 columns- string and int

func QueryStaticColumnsOneStringOneInt

func QueryStaticColumnsOneStringOneInt(query string, querycount string, args ...interface{}) ([]Dbstatic_OneStringOneInt, error)

requires 2 columns- string and int

type Dbstatic_TwoInt

type Dbstatic_TwoInt struct {
	Num1 int
	Num2 int
}

func QueryStaticColumnsTwoInt

func QueryStaticColumnsTwoInt(query string, querycount string, args ...interface{}) ([]Dbstatic_TwoInt, error)

requires 2 columns- int and int

type Dbstatic_TwoString

type Dbstatic_TwoString struct {
	Str1 string
	Str2 string
}

func QueryStaticColumnsTwoString

func QueryStaticColumnsTwoString(query string, querycount string, args ...interface{}) ([]Dbstatic_TwoString, error)

requires 2 columns - string

type ImdbAka

type ImdbAka struct {
	ID              uint
	CreatedAt       time.Time `db:"created_at"`
	UpdatedAt       time.Time `db:"updated_at"`
	Tconst          string
	Ordering        int
	Title           string
	Slug            string
	Region          string
	Language        string
	Types           string
	Attributes      string
	IsOriginalTitle bool `db:"is_original_title"`
}

func GetImdbAka

func GetImdbAka(qu Query) (ImdbAka, error)

func QueryImdbAka

func QueryImdbAka(qu Query) ([]ImdbAka, error)

type ImdbGenres

type ImdbGenres struct {
	ID        uint
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Tconst    string
	Genre     string
}

func GetImdbGenre

func GetImdbGenre(qu Query) (ImdbGenres, error)

func QueryImdbGenre

func QueryImdbGenre(qu Query) ([]ImdbGenres, error)

type ImdbRatings

type ImdbRatings struct {
	ID            uint
	CreatedAt     time.Time `db:"created_at"`
	UpdatedAt     time.Time `db:"updated_at"`
	Tconst        string
	NumVotes      int     `db:"num_votes"`
	AverageRating float32 `db:"average_rating"`
}

func GetImdbRating

func GetImdbRating(qu Query) (ImdbRatings, error)

func QueryImdbRating

func QueryImdbRating(qu Query) ([]ImdbRatings, error)

type ImdbTitle

type ImdbTitle struct {
	Tconst         string
	TitleType      string `db:"title_type"`
	PrimaryTitle   string `db:"primary_title"`
	Slug           string
	OriginalTitle  string `db:"original_title"`
	IsAdult        bool   `db:"is_adult"`
	StartYear      int    `db:"start_year"`
	EndYear        int    `db:"end_year"`
	RuntimeMinutes int    `db:"runtime_minutes"`
	Genres         string
}

func GetImdbTitle

func GetImdbTitle(qu Query) (ImdbTitle, error)

func QueryImdbTitle

func QueryImdbTitle(qu Query) ([]ImdbTitle, error)

type IndexerFail

type IndexerFail struct {
	ID        uint
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Indexer   string
	LastFail  sql.NullTime `db:"last_fail"`
}

func GetIndexerFails

func GetIndexerFails(qu Query) (IndexerFail, error)

func QueryIndexerFails

func QueryIndexerFails(qu Query) ([]IndexerFail, error)

type JobHistory

type JobHistory struct {
	ID          uint
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
	JobType     string    `db:"job_type"`
	JobCategory string    `db:"job_category"`
	JobGroup    string    `db:"job_group"`
	Started     sql.NullTime
	Ended       sql.NullTime
}

func GetJobHistory

func GetJobHistory(qu Query) (JobHistory, error)

func QueryJobHistory

func QueryJobHistory(qu Query) ([]JobHistory, error)

type JobHistoryJson

type JobHistoryJson struct {
	ID          uint
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
	JobType     string    `db:"job_type"`
	JobCategory string    `db:"job_category"`
	JobGroup    string    `db:"job_group"`
	Started     time.Time
	Ended       time.Time
}

type Movie

type Movie struct {
	ID             uint
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Lastscan       sql.NullTime
	Blacklisted    bool
	QualityReached bool   `db:"quality_reached"`
	QualityProfile string `db:"quality_profile"`
	Missing        bool
	DontUpgrade    bool `db:"dont_upgrade"`
	DontSearch     bool `db:"dont_search"`
	Listname       string
	Rootpath       string
	DbmovieID      uint `db:"dbmovie_id"`
}

func GetMovies

func GetMovies(qu Query) (Movie, error)

func QueryMovies

func QueryMovies(qu Query) ([]Movie, error)

func (*Movie) UpdateMoviesMapping

func (movie *Movie) UpdateMoviesMapping(listname string, quality string)

type MovieFile

type MovieFile struct {
	ID             uint
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Location       string
	Filename       string
	Extension      string
	QualityProfile string `db:"quality_profile"`
	Proper         bool
	Extended       bool
	Repack         bool
	Height         int
	Width          int
	ResolutionID   uint `db:"resolution_id"`
	QualityID      uint `db:"quality_id"`
	CodecID        uint `db:"codec_id"`
	AudioID        uint `db:"audio_id"`
	MovieID        uint `db:"movie_id"`
	DbmovieID      uint `db:"dbmovie_id"`
}

func GetMovieFiles

func GetMovieFiles(qu Query) (MovieFile, error)

func QueryMovieFiles

func QueryMovieFiles(qu Query) ([]MovieFile, error)

type MovieFileUnmatched

type MovieFileUnmatched struct {
	ID          uint
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
	Listname    string
	Filepath    string
	LastChecked sql.NullTime `db:"last_checked"`
	ParsedData  string       `db:"parsed_data"`
}

func GetMovieFileUnmatched

func GetMovieFileUnmatched(qu Query) (MovieFileUnmatched, error)

func QueryMovieFileUnmatched

func QueryMovieFileUnmatched(qu Query) ([]MovieFileUnmatched, error)

type MovieFileUnmatchedJson

type MovieFileUnmatchedJson struct {
	ID          uint
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
	Listname    string
	Filepath    string
	LastChecked time.Time `db:"last_checked" json:"last_checked" time_format:"2006-01-02 22:00" time_utc:"1"`
	ParsedData  string    `db:"parsed_data"`
}

type MovieHistory

type MovieHistory struct {
	ID             uint
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Title          string
	URL            string
	Indexer        string
	Type           string
	Target         string
	DownloadedAt   time.Time `db:"downloaded_at"`
	Blacklisted    bool
	QualityProfile string `db:"quality_profile"`
	ResolutionID   uint   `db:"resolution_id"`
	QualityID      uint   `db:"quality_id"`
	CodecID        uint   `db:"codec_id"`
	AudioID        uint   `db:"audio_id"`
	MovieID        uint   `db:"movie_id"`
	DbmovieID      uint   `db:"dbmovie_id"`
}

func GetMovieHistory

func GetMovieHistory(qu Query) (MovieHistory, error)

func QueryMovieHistory

func QueryMovieHistory(qu Query) ([]MovieHistory, error)

type MovieJson

type MovieJson struct {
	ID             uint
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Lastscan       time.Time `db:"lastscan" json:"lastscan" time_format:"2006-01-02 22:00" time_utc:"1"`
	Blacklisted    bool
	QualityReached bool   `db:"quality_reached"`
	QualityProfile string `db:"quality_profile"`
	Missing        bool
	DontUpgrade    bool `db:"dont_upgrade"`
	DontSearch     bool `db:"dont_search"`
	Listname       string
	Rootpath       string
	DbmovieID      uint `db:"dbmovie_id"`
}

type Mysqlite

type Mysqlite struct {
	db.Base
}

Sqlite is a Connection of sqlite.

func GetSqliteDB

func GetSqliteDB() *Mysqlite

GetSqliteDB return the global sqlite connection.

func (*Mysqlite) BeginTx

func (d *Mysqlite) BeginTx() *sql.Tx

BeginTx starts a transaction with level LevelDefault.

func (*Mysqlite) BeginTxAndConnection

func (d *Mysqlite) BeginTxAndConnection(conn string) *sql.Tx

BeginTxAndConnection starts a transaction with level LevelDefault and connection.

func (*Mysqlite) BeginTxWithLevel

func (d *Mysqlite) BeginTxWithLevel(level sql.IsolationLevel) *sql.Tx

BeginTxWithLevel starts a transaction with given transaction isolation level.

func (*Mysqlite) BeginTxWithLevelAndConnection

func (d *Mysqlite) BeginTxWithLevelAndConnection(conn string, level sql.IsolationLevel) *sql.Tx

BeginTxWithLevelAndConnection starts a transaction with given transaction isolation level and connection.

func (*Mysqlite) BeginTxWithReadCommitted

func (d *Mysqlite) BeginTxWithReadCommitted() *sql.Tx

BeginTxWithReadCommitted starts a transaction with level LevelReadCommitted.

func (*Mysqlite) BeginTxWithReadCommittedAndConnection

func (d *Mysqlite) BeginTxWithReadCommittedAndConnection(conn string) *sql.Tx

BeginTxWithReadCommittedAndConnection starts a transaction with level LevelReadCommitted and connection.

func (*Mysqlite) BeginTxWithReadUncommitted

func (d *Mysqlite) BeginTxWithReadUncommitted() *sql.Tx

BeginTxWithReadUncommitted starts a transaction with level LevelReadUncommitted.

func (*Mysqlite) BeginTxWithReadUncommittedAndConnection

func (d *Mysqlite) BeginTxWithReadUncommittedAndConnection(conn string) *sql.Tx

BeginTxWithReadUncommittedAndConnection starts a transaction with level LevelReadUncommitted and connection.

func (*Mysqlite) BeginTxWithRepeatableRead

func (d *Mysqlite) BeginTxWithRepeatableRead() *sql.Tx

BeginTxWithRepeatableRead starts a transaction with level LevelRepeatableRead.

func (*Mysqlite) BeginTxWithRepeatableReadAndConnection

func (d *Mysqlite) BeginTxWithRepeatableReadAndConnection(conn string) *sql.Tx

BeginTxWithRepeatableReadAndConnection starts a transaction with level LevelRepeatableRead and connection.

func (*Mysqlite) Exec

func (d *Mysqlite) Exec(query string, args ...interface{}) (sql.Result, error)

Exec implements the method Connection.Exec.

func (*Mysqlite) ExecWith

func (d *Mysqlite) ExecWith(tx *sql.Tx, conn, query string, args ...interface{}) (sql.Result, error)

func (*Mysqlite) ExecWithConnection

func (d *Mysqlite) ExecWithConnection(con string, query string, args ...interface{}) (sql.Result, error)

ExecWithConnection implements the method Connection.ExecWithConnection.

func (*Mysqlite) ExecWithTx

func (d *Mysqlite) ExecWithTx(tx *sql.Tx, query string, args ...interface{}) (sql.Result, error)

ExecWithTx is exec method within the transaction.

func (*Mysqlite) GetDelimiter

func (d *Mysqlite) GetDelimiter() string

GetDelimiter implements the method Connection.GetDelimiter.

func (*Mysqlite) GetDelimiter2

func (d *Mysqlite) GetDelimiter2() string

GetDelimiter2 implements the method Connection.GetDelimiter2.

func (*Mysqlite) GetDelimiters

func (d *Mysqlite) GetDelimiters() []string

GetDelimiters implements the method Connection.GetDelimiters.

func (*Mysqlite) InitDB

func (d *Mysqlite) InitDB(cfgList map[string]config.Database) db.Connection

InitDB implements the method Connection.InitDB.

func (*Mysqlite) Name

func (d *Mysqlite) Name() string

Name implements the method Connection.Name.

func (*Mysqlite) Query

func (d *Mysqlite) Query(query string, args ...interface{}) ([]map[string]interface{}, error)

Query implements the method Connection.Query.

func (*Mysqlite) QueryWith

func (d *Mysqlite) QueryWith(tx *sql.Tx, conn, query string, args ...interface{}) ([]map[string]interface{}, error)

func (*Mysqlite) QueryWithConnection

func (d *Mysqlite) QueryWithConnection(con string, query string, args ...interface{}) ([]map[string]interface{}, error)

QueryWithConnection implements the method Connection.QueryWithConnection.

func (*Mysqlite) QueryWithTx

func (d *Mysqlite) QueryWithTx(tx *sql.Tx, query string, args ...interface{}) ([]map[string]interface{}, error)

QueryWithTx is query method within the transaction.

type Qualities

type Qualities struct {
	ID        uint
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Type      int
	Name      string
	Regex     string
	Strings   string
	Priority  int
	UseRegex  bool `db:"use_regex"`
}

type 1 reso 2 qual 3 codec 4 audio

func GetQualities

func GetQualities(qu Query) (Qualities, error)

func QueryQualities

func QueryQualities(qu Query) ([]Qualities, error)

type QualitiesRegex

type QualitiesRegex struct {
	Regex string
	Qualities
}

type Query

type Query struct {
	Select    string
	Where     string
	WhereArgs []interface{}
	OrderBy   string
	Limit     uint64
	Offset    uint64
	InnerJoin string
}

type RSSHistory

type RSSHistory struct {
	ID        uint
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Config    string
	List      string
	Indexer   string
	LastID    string `db:"last_id"`
}

func GetRssHistory

func GetRssHistory(qu Query) (RSSHistory, error)

func QueryRssHistory

func QueryRssHistory(qu Query) ([]RSSHistory, error)

type ResultMovies

type ResultMovies struct {
	Dbmovie
	Listname       string
	Lastscan       sql.NullTime
	Blacklisted    bool
	QualityReached bool   `db:"quality_reached"`
	QualityProfile string `db:"quality_profile"`
	Rootpath       string
	Missing        bool
	DbmovieID      uint `db:"dbmovie_id"`
}

func GetResultMovies

func GetResultMovies(qu Query) (ResultMovies, error)

func QueryResultMovies

func QueryResultMovies(qu Query) ([]ResultMovies, error)

type ResultMoviesJson

type ResultMoviesJson struct {
	DbmovieJson
	Listname       string
	Lastscan       time.Time `db:"lastscan" json:"lastscan" time_format:"2006-01-02 22:00" time_utc:"1"`
	Blacklisted    bool
	QualityReached bool   `db:"quality_reached"`
	QualityProfile string `db:"quality_profile"`
	Rootpath       string
	Missing        bool
	DbmovieID      uint `db:"dbmovie_id"`
}

type ResultSerieEpisodes

type ResultSerieEpisodes struct {
	DbserieEpisode
	Listname         string
	Rootpath         string
	Lastscan         sql.NullTime
	Blacklisted      bool
	QualityReached   bool   `db:"quality_reached"`
	QualityProfile   string `db:"quality_profile"`
	Missing          bool
	DbserieEpisodeID uint `db:"dbserie_episode_id"`
}

func GetResultSerieEpisodes

func GetResultSerieEpisodes(qu Query) (ResultSerieEpisodes, error)

func QueryResultSerieEpisodes

func QueryResultSerieEpisodes(qu Query) ([]ResultSerieEpisodes, error)

type ResultSerieEpisodesJson

type ResultSerieEpisodesJson struct {
	DbserieEpisodeJson
	Listname         string
	Rootpath         string
	Lastscan         time.Time `db:"lastscan" json:"lastscan" time_format:"2006-01-02 22:00" time_utc:"1"`
	Blacklisted      bool
	QualityReached   bool   `db:"quality_reached"`
	QualityProfile   string `db:"quality_profile"`
	Missing          bool
	DbserieEpisodeID uint `db:"dbserie_episode_id"`
}

type ResultSeries

type ResultSeries struct {
	Dbserie
	Listname  string
	Rootpath  string
	DbserieID uint `db:"dbserie_id"`
}

func GetResultSeries

func GetResultSeries(qu Query) (ResultSeries, error)

func QueryResultSeries

func QueryResultSeries(qu Query) ([]ResultSeries, error)

type Serie

type Serie struct {
	ID             uint
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Listname       string
	Rootpath       string
	DbserieID      uint `db:"dbserie_id"`
	DontUpgrade    bool `db:"dont_upgrade"`
	DontSearch     bool `db:"dont_search"`
	SearchSpecials bool `db:"search_specials"`
	IgnoreRuntime  bool `db:"ignore_runtime"`
}

func GetSeries

func GetSeries(qu Query) (Serie, error)

func QuerySeries

func QuerySeries(qu Query) ([]Serie, error)

type SerieEpisode

type SerieEpisode struct {
	ID               uint
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
	Lastscan         sql.NullTime
	Blacklisted      bool
	QualityReached   bool   `db:"quality_reached"`
	QualityProfile   string `db:"quality_profile"`
	Missing          bool
	DontUpgrade      bool `db:"dont_upgrade"`
	DontSearch       bool `db:"dont_search"`
	IgnoreRuntime    bool `db:"ignore_runtime"`
	DbserieEpisodeID uint `db:"dbserie_episode_id"`
	SerieID          uint `db:"serie_id"`
	DbserieID        uint `db:"dbserie_id"`
}

func GetSerieEpisodes

func GetSerieEpisodes(qu Query) (SerieEpisode, error)

func QuerySerieEpisodes

func QuerySerieEpisodes(qu Query) ([]SerieEpisode, error)

type SerieEpisodeFile

type SerieEpisodeFile struct {
	ID               uint
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
	Location         string
	Filename         string
	Extension        string
	QualityProfile   string `db:"quality_profile"`
	Proper           bool
	Extended         bool
	Repack           bool
	Height           int
	Width            int
	ResolutionID     uint `db:"resolution_id"`
	QualityID        uint `db:"quality_id"`
	CodecID          uint `db:"codec_id"`
	AudioID          uint `db:"audio_id"`
	SerieID          uint `db:"serie_id"`
	SerieEpisodeID   uint `db:"serie_episode_id"`
	DbserieEpisodeID uint `db:"dbserie_episode_id"`
	DbserieID        uint `db:"dbserie_id"`
}

func GetSerieEpisodeFiles

func GetSerieEpisodeFiles(qu Query) (SerieEpisodeFile, error)

func QuerySerieEpisodeFiles

func QuerySerieEpisodeFiles(qu Query) ([]SerieEpisodeFile, error)

type SerieEpisodeHistory

type SerieEpisodeHistory struct {
	ID               uint
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
	Title            string
	URL              string
	Indexer          string
	Type             string
	Target           string
	DownloadedAt     time.Time `db:"downloaded_at"`
	Blacklisted      bool
	QualityProfile   string `db:"quality_profile"`
	ResolutionID     uint   `db:"resolution_id"`
	QualityID        uint   `db:"quality_id"`
	CodecID          uint   `db:"codec_id"`
	AudioID          uint   `db:"audio_id"`
	SerieID          uint   `db:"serie_id"`
	SerieEpisodeID   uint   `db:"serie_episode_id"`
	DbserieEpisodeID uint   `db:"dbserie_episode_id"`
	DbserieID        uint   `db:"dbserie_id"`
}

func GetSerieEpisodeHistory

func GetSerieEpisodeHistory(qu Query) (SerieEpisodeHistory, error)

func QuerySerieEpisodeHistory

func QuerySerieEpisodeHistory(qu Query) ([]SerieEpisodeHistory, error)

type SerieEpisodeJson

type SerieEpisodeJson struct {
	ID               uint
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
	Lastscan         time.Time `db:"lastscan" json:"lastscan" time_format:"2006-01-02 22:00" time_utc:"1"`
	Blacklisted      bool
	QualityReached   bool   `db:"quality_reached"`
	QualityProfile   string `db:"quality_profile"`
	Missing          bool
	DontUpgrade      bool `db:"dont_upgrade"`
	DontSearch       bool `db:"dont_search"`
	DbserieEpisodeID uint `db:"dbserie_episode_id"`
	SerieID          uint `db:"serie_id"`
	DbserieID        uint `db:"dbserie_id"`
}

type SerieFileUnmatched

type SerieFileUnmatched struct {
	ID          uint
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
	Listname    string
	Filepath    string
	LastChecked sql.NullTime `db:"last_checked"`
	ParsedData  string       `db:"parsed_data"`
}

func GetSerieFileUnmatched

func GetSerieFileUnmatched(qu Query) (SerieFileUnmatched, error)

func QuerySerieFileUnmatched

func QuerySerieFileUnmatched(qu Query) ([]SerieFileUnmatched, error)

type SerieFileUnmatchedJson

type SerieFileUnmatchedJson struct {
	ID          uint
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
	Listname    string
	Filepath    string
	LastChecked time.Time `db:"last_checked" json:"last_checked" time_format:"2006-01-02 22:00" time_utc:"1"`
	ParsedData  string    `db:"parsed_data"`
}

type SerieJson

type SerieJson struct {
	ID             uint
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Listname       string
	Rootpath       string
	DbserieID      uint `db:"dbserie_id"`
	DontUpgrade    bool `db:"dont_upgrade"`
	DontSearch     bool `db:"dont_search"`
	SearchSpecials bool `db:"search_specials"`
	IgnoreRuntime  bool `db:"ignore_runtime"`
}

Jump to

Keyboard shortcuts

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