model

package
v0.10.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const SourceImdb = "imdb"
View Source
const SourceTmdb = "tmdb"
View Source
const SourceTvdb = "tvdb"
View Source
const TableNameBloomFilter = "bloom_filters"
View Source
const TableNameContent = "content"
View Source
const TableNameContentAttribute = "content_attributes"
View Source
const TableNameContentCollection = "content_collections"
View Source
const TableNameContentCollectionContent = "content_collections_content"
View Source
const TableNameKeyValue = "key_values"
View Source
const TableNameMetadataSource = "metadata_sources"
View Source
const TableNameQueueJob = "queue_jobs"
View Source
const TableNameTorrent = "torrents"
View Source
const TableNameTorrentContent = "torrent_contents"
View Source
const TableNameTorrentFile = "torrent_files"
View Source
const TableNameTorrentHint = "torrent_hints"
View Source
const TableNameTorrentPieces = "torrent_pieces"
View Source
const TableNameTorrentSource = "torrent_sources"
View Source
const TableNameTorrentTag = "torrent_tags"
View Source
const TableNameTorrentsTorrentSource = "torrents_torrent_sources"

Variables

View Source
var EpisodesToken = rex.Group.Composite(
	episodesRegularTokens,
	episodesXFormatTokens,
)
View Source
var ErrInvalidContentType = fmt.Errorf("not a valid ContentType, try [%s]", strings.Join(_ContentTypeNames, ", "))
View Source
var ErrInvalidFacetLogic = fmt.Errorf("not a valid FacetLogic, try [%s]", strings.Join(_FacetLogicNames, ", "))
View Source
var ErrInvalidFileType = fmt.Errorf("not a valid FileType, try [%s]", strings.Join(_FileTypeNames, ", "))
View Source
var ErrInvalidFilesStatus = fmt.Errorf("not a valid FilesStatus, try [%s]", strings.Join(_FilesStatusNames, ", "))
View Source
var ErrInvalidQueueJobStatus = fmt.Errorf("not a valid QueueJobStatus, try [%s]", strings.Join(_QueueJobStatusNames, ", "))
View Source
var ErrInvalidVideo3D = fmt.Errorf("not a valid Video3D, try [%s]", strings.Join(_Video3DNames, ", "))
View Source
var ErrInvalidVideoCodec = fmt.Errorf("not a valid VideoCodec, try [%s]", strings.Join(_VideoCodecNames, ", "))
View Source
var ErrInvalidVideoModifier = fmt.Errorf("not a valid VideoModifier, try [%s]", strings.Join(_VideoModifierNames, ", "))
View Source
var ErrInvalidVideoResolution = fmt.Errorf("not a valid VideoResolution, try [%s]", strings.Join(_VideoResolutionNames, ", "))
View Source
var ErrInvalidVideoSource = fmt.Errorf("not a valid VideoSource, try [%s]", strings.Join(_VideoSourceNames, ", "))

Functions

func ContentTypeNames

func ContentTypeNames() []string

ContentTypeNames returns a list of possible string values of ContentType.

func FacetLogicNames

func FacetLogicNames() []string

FacetLogicNames returns a list of possible string values of FacetLogic.

func FileTypeNames

func FileTypeNames() []string

FileTypeNames returns a list of possible string values of FileType.

func FilesStatusNames added in v0.0.3

func FilesStatusNames() []string

FilesStatusNames returns a list of possible string values of FilesStatus.

func InferVideoCodecAndReleaseGroup

func InferVideoCodecAndReleaseGroup(input string) (NullVideoCodec, NullString)

func LanguageNames

func LanguageNames() []string

func LanguageValueStrings

func LanguageValueStrings() []string

func QueueJobStatusNames added in v0.7.0

func QueueJobStatusNames() []string

QueueJobStatusNames returns a list of possible string values of QueueJobStatus.

func ValidateTagName added in v0.3.0

func ValidateTagName(name string) error

func Video3DNames

func Video3DNames() []string

Video3DNames returns a list of possible string values of Video3D.

func VideoCodecNames

func VideoCodecNames() []string

VideoCodecNames returns a list of possible string values of VideoCodec.

func VideoModifierNames

func VideoModifierNames() []string

VideoModifierNames returns a list of possible string values of VideoModifier.

func VideoResolutionNames

func VideoResolutionNames() []string

VideoResolutionNames returns a list of possible string values of VideoResolution.

func VideoSourceNames

func VideoSourceNames() []string

VideoSourceNames returns a list of possible string values of VideoSource.

Types

type BloomFilter added in v0.3.0

type BloomFilter struct {
	Key       string                  `gorm:"column:key;primaryKey" json:"key"`
	Filter    bloom.StableBloomFilter `gorm:"column:bytes;not null" json:"bytes"`
	CreatedAt time.Time               `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt time.Time               `gorm:"column:updated_at;not null" json:"updatedAt"`
}

BloomFilter mapped from table <bloom_filters>

func (*BloomFilter) TableName added in v0.3.0

func (*BloomFilter) TableName() string

TableName BloomFilter's table name

type Content

type Content struct {
	Type             ContentType         `gorm:"column:type;primaryKey;<-:create" json:"type"`
	Source           string              `gorm:"column:source;primaryKey;<-:create" json:"source"`
	ID               string              `gorm:"column:id;primaryKey;<-:create" json:"id"`
	Title            string              `gorm:"column:title;not null" json:"title"`
	ReleaseDate      Date                `gorm:"column:release_date" json:"releaseDate"`
	ReleaseYear      Year                `gorm:"column:release_year" json:"releaseYear"`
	Adult            NullBool            `gorm:"column:adult" json:"adult"`
	OriginalLanguage NullLanguage        `gorm:"column:original_language" json:"originalLanguage"`
	OriginalTitle    NullString          `gorm:"column:original_title" json:"originalTitle"`
	Overview         NullString          `gorm:"column:overview" json:"overview"`
	Runtime          NullUint16          `gorm:"column:runtime" json:"runtime"`
	Popularity       NullFloat32         `gorm:"column:popularity" json:"popularity"`
	VoteAverage      NullFloat32         `gorm:"column:vote_average" json:"voteAverage"`
	VoteCount        NullUint            `gorm:"column:vote_count" json:"voteCount"`
	CreatedAt        time.Time           `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt        time.Time           `gorm:"column:updated_at;not null" json:"updatedAt"`
	Tsv              fts.Tsvector        `gorm:"column:tsv" json:"tsv"`
	Collections      []ContentCollection `gorm:"many2many:content_collections_content" json:"collections"`
	Attributes       []ContentAttribute  `json:"attributes"`
	MetadataSource   MetadataSource      `gorm:"foreignKey:Source" json:"metadata_source"`
}

Content mapped from table <content>

func (c Content) ExternalLinks() []ExternalLink

func (Content) Identifier

func (c Content) Identifier(source string) (string, bool)

func (Content) Ref

func (c Content) Ref() ContentRef

func (*Content) TableName

func (*Content) TableName() string

TableName Content's table name

func (*Content) UpdateTsv added in v0.5.0

func (c *Content) UpdateTsv()

type ContentAttribute

type ContentAttribute struct {
	ContentType    ContentType    `gorm:"column:content_type;primaryKey;<-:create" json:"contentType"`
	ContentSource  string         `gorm:"column:content_source;primaryKey;<-:create" json:"contentSource"`
	ContentID      string         `gorm:"column:content_id;primaryKey;<-:create" json:"contentId"`
	Source         string         `gorm:"column:source;primaryKey" json:"source"`
	Key            string         `gorm:"column:key;primaryKey;<-:create" json:"key"`
	Value          string         `gorm:"column:value;not null" json:"value"`
	CreatedAt      time.Time      `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt      time.Time      `gorm:"column:updated_at;not null" json:"updatedAt"`
	MetadataSource MetadataSource `gorm:"foreignKey:Source" json:"metadata_source"`
}

ContentAttribute mapped from table <content_attributes>

func (*ContentAttribute) TableName

func (*ContentAttribute) TableName() string

TableName ContentAttribute's table name

type ContentCollection

type ContentCollection struct {
	Type           string         `gorm:"column:type;primaryKey;<-:create" json:"type"`
	Source         string         `gorm:"column:source;primaryKey" json:"source"`
	ID             string         `gorm:"column:id;primaryKey;<-:create" json:"id"`
	Name           string         `gorm:"column:name;not null" json:"name"`
	CreatedAt      time.Time      `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt      time.Time      `gorm:"column:updated_at;not null" json:"updatedAt"`
	MetadataSource MetadataSource `gorm:"foreignKey:Source" json:"metadata_source"`
}

ContentCollection mapped from table <content_collections>

func (*ContentCollection) TableName

func (*ContentCollection) TableName() string

TableName ContentCollection's table name

type ContentCollectionContent

type ContentCollectionContent struct {
	ContentType             ContentType       `gorm:"column:content_type;primaryKey" json:"contentType"`
	ContentSource           string            `gorm:"column:content_source;primaryKey" json:"contentSource"`
	ContentID               string            `gorm:"column:content_id;primaryKey" json:"contentId"`
	ContentCollectionType   string            `gorm:"column:content_collection_type;primaryKey" json:"contentCollectionType"`
	ContentCollectionSource string            `gorm:"column:content_collection_source;primaryKey" json:"contentCollectionSource"`
	ContentCollectionID     string            `gorm:"column:content_collection_id;primaryKey" json:"contentCollectionId"`
	Content                 Content           `json:"content"`
	Collection              ContentCollection `` /* 127-byte string literal not displayed */
}

ContentCollectionContent mapped from table <content_collections_content>

func (*ContentCollectionContent) TableName

func (*ContentCollectionContent) TableName() string

TableName ContentCollectionContent's table name

type ContentCollectionRef

type ContentCollectionRef struct {
	Type   string
	Source string
	ID     string
}

type ContentRef

type ContentRef struct {
	Type   ContentType
	Source string
	ID     string
}

type ContentType

type ContentType string

ContentType represents the type of content ENUM(movie, tv_show, music, ebook, comic, audiobook, game, software, xxx)

const (
	ContentTypeMovie     ContentType = "movie"
	ContentTypeTvShow    ContentType = "tv_show"
	ContentTypeMusic     ContentType = "music"
	ContentTypeEbook     ContentType = "ebook"
	ContentTypeComic     ContentType = "comic"
	ContentTypeAudiobook ContentType = "audiobook"
	ContentTypeGame      ContentType = "game"
	ContentTypeSoftware  ContentType = "software"
	ContentTypeXxx       ContentType = "xxx"
)

func ContentTypeValues

func ContentTypeValues() []ContentType

ContentTypeValues returns a list of the values for ContentType

func ParseContentType

func ParseContentType(name string) (ContentType, error)

ParseContentType attempts to convert a string to a ContentType.

func (ContentType) IsNil added in v0.5.0

func (c ContentType) IsNil() bool

func (ContentType) IsValid

func (x ContentType) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (ContentType) IsVideo

func (c ContentType) IsVideo() bool

func (ContentType) Label

func (c ContentType) Label() string

func (ContentType) MarshalText

func (x ContentType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*ContentType) Scan

func (x *ContentType) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (ContentType) String

func (x ContentType) String() string

String implements the Stringer interface.

func (*ContentType) UnmarshalText

func (x *ContentType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (ContentType) Value

func (x ContentType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Date

type Date struct {
	Year  Year
	Month time.Month
	Day   uint8
}

func NewDateFromIsoString

func NewDateFromIsoString(str string) (Date, error)

func NewDateFromParts

func NewDateFromParts(year Year, month time.Month, day uint8) Date

func NewDateFromTime

func NewDateFromTime(t time.Time) Date

func (Date) End

func (d Date) End() Date

func (Date) EndOfDayTime

func (d Date) EndOfDayTime() time.Time

func (Date) EndTime

func (d Date) EndTime() time.Time

func (Date) IsNil

func (d Date) IsNil() bool

func (Date) IsValid added in v0.8.0

func (d Date) IsValid() bool

func (Date) IsoDateString

func (d Date) IsoDateString() string

func (Date) MarshalGQL

func (d Date) MarshalGQL(w io.Writer)

func (*Date) Scan

func (d *Date) Scan(value interface{}) error

func (Date) Start

func (d Date) Start() Date

func (Date) StartTime

func (d Date) StartTime() time.Time

func (Date) Time

func (d Date) Time() time.Time

func (*Date) UnmarshalGQL

func (d *Date) UnmarshalGQL(v interface{}) error

func (Date) Value

func (d Date) Value() (driver.Value, error)

func (Date) YearString

func (d Date) YearString() string

type DateRange

type DateRange interface {
	Start() Date
	End() Date
	StartTime() time.Time
	EndTime() time.Time
}

func NewDateRangeFromDates

func NewDateRangeFromDates(start, end Date) DateRange

func NewDateRangeFromMonthAndYear

func NewDateRangeFromMonthAndYear(month time.Month, year Year) DateRange

func NewDateRangeFromString

func NewDateRangeFromString(str string) (DateRange, error)

func NewDateRangeFromYear

func NewDateRangeFromYear(year Year) DateRange

func NewNilDateRange

func NewNilDateRange() DateRange

type Duration added in v0.7.0

type Duration time.Duration

func (*Duration) Scan added in v0.7.0

func (d *Duration) Scan(value interface{}) error

func (Duration) Value added in v0.7.0

func (d Duration) Value() (driver.Value, error)

type Episodes

type Episodes map[int]map[int]struct{}

func EpisodesMatchToEpisodes added in v0.6.2

func EpisodesMatchToEpisodes(match []string) Episodes

func ParseEpisodes added in v0.6.2

func ParseEpisodes(input string) Episodes

func (Episodes) AddEpisode

func (e Episodes) AddEpisode(season, episode int) Episodes

func (Episodes) AddSeason

func (e Episodes) AddSeason(season int) Episodes

func (Episodes) HasEpisode

func (e Episodes) HasEpisode(season, episode int) bool

func (Episodes) SeasonEntries

func (e Episodes) SeasonEntries() []Season

func (Episodes) String

func (e Episodes) String() string
type ExternalLink struct {
	MetadataSource
	ID  string
	Url string
}

type FacetLogic

type FacetLogic string

FacetLogic represents the logic used to filter and aggregate facets ENUM(and, or)

const (
	FacetLogicAnd FacetLogic = "and"
	FacetLogicOr  FacetLogic = "or"
)

func FacetLogicValues

func FacetLogicValues() []FacetLogic

FacetLogicValues returns a list of the values for FacetLogic

func ParseFacetLogic

func ParseFacetLogic(name string) (FacetLogic, error)

ParseFacetLogic attempts to convert a string to a FacetLogic.

func (FacetLogic) IsValid

func (x FacetLogic) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (FacetLogic) MarshalText

func (x FacetLogic) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*FacetLogic) Scan

func (x *FacetLogic) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (FacetLogic) String

func (x FacetLogic) String() string

String implements the Stringer interface.

func (*FacetLogic) UnmarshalText

func (x *FacetLogic) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (FacetLogic) Value

func (x FacetLogic) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type FileType

type FileType string

FileType represents the general type of a file

 ENUM(
  archive,
	audio,
  data,
  document,
  image,
  software,
  subtitles,
	video,

)

const (
	FileTypeArchive   FileType = "archive"
	FileTypeAudio     FileType = "audio"
	FileTypeData      FileType = "data"
	FileTypeDocument  FileType = "document"
	FileTypeImage     FileType = "image"
	FileTypeSoftware  FileType = "software"
	FileTypeSubtitles FileType = "subtitles"
	FileTypeVideo     FileType = "video"
)

func FileTypeValues

func FileTypeValues() []FileType

FileTypeValues returns a list of the values for FileType

func ParseFileType

func ParseFileType(name string) (FileType, error)

ParseFileType attempts to convert a string to a FileType.

func (FileType) Extensions

func (ft FileType) Extensions() []string

func (FileType) IsValid

func (x FileType) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (FileType) Label

func (ft FileType) Label() string

func (FileType) MarshalText

func (x FileType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*FileType) Scan

func (x *FileType) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (FileType) String

func (x FileType) String() string

String implements the Stringer interface.

func (*FileType) UnmarshalText

func (x *FileType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (FileType) Value

func (x FileType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type FilesStatus added in v0.0.3

type FilesStatus string

FilesStatus represents what we know about the files in a Torrent ENUM(no_info, single, multi, over_threshold)

const (
	FilesStatusNoInfo        FilesStatus = "no_info"
	FilesStatusSingle        FilesStatus = "single"
	FilesStatusMulti         FilesStatus = "multi"
	FilesStatusOverThreshold FilesStatus = "over_threshold"
)

func FilesStatusValues added in v0.0.3

func FilesStatusValues() []FilesStatus

FilesStatusValues returns a list of the values for FilesStatus

func ParseFilesStatus added in v0.0.3

func ParseFilesStatus(name string) (FilesStatus, error)

ParseFilesStatus attempts to convert a string to a FilesStatus.

func (FilesStatus) IsValid added in v0.0.3

func (x FilesStatus) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (FilesStatus) MarshalText added in v0.0.3

func (x FilesStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*FilesStatus) Scan added in v0.0.3

func (x *FilesStatus) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (FilesStatus) String added in v0.0.3

func (x FilesStatus) String() string

String implements the Stringer interface.

func (*FilesStatus) UnmarshalText added in v0.0.3

func (x *FilesStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (FilesStatus) Value added in v0.0.3

func (x FilesStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type KeyValue added in v0.5.0

type KeyValue struct {
	Key       string    `gorm:"column:key;primaryKey" json:"key"`
	Value     string    `gorm:"column:value;not null" json:"value"`
	CreatedAt time.Time `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updatedAt"`
}

KeyValue mapped from table <key_values>

func (*KeyValue) TableName added in v0.5.0

func (*KeyValue) TableName() string

TableName KeyValue's table name

type Language

type Language string

func LanguageValues

func LanguageValues() []Language

func (Language) Aliases

func (l Language) Aliases() []string

func (Language) Alpha2

func (l Language) Alpha2() string

func (Language) Alpha3

func (l Language) Alpha3() string

func (Language) Id

func (l Language) Id() string

func (Language) IsValid

func (l Language) IsValid() bool

func (Language) Name

func (l Language) Name() string

func (*Language) Scan

func (l *Language) Scan(value interface{}) error

func (Language) String

func (l Language) String() string

func (Language) Value

func (l Language) Value() (driver.Value, error)

type Languages

type Languages map[Language]struct{}

func InferLanguages

func InferLanguages(input string) Languages

func (Languages) MarshalJSON

func (l Languages) MarshalJSON() ([]byte, error)

func (*Languages) Scan

func (l *Languages) Scan(value interface{}) error

func (Languages) Slice

func (l Languages) Slice() []Language

func (*Languages) UnmarshalJSON

func (l *Languages) UnmarshalJSON(data []byte) error

func (Languages) Value

func (l Languages) Value() (driver.Value, error)

type Maybe

type Maybe[T interface{}] struct {
	Val   T
	Valid bool
}

func MaybeValid

func MaybeValid[T interface{}](v T) Maybe[T]

func (Maybe[T]) Addr

func (n Maybe[T]) Addr() *T

func (Maybe[T]) IsDefined

func (n Maybe[T]) IsDefined() bool

func (Maybe[T]) IsValid

func (n Maybe[T]) IsValid() bool

type MetadataSource

type MetadataSource struct {
	Key       string    `gorm:"column:key;primaryKey;<-:create" json:"key"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	CreatedAt time.Time `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updatedAt"`
}

MetadataSource mapped from table <metadata_sources>

func (*MetadataSource) TableName

func (*MetadataSource) TableName() string

TableName MetadataSource's table name

type NullBool

type NullBool struct {
	Bool  bool
	Valid bool // Valid is true if Bool is not NULL
}

NullBool - nullable bool

func NewNullBool

func NewNullBool(b bool) NullBool

func (NullBool) MarshalGQL

func (n NullBool) MarshalGQL(w io.Writer)

func (*NullBool) Scan

func (n *NullBool) Scan(value interface{}) error

func (*NullBool) UnmarshalGQL

func (n *NullBool) UnmarshalGQL(v interface{}) error

func (NullBool) Value

func (n NullBool) Value() (driver.Value, error)

type NullContentType

type NullContentType struct {
	ContentType ContentType
	Valid       bool
	Set         bool
}

func NewNullContentType

func NewNullContentType(val interface{}) (x NullContentType)

func (NullContentType) MarshalGQL

func (n NullContentType) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullContentType to GraphQL.

func (NullContentType) MarshalJSON

func (n NullContentType) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullContentType to JSON.

func (*NullContentType) Scan

func (x *NullContentType) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullContentType) UnmarshalGQL

func (n *NullContentType) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullContentType from GraphQL.

func (*NullContentType) UnmarshalJSON

func (n *NullContentType) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullContentType from JSON.

func (NullContentType) Value

func (x NullContentType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullFacetLogic

type NullFacetLogic struct {
	FacetLogic FacetLogic
	Valid      bool
	Set        bool
}

func NewNullFacetLogic

func NewNullFacetLogic(val interface{}) (x NullFacetLogic)

func (NullFacetLogic) MarshalGQL

func (n NullFacetLogic) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullFacetLogic to GraphQL.

func (NullFacetLogic) MarshalJSON

func (n NullFacetLogic) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullFacetLogic to JSON.

func (*NullFacetLogic) Scan

func (x *NullFacetLogic) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullFacetLogic) UnmarshalGQL

func (n *NullFacetLogic) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullFacetLogic from GraphQL.

func (*NullFacetLogic) UnmarshalJSON

func (n *NullFacetLogic) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullFacetLogic from JSON.

func (NullFacetLogic) Value

func (x NullFacetLogic) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullFileType

type NullFileType struct {
	FileType FileType
	Valid    bool
	Set      bool
}

func FileTypeFromExtension

func FileTypeFromExtension(ext string) NullFileType

func NewNullFileType

func NewNullFileType(val interface{}) (x NullFileType)

func (NullFileType) MarshalGQL

func (n NullFileType) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullFileType to GraphQL.

func (NullFileType) MarshalJSON

func (n NullFileType) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullFileType to JSON.

func (*NullFileType) Scan

func (x *NullFileType) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullFileType) UnmarshalGQL

func (n *NullFileType) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullFileType from GraphQL.

func (*NullFileType) UnmarshalJSON

func (n *NullFileType) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullFileType from JSON.

func (NullFileType) Value

func (x NullFileType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullFilesStatus added in v0.0.3

type NullFilesStatus struct {
	FilesStatus FilesStatus
	Valid       bool
	Set         bool
}

func NewNullFilesStatus added in v0.0.3

func NewNullFilesStatus(val interface{}) (x NullFilesStatus)

func (NullFilesStatus) MarshalGQL added in v0.0.3

func (n NullFilesStatus) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullFilesStatus to GraphQL.

func (NullFilesStatus) MarshalJSON added in v0.0.3

func (n NullFilesStatus) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullFilesStatus to JSON.

func (*NullFilesStatus) Scan added in v0.0.3

func (x *NullFilesStatus) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullFilesStatus) UnmarshalGQL added in v0.0.3

func (n *NullFilesStatus) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullFilesStatus from GraphQL.

func (*NullFilesStatus) UnmarshalJSON added in v0.0.3

func (n *NullFilesStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullFilesStatus from JSON.

func (NullFilesStatus) Value added in v0.0.3

func (x NullFilesStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullFloat32

type NullFloat32 struct {
	Float32 float32
	Valid   bool // Valid is true if Float32 is not NULL
}

NullFloat32 - nullable float32

func NewNullFloat32

func NewNullFloat32(f float32) NullFloat32

func (NullFloat32) MarshalGQL

func (n NullFloat32) MarshalGQL(w io.Writer)

func (*NullFloat32) Scan

func (n *NullFloat32) Scan(value interface{}) error

func (*NullFloat32) UnmarshalGQL

func (n *NullFloat32) UnmarshalGQL(v interface{}) error

func (NullFloat32) Value

func (n NullFloat32) Value() (driver.Value, error)

type NullFloat64 added in v0.6.0

type NullFloat64 struct {
	Float64 float64
	Valid   bool // Valid is true if Float64 is not NULL
}

NullFloat64 - nullable float64

func NewNullFloat64 added in v0.6.0

func NewNullFloat64(f float64) NullFloat64

func (NullFloat64) MarshalGQL added in v0.6.0

func (n NullFloat64) MarshalGQL(w io.Writer)

func (*NullFloat64) Scan added in v0.6.0

func (n *NullFloat64) Scan(value interface{}) error

func (*NullFloat64) UnmarshalGQL added in v0.6.0

func (n *NullFloat64) UnmarshalGQL(v interface{}) error

func (NullFloat64) Value added in v0.6.0

func (n NullFloat64) Value() (driver.Value, error)

type NullInt

type NullInt struct {
	Int   int
	Valid bool // Valid is true if Int is not NULL
}

NullInt - nullable int

func NewNullInt

func NewNullInt(n int) NullInt

func (*NullInt) Scan

func (n *NullInt) Scan(value interface{}) error

func (NullInt) Value

func (n NullInt) Value() (driver.Value, error)

type NullLanguage

type NullLanguage struct {
	Language Language
	Valid    bool
}

func NewNullLanguage

func NewNullLanguage(l Language) NullLanguage

func ParseLanguage

func ParseLanguage(name string) NullLanguage

func (*NullLanguage) Scan

func (l *NullLanguage) Scan(value interface{}) error

func (NullLanguage) Value

func (l NullLanguage) Value() (driver.Value, error)

type NullQueueJobStatus added in v0.7.0

type NullQueueJobStatus struct {
	QueueJobStatus QueueJobStatus
	Valid          bool
	Set            bool
}

func NewNullQueueJobStatus added in v0.7.0

func NewNullQueueJobStatus(val interface{}) (x NullQueueJobStatus)

func (NullQueueJobStatus) MarshalGQL added in v0.7.0

func (n NullQueueJobStatus) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullQueueJobStatus to GraphQL.

func (NullQueueJobStatus) MarshalJSON added in v0.7.0

func (n NullQueueJobStatus) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullQueueJobStatus to JSON.

func (*NullQueueJobStatus) Scan added in v0.7.0

func (x *NullQueueJobStatus) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullQueueJobStatus) UnmarshalGQL added in v0.7.0

func (n *NullQueueJobStatus) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullQueueJobStatus from GraphQL.

func (*NullQueueJobStatus) UnmarshalJSON added in v0.7.0

func (n *NullQueueJobStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullQueueJobStatus from JSON.

func (NullQueueJobStatus) Value added in v0.7.0

func (x NullQueueJobStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullString

type NullString struct {
	String string
	Valid  bool // Valid is true if String is not NULL
}

NullString - nullable string

func FileExtensionFromPath added in v0.8.0

func FileExtensionFromPath(path string) NullString

func NewNullString

func NewNullString(s string) NullString

func (NullString) MarshalGQL

func (n NullString) MarshalGQL(w io.Writer)

func (NullString) MarshalJSON added in v0.5.0

func (n NullString) MarshalJSON() ([]byte, error)

func (*NullString) Scan

func (n *NullString) Scan(value interface{}) error

func (*NullString) UnmarshalGQL

func (n *NullString) UnmarshalGQL(v interface{}) error

func (*NullString) UnmarshalJSON added in v0.5.0

func (n *NullString) UnmarshalJSON(b []byte) error

func (NullString) Value

func (n NullString) Value() (driver.Value, error)

type NullUint

type NullUint struct {
	Uint  uint
	Valid bool // Valid is true if Uint is not NULL
}

NullUint - nullable uint

func NewNullUint

func NewNullUint(n uint) NullUint

func (NullUint) MarshalGQL

func (n NullUint) MarshalGQL(w io.Writer)

func (*NullUint) Scan

func (n *NullUint) Scan(value interface{}) error

func (*NullUint) UnmarshalGQL

func (n *NullUint) UnmarshalGQL(v interface{}) error

func (NullUint) Value

func (n NullUint) Value() (driver.Value, error)

type NullUint16

type NullUint16 struct {
	Uint16 uint16
	Valid  bool // Valid is true if Uint16 is not NULL
}

NullUint16 - nullable uint16

func NewNullUint16

func NewNullUint16(n uint16) NullUint16

func (NullUint16) MarshalGQL

func (n NullUint16) MarshalGQL(w io.Writer)

func (*NullUint16) Scan

func (n *NullUint16) Scan(value interface{}) error

func (*NullUint16) UnmarshalGQL

func (n *NullUint16) UnmarshalGQL(v interface{}) error

func (NullUint16) Value

func (n NullUint16) Value() (driver.Value, error)

type NullUint64

type NullUint64 struct {
	Uint64 uint64
	Valid  bool // Valid is true if Uint64 is not NULL
}

NullUint64 - nullable uint64

func NewNullUint64

func NewNullUint64(n uint64) NullUint64

func (*NullUint64) Scan

func (n *NullUint64) Scan(value interface{}) error

func (NullUint64) Value

func (n NullUint64) Value() (driver.Value, error)

type NullVideo3D

type NullVideo3D struct {
	Video3D Video3D
	Valid   bool
	Set     bool
}

func InferVideo3D

func InferVideo3D(input string) NullVideo3D

func NewNullVideo3D

func NewNullVideo3D(val interface{}) (x NullVideo3D)

func (NullVideo3D) MarshalGQL

func (n NullVideo3D) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullVideo3D to GraphQL.

func (NullVideo3D) MarshalJSON

func (n NullVideo3D) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullVideo3D to JSON.

func (*NullVideo3D) Scan

func (x *NullVideo3D) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullVideo3D) UnmarshalGQL

func (n *NullVideo3D) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullVideo3D from GraphQL.

func (*NullVideo3D) UnmarshalJSON

func (n *NullVideo3D) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullVideo3D from JSON.

func (NullVideo3D) Value

func (x NullVideo3D) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullVideoCodec

type NullVideoCodec struct {
	VideoCodec VideoCodec
	Valid      bool
	Set        bool
}

func NewNullVideoCodec

func NewNullVideoCodec(val interface{}) (x NullVideoCodec)

func (NullVideoCodec) MarshalGQL

func (n NullVideoCodec) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullVideoCodec to GraphQL.

func (NullVideoCodec) MarshalJSON

func (n NullVideoCodec) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullVideoCodec to JSON.

func (*NullVideoCodec) Scan

func (x *NullVideoCodec) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullVideoCodec) UnmarshalGQL

func (n *NullVideoCodec) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullVideoCodec from GraphQL.

func (*NullVideoCodec) UnmarshalJSON

func (n *NullVideoCodec) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullVideoCodec from JSON.

func (NullVideoCodec) Value

func (x NullVideoCodec) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullVideoModifier

type NullVideoModifier struct {
	VideoModifier VideoModifier
	Valid         bool
	Set           bool
}

func InferVideoModifier

func InferVideoModifier(input string) NullVideoModifier

func NewNullVideoModifier

func NewNullVideoModifier(val interface{}) (x NullVideoModifier)

func (NullVideoModifier) MarshalGQL

func (n NullVideoModifier) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullVideoModifier to GraphQL.

func (NullVideoModifier) MarshalJSON

func (n NullVideoModifier) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullVideoModifier to JSON.

func (*NullVideoModifier) Scan

func (x *NullVideoModifier) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullVideoModifier) UnmarshalGQL

func (n *NullVideoModifier) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullVideoModifier from GraphQL.

func (*NullVideoModifier) UnmarshalJSON

func (n *NullVideoModifier) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullVideoModifier from JSON.

func (NullVideoModifier) Value

func (x NullVideoModifier) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullVideoResolution

type NullVideoResolution struct {
	VideoResolution VideoResolution
	Valid           bool
	Set             bool
}

func InferVideoResolution

func InferVideoResolution(input string) NullVideoResolution

func NewNullVideoResolution

func NewNullVideoResolution(val interface{}) (x NullVideoResolution)

func (NullVideoResolution) MarshalGQL

func (n NullVideoResolution) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullVideoResolution to GraphQL.

func (NullVideoResolution) MarshalJSON

func (n NullVideoResolution) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullVideoResolution to JSON.

func (*NullVideoResolution) Scan

func (x *NullVideoResolution) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullVideoResolution) UnmarshalGQL

func (n *NullVideoResolution) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullVideoResolution from GraphQL.

func (*NullVideoResolution) UnmarshalJSON

func (n *NullVideoResolution) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullVideoResolution from JSON.

func (NullVideoResolution) Value

func (x NullVideoResolution) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullVideoSource

type NullVideoSource struct {
	VideoSource VideoSource
	Valid       bool
	Set         bool
}

func InferVideoSource

func InferVideoSource(input string) NullVideoSource

func NewNullVideoSource

func NewNullVideoSource(val interface{}) (x NullVideoSource)

func (NullVideoSource) MarshalGQL

func (n NullVideoSource) MarshalGQL(w io.Writer)

MarshalGQL correctly serializes a NullVideoSource to GraphQL.

func (NullVideoSource) MarshalJSON

func (n NullVideoSource) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullVideoSource to JSON.

func (*NullVideoSource) Scan

func (x *NullVideoSource) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullVideoSource) UnmarshalGQL

func (n *NullVideoSource) UnmarshalGQL(v any) error

UnmarshalGQL correctly deserializes a NullVideoSource from GraphQL.

func (*NullVideoSource) UnmarshalJSON

func (n *NullVideoSource) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullVideoSource from JSON.

func (NullVideoSource) Value

func (x NullVideoSource) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type QueueJob added in v0.7.0

type QueueJob struct {
	ID               string         `gorm:"column:id;primaryKey;default:gen_random_uuid();<-:false" json:"id"`
	Fingerprint      string         `gorm:"column:fingerprint;not null;<-:create" json:"fingerprint"`
	Queue            string         `gorm:"column:queue;not null;<-:create" json:"queue"`
	Status           QueueJobStatus `gorm:"column:status;not null;default:pending" json:"status"`
	Payload          string         `gorm:"column:payload;not null;<-:create" json:"payload"`
	Retries          uint           `gorm:"column:retries;not null" json:"retries"`
	MaxRetries       uint           `gorm:"column:max_retries;not null;<-:create" json:"maxRetries"`
	RunAfter         time.Time      `gorm:"column:run_after;not null" json:"runAfter"`
	RanAt            sql.NullTime   `gorm:"column:ran_at" json:"ranAt"`
	Error            NullString     `gorm:"column:error" json:"error"`
	Deadline         sql.NullTime   `gorm:"column:deadline;<-:create" json:"deadline"`
	ArchivalDuration Duration       `gorm:"column:archival_duration;not null;<-:create" json:"archivalDuration"`
	CreatedAt        time.Time      `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	Priority         int            `gorm:"column:priority;not null" json:"priority"`
}

QueueJob mapped from table <queue_jobs>

func NewQueueJob added in v0.7.0

func NewQueueJob(queue string, payload any, opts ...QueueJobOption) (QueueJob, error)

func (*QueueJob) TableName added in v0.7.0

func (*QueueJob) TableName() string

TableName QueueJob's table name

type QueueJobOption added in v0.7.0

type QueueJobOption func(*QueueJob)

func QueueJobDelayBy added in v0.8.0

func QueueJobDelayBy(duration time.Duration) QueueJobOption

func QueueJobMaxRetries added in v0.7.0

func QueueJobMaxRetries(maxRetries uint) QueueJobOption

func QueueJobPriority added in v0.7.5

func QueueJobPriority(priority int) QueueJobOption

type QueueJobStatus added in v0.7.0

type QueueJobStatus string

QueueJobStatus represents the status of a job in the queue ENUM(pending, processed, retry, failed)

const (
	QueueJobStatusPending   QueueJobStatus = "pending"
	QueueJobStatusProcessed QueueJobStatus = "processed"
	QueueJobStatusRetry     QueueJobStatus = "retry"
	QueueJobStatusFailed    QueueJobStatus = "failed"
)

func ParseQueueJobStatus added in v0.7.0

func ParseQueueJobStatus(name string) (QueueJobStatus, error)

ParseQueueJobStatus attempts to convert a string to a QueueJobStatus.

func QueueJobStatusValues added in v0.7.0

func QueueJobStatusValues() []QueueJobStatus

QueueJobStatusValues returns a list of the values for QueueJobStatus

func (QueueJobStatus) IsValid added in v0.7.0

func (x QueueJobStatus) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (QueueJobStatus) MarshalText added in v0.7.0

func (x QueueJobStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*QueueJobStatus) Scan added in v0.7.0

func (x *QueueJobStatus) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (QueueJobStatus) String added in v0.7.0

func (x QueueJobStatus) String() string

String implements the Stringer interface.

func (*QueueJobStatus) UnmarshalText added in v0.7.0

func (x *QueueJobStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (QueueJobStatus) Value added in v0.7.0

func (x QueueJobStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Season

type Season struct {
	Season   int
	Episodes []int `json:"omitempty"`
}

func (Season) String

func (se Season) String() string

type Torrent

type Torrent struct {
	InfoHash    protocol.ID             `gorm:"column:info_hash;primaryKey;<-:create" json:"infoHash"`
	Name        string                  `gorm:"column:name;not null" json:"name"`
	Size        uint                    `gorm:"column:size;not null" json:"size"`
	Private     bool                    `gorm:"column:private;not null" json:"private"`
	CreatedAt   time.Time               `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt   time.Time               `gorm:"column:updated_at;not null" json:"updatedAt"`
	FilesStatus FilesStatus             `gorm:"column:files_status;not null" json:"filesStatus"`
	Extension   NullString              `gorm:"column:extension;<-:false" json:"extension"`
	FilesCount  NullUint                `gorm:"column:files_count" json:"filesCount"`
	Hint        TorrentHint             `gorm:"foreignKey:InfoHash" json:"hint"`
	Contents    []TorrentContent        `gorm:"foreignKey:InfoHash" json:"contents"`
	Sources     []TorrentsTorrentSource `gorm:"foreignKey:InfoHash" json:"sources"`
	Files       []TorrentFile           `gorm:"foreignKey:InfoHash" json:"files"`
	Pieces      TorrentPieces           `gorm:"foreignKey:InfoHash" json:"-"`
	Tags        []TorrentTag            `gorm:"foreignKey:InfoHash" json:"tags"`
}

Torrent mapped from table <torrents>

func (*Torrent) AfterFind added in v0.3.0

func (t *Torrent) AfterFind(tx *gorm.DB) error

func (Torrent) BaseName added in v0.8.0

func (t Torrent) BaseName() string

func (Torrent) FileExtensions

func (t Torrent) FileExtensions() []string

func (Torrent) FileType

func (t Torrent) FileType() NullFileType

func (Torrent) FileTypes

func (t Torrent) FileTypes() []FileType

func (Torrent) HasFileType

func (t Torrent) HasFileType(fts ...FileType) NullBool

func (Torrent) HasFilesInfo

func (t Torrent) HasFilesInfo() bool

HasFilesInfo returns true if we know about the files in this torrent.

func (Torrent) Leechers

func (t Torrent) Leechers() NullUint

Leechers returns the highest number of leechers from all sources

func (Torrent) MagnetUri added in v0.3.0

func (t Torrent) MagnetUri() string

func (Torrent) PublishedAt added in v0.8.0

func (t Torrent) PublishedAt() time.Time

func (Torrent) Seeders

func (t Torrent) Seeders() NullUint

Seeders returns the highest number of seeders from all sources todo: Add up bloom filters

func (Torrent) SingleFile

func (t Torrent) SingleFile() bool

func (*Torrent) TableName

func (*Torrent) TableName() string

TableName Torrent's table name

func (Torrent) TagNames added in v0.3.0

func (t Torrent) TagNames() []string

type TorrentContent

type TorrentContent struct {
	ID              string              `gorm:"column:id;primaryKey;<-:false" json:"id"`
	InfoHash        protocol.ID         `gorm:"column:info_hash;not null;<-:create" json:"infoHash"`
	ContentType     NullContentType     `gorm:"column:content_type" json:"contentType"`
	ContentSource   NullString          `gorm:"column:content_source" json:"contentSource"`
	ContentID       NullString          `gorm:"column:content_id" json:"contentId"`
	Languages       Languages           `gorm:"column:languages;serializer:json" json:"languages"`
	Episodes        Episodes            `gorm:"column:episodes;serializer:json" json:"episodes"`
	VideoResolution NullVideoResolution `gorm:"column:video_resolution" json:"videoResolution"`
	VideoSource     NullVideoSource     `gorm:"column:video_source" json:"videoSource"`
	VideoCodec      NullVideoCodec      `gorm:"column:video_codec" json:"videoCodec"`
	Video3D         NullVideo3D         `gorm:"column:video_3d" json:"video3D"`
	VideoModifier   NullVideoModifier   `gorm:"column:video_modifier" json:"videoModifier"`
	ReleaseGroup    NullString          `gorm:"column:release_group" json:"releaseGroup"`
	CreatedAt       time.Time           `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt       time.Time           `gorm:"column:updated_at;not null" json:"updatedAt"`
	Tsv             fts.Tsvector        `gorm:"column:tsv" json:"tsv"`
	Seeders         NullUint            `gorm:"column:seeders" json:"seeders"`
	Leechers        NullUint            `gorm:"column:leechers" json:"leechers"`
	PublishedAt     time.Time           `gorm:"column:published_at;not null;default:1999-01-01 00:00:00+00" json:"publishedAt"`
	Size            uint                `gorm:"column:size;not null" json:"size"`
	FilesCount      NullUint            `gorm:"column:files_count" json:"filesCount"`
	Torrent         Torrent             `gorm:"foreignKey:InfoHash;references:InfoHash" json:"torrent"`
	Content         Content             `gorm:"foreignKey:ContentType,ContentSource,ContentID;references:Type,Source,ID" json:"content"`
}

TorrentContent mapped from table <torrent_contents>

func (TorrentContent) ContentRef added in v0.5.0

func (tc TorrentContent) ContentRef() Maybe[ContentRef]

func (TorrentContent) InferID added in v0.7.5

func (tc TorrentContent) InferID() string

func (*TorrentContent) TableName

func (*TorrentContent) TableName() string

TableName TorrentContent's table name

func (TorrentContent) Title

func (tc TorrentContent) Title() string

func (*TorrentContent) UpdateTsv added in v0.5.0

func (tc *TorrentContent) UpdateTsv()

type TorrentFile

type TorrentFile struct {
	InfoHash  protocol.ID `gorm:"column:info_hash;primaryKey;<-:create" json:"infoHash"`
	Index     uint        `gorm:"column:index;not null;<-:create" json:"index"`
	Path      string      `gorm:"column:path;primaryKey;<-:create" json:"path"`
	Extension NullString  `gorm:"column:extension;<-:false" json:"extension"`
	Size      uint        `gorm:"column:size;not null" json:"size"`
	CreatedAt time.Time   `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt time.Time   `gorm:"column:updated_at;not null" json:"updatedAt"`
}

TorrentFile mapped from table <torrent_files>

func (TorrentFile) BaseName added in v0.8.0

func (f TorrentFile) BaseName() string

func (TorrentFile) BasePath added in v0.8.0

func (f TorrentFile) BasePath() string

func (*TorrentFile) BeforeCreate added in v0.1.0

func (f *TorrentFile) BeforeCreate(tx *gorm.DB) (err error)

func (TorrentFile) FileType

func (f TorrentFile) FileType() NullFileType

func (*TorrentFile) TableName

func (*TorrentFile) TableName() string

TableName TorrentFile's table name

type TorrentHint added in v0.5.0

type TorrentHint struct {
	InfoHash        protocol.ID         `gorm:"column:info_hash;primaryKey;<-:create" json:"infoHash"`
	ContentType     ContentType         `gorm:"column:content_type;not null" json:"contentType"`
	ContentSource   NullString          `gorm:"column:content_source" json:"contentSource"`
	ContentID       NullString          `gorm:"column:content_id" json:"contentId"`
	Title           NullString          `gorm:"column:title" json:"title"`
	ReleaseYear     Year                `gorm:"column:release_year" json:"releaseYear"`
	Languages       Languages           `gorm:"column:languages;serializer:json" json:"languages"`
	Episodes        Episodes            `gorm:"column:episodes;serializer:json" json:"episodes"`
	VideoResolution NullVideoResolution `gorm:"column:video_resolution" json:"videoResolution"`
	VideoSource     NullVideoSource     `gorm:"column:video_source" json:"videoSource"`
	VideoCodec      NullVideoCodec      `gorm:"column:video_codec" json:"videoCodec"`
	Video3D         NullVideo3D         `gorm:"column:video_3d" json:"video3D"`
	VideoModifier   NullVideoModifier   `gorm:"column:video_modifier" json:"videoModifier"`
	ReleaseGroup    NullString          `gorm:"column:release_group" json:"releaseGroup"`
	CreatedAt       time.Time           `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt       time.Time           `gorm:"column:updated_at;not null" json:"updatedAt"`
}

TorrentHint mapped from table <torrent_hints>

func (*TorrentHint) BeforeCreate added in v0.5.0

func (f *TorrentHint) BeforeCreate(tx *gorm.DB) (err error)

func (TorrentHint) ContentRef added in v0.5.0

func (h TorrentHint) ContentRef() Maybe[ContentRef]

func (TorrentHint) IsNil added in v0.5.0

func (h TorrentHint) IsNil() bool

func (TorrentHint) NullContentType added in v0.5.0

func (h TorrentHint) NullContentType() NullContentType

func (*TorrentHint) TableName added in v0.5.0

func (*TorrentHint) TableName() string

TableName TorrentHint's table name

type TorrentPieces added in v0.7.1

type TorrentPieces struct {
	InfoHash    protocol.ID `gorm:"column:info_hash;primaryKey;<-:create" json:"infoHash"`
	PieceLength int64       `gorm:"column:piece_length;not null" json:"pieceLength"`
	Pieces      []byte      `gorm:"column:pieces;not null" json:"-"`
	CreatedAt   time.Time   `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
}

TorrentPieces mapped from table <torrent_pieces>

func (*TorrentPieces) BeforeCreate added in v0.7.1

func (f *TorrentPieces) BeforeCreate(tx *gorm.DB) (err error)

func (*TorrentPieces) TableName added in v0.7.1

func (*TorrentPieces) TableName() string

TableName TorrentPieces's table name

type TorrentSource

type TorrentSource struct {
	Key       string    `gorm:"column:key;primaryKey;<-:create" json:"key"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	CreatedAt time.Time `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updatedAt"`
}

TorrentSource mapped from table <torrent_sources>

func (*TorrentSource) TableName

func (*TorrentSource) TableName() string

TableName TorrentSource's table name

type TorrentTag added in v0.3.0

type TorrentTag struct {
	InfoHash  protocol.ID `gorm:"column:info_hash;primaryKey;<-:create" json:"infoHash"`
	Name      string      `gorm:"column:name;primaryKey;<-:create" json:"name"`
	CreatedAt time.Time   `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt time.Time   `gorm:"column:updated_at;not null" json:"updatedAt"`
}

TorrentTag mapped from table <torrent_tags>

func (*TorrentTag) BeforeCreate added in v0.3.0

func (t *TorrentTag) BeforeCreate(*gorm.DB) error

func (*TorrentTag) TableName added in v0.3.0

func (*TorrentTag) TableName() string

TableName TorrentTag's table name

type TorrentsTorrentSource

type TorrentsTorrentSource struct {
	Source        string        `gorm:"column:source;primaryKey;<-:create" json:"source"`
	InfoHash      protocol.ID   `gorm:"column:info_hash;primaryKey;<-:create" json:"infoHash"`
	ImportID      NullString    `gorm:"column:import_id" json:"importId"`
	Seeders       NullUint      `gorm:"column:seeders" json:"seeders"`
	Leechers      NullUint      `gorm:"column:leechers" json:"leechers"`
	PublishedAt   sql.NullTime  `gorm:"column:published_at" json:"publishedAt"`
	CreatedAt     time.Time     `gorm:"column:created_at;not null;<-:create" json:"createdAt"`
	UpdatedAt     time.Time     `gorm:"column:updated_at;not null" json:"updatedAt"`
	TorrentSource TorrentSource `gorm:"foreignKey:Source" json:"torrent_source"`
}

TorrentsTorrentSource mapped from table <torrents_torrent_sources>

func (*TorrentsTorrentSource) TableName

func (*TorrentsTorrentSource) TableName() string

TableName TorrentsTorrentSource's table name

type Video3D

type Video3D string

Video3D represents the 3D type of a video ENUM(V3D, V3DSBS, V3DOU)

const (
	Video3DV3D    Video3D = "V3D"
	Video3DV3DSBS Video3D = "V3DSBS"
	Video3DV3DOU  Video3D = "V3DOU"
)

func ParseVideo3D

func ParseVideo3D(name string) (Video3D, error)

ParseVideo3D attempts to convert a string to a Video3D.

func Video3DValues

func Video3DValues() []Video3D

Video3DValues returns a list of the values for Video3D

func (Video3D) IsValid

func (x Video3D) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Video3D) Label

func (v Video3D) Label() string

func (Video3D) MarshalText

func (x Video3D) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*Video3D) Scan

func (x *Video3D) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (Video3D) String

func (x Video3D) String() string

String implements the Stringer interface.

func (*Video3D) UnmarshalText

func (x *Video3D) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (Video3D) Value

func (x Video3D) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type VideoCodec

type VideoCodec string

VideoCodec represents the codec of a video ENUM(H264, x264, x265, XviD, DivX, MPEG2, MPEG4)

const (
	VideoCodecH264  VideoCodec = "H264"
	VideoCodecX264  VideoCodec = "x264"
	VideoCodecX265  VideoCodec = "x265"
	VideoCodecXviD  VideoCodec = "XviD"
	VideoCodecDivX  VideoCodec = "DivX"
	VideoCodecMPEG2 VideoCodec = "MPEG2"
	VideoCodecMPEG4 VideoCodec = "MPEG4"
)

func ParseVideoCodec

func ParseVideoCodec(name string) (VideoCodec, error)

ParseVideoCodec attempts to convert a string to a VideoCodec.

func VideoCodecValues

func VideoCodecValues() []VideoCodec

VideoCodecValues returns a list of the values for VideoCodec

func (VideoCodec) IsValid

func (x VideoCodec) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (VideoCodec) Label

func (v VideoCodec) Label() string

func (VideoCodec) MarshalText

func (x VideoCodec) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*VideoCodec) Scan

func (x *VideoCodec) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (VideoCodec) String

func (x VideoCodec) String() string

String implements the Stringer interface.

func (*VideoCodec) UnmarshalText

func (x *VideoCodec) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (VideoCodec) Value

func (x VideoCodec) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type VideoModifier

type VideoModifier string

VideoModifier represents the modifier of a video ENUM(REGIONAL, SCREENER, RAWHD, BRDISK, REMUX)

const (
	VideoModifierREGIONAL VideoModifier = "REGIONAL"
	VideoModifierSCREENER VideoModifier = "SCREENER"
	VideoModifierRAWHD    VideoModifier = "RAWHD"
	VideoModifierBRDISK   VideoModifier = "BRDISK"
	VideoModifierREMUX    VideoModifier = "REMUX"
)

func ParseVideoModifier

func ParseVideoModifier(name string) (VideoModifier, error)

ParseVideoModifier attempts to convert a string to a VideoModifier.

func VideoModifierValues

func VideoModifierValues() []VideoModifier

VideoModifierValues returns a list of the values for VideoModifier

func (VideoModifier) IsValid

func (x VideoModifier) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (VideoModifier) Label

func (v VideoModifier) Label() string

func (VideoModifier) MarshalText

func (x VideoModifier) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*VideoModifier) Scan

func (x *VideoModifier) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (VideoModifier) String

func (x VideoModifier) String() string

String implements the Stringer interface.

func (*VideoModifier) UnmarshalText

func (x *VideoModifier) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (VideoModifier) Value

func (x VideoModifier) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type VideoResolution

type VideoResolution string

VideoResolution represents the resolution of a video ENUM(V360p, V480p, V540p, V576p, V720p, V1080p, V1440p, V2160p, V4320p)

const (
	VideoResolutionV360p  VideoResolution = "V360p"
	VideoResolutionV480p  VideoResolution = "V480p"
	VideoResolutionV540p  VideoResolution = "V540p"
	VideoResolutionV576p  VideoResolution = "V576p"
	VideoResolutionV720p  VideoResolution = "V720p"
	VideoResolutionV1080p VideoResolution = "V1080p"
	VideoResolutionV1440p VideoResolution = "V1440p"
	VideoResolutionV2160p VideoResolution = "V2160p"
	VideoResolutionV4320p VideoResolution = "V4320p"
)

func ParseVideoResolution

func ParseVideoResolution(name string) (VideoResolution, error)

ParseVideoResolution attempts to convert a string to a VideoResolution.

func VideoResolutionValues

func VideoResolutionValues() []VideoResolution

VideoResolutionValues returns a list of the values for VideoResolution

func (VideoResolution) IsValid

func (x VideoResolution) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (VideoResolution) Label

func (v VideoResolution) Label() string

func (VideoResolution) MarshalText

func (x VideoResolution) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*VideoResolution) Scan

func (x *VideoResolution) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (VideoResolution) String

func (x VideoResolution) String() string

String implements the Stringer interface.

func (*VideoResolution) UnmarshalText

func (x *VideoResolution) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (VideoResolution) Value

func (x VideoResolution) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type VideoSource

type VideoSource string

VideoSource represents the source of a video ENUM(CAM, TELESYNC, TELECINE, WORKPRINT, DVD, TV, WEBDL, WEBRip, BluRay)

const (
	VideoSourceCAM       VideoSource = "CAM"
	VideoSourceTELESYNC  VideoSource = "TELESYNC"
	VideoSourceTELECINE  VideoSource = "TELECINE"
	VideoSourceWORKPRINT VideoSource = "WORKPRINT"
	VideoSourceDVD       VideoSource = "DVD"
	VideoSourceTV        VideoSource = "TV"
	VideoSourceWEBDL     VideoSource = "WEBDL"
	VideoSourceWEBRip    VideoSource = "WEBRip"
	VideoSourceBluRay    VideoSource = "BluRay"
)

func ParseVideoSource

func ParseVideoSource(name string) (VideoSource, error)

ParseVideoSource attempts to convert a string to a VideoSource.

func VideoSourceValues

func VideoSourceValues() []VideoSource

VideoSourceValues returns a list of the values for VideoSource

func (VideoSource) IsValid

func (x VideoSource) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (VideoSource) Label

func (v VideoSource) Label() string

func (VideoSource) MarshalText

func (x VideoSource) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*VideoSource) Scan

func (x *VideoSource) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (VideoSource) String

func (x VideoSource) String() string

String implements the Stringer interface.

func (*VideoSource) UnmarshalText

func (x *VideoSource) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (VideoSource) Value

func (x VideoSource) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Year

type Year uint16

func ParseYear

func ParseYear(s string) (Year, error)

func (Year) GormDataType added in v0.5.0

func (Year) GormDataType() string

func (Year) GormValue added in v0.5.0

func (y Year) GormValue(context.Context, *gorm.DB) clause.Expr

func (Year) IsNil

func (y Year) IsNil() bool

func (Year) MarshalGQL

func (y Year) MarshalGQL(w io.Writer)

func (*Year) Scan

func (y *Year) Scan(src interface{}) error

func (Year) String

func (y Year) String() string

func (*Year) UnmarshalGQL

func (y *Year) UnmarshalGQL(v interface{}) error

func (Year) Value

func (y Year) Value() (interface{}, error)

Jump to

Keyboard shortcuts

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