model

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOwnerAlreadyExists = errors.New("owner already exists")
)

Functions

func GetTorznabID added in v1.1.0

func GetTorznabID(cat RarbgCategory) int

func IsSubtitleFileExtension

func IsSubtitleFileExtension(ext string) bool

IsSubtitleFileExtension checks if extension is corresponding to a known subtitle file extension See https://en.wikipedia.org/wiki/Category:Subtitle_file_formats

func IsVideoFileExtension

func IsVideoFileExtension(ext string) bool

IsVideoFileExtension checks if extension is corresponding to a known video file extension See https://en.wikipedia.org/wiki/Video_file_format

Types

type AudioInfo

type AudioInfo struct {
	CodecID      string
	Channels     string
	Language     string
	SamplingRate string
}

type Cast

type Cast struct {
	CharacterName string
	Actor         Person
}

type Character

type Character struct {
	CharacterName string `bson:"character_name"`
	ActorID       int64  `bson:"actor_id"`
}

type Decade

type Decade struct {
	DecadeYear int
	Years      []int
}

type Film

type Film struct {
	ID          primitive.ObjectID `bson:"_id"`
	VolumeFiles []VolumeFile       `bson:"volume_files"`
	Name        string             `bson:"name"`         // Name fetched from filename
	Resolution  string             `bson:"resolution"`   // Resolution fetched from filename
	ReleaseYear int                `bson:"release_year"` // Release year fetched from filename
	TMDBID      int                `bson:"tmdb_id"`
	IMDbID      string             `bson:"imdb_id"`

	// Fetched from online sources. Only these variables will be used by the template
	Title            string      `bson:"title"`
	OriginalTitle    string      `bson:"original_title"`
	Year             string      `bson:"year"`
	Runtime          string      `bson:"runtime"`
	Tagline          string      `bson:"tagline"`
	Overview         string      `bson:"overview"`
	PosterPath       string      `bson:"poster_path"`
	BackdropPath     string      `bson:"backdrop_path"`
	Classification   string      `bson:"classification"`
	IMDbRating       string      `bson:"imdb_rating"`
	LetterboxdRating string      `bson:"letterboxd_rating"`
	Genres           []string    `bson:"genres"`
	Directors        []int64     `bson:"directors"`
	Writers          []int64     `bson:"writers"`
	Characters       []Character `bson:"characters"`
	ProdCountries    []string    `bson:"prod_countries"`
}

func (Film) GetCastAndCrewIDs

func (f Film) GetCastAndCrewIDs() (ids []int64)

type MediaInfo

type MediaInfo struct {
	FullOutput template.HTML

	Format     string
	FileSize   string
	Duration   string
	Resolution string
	Video      []VideoInfo
	Audio      []AudioInfo
	Subs       []SubsInfo
}

type MediaInfoJSONOutput

type MediaInfoJSONOutput struct {
	CreatingLibrary struct {
		Name    string `json:"name"`
		Version string `json:"version"`
		URL     string `json:"url"`
	} `json:"creatingLibrary"`
	Media struct {
		Ref   string              `json:"@ref"`
		Track []map[string]string `json:"track"`
	} `json:"media"`
}

type Pagination added in v1.0.3

type Pagination struct {
	Number int64
	Active bool
	Dots   bool
}

Pagination represents a pagination display parameters

type Person

type Person struct {
	ID       primitive.ObjectID `bson:"_id"`
	TMDBID   int64              `bson:"tmdb_id"`
	Name     string             `bson:"name"`
	Photo    string             `bson:"photo"`
	Bio      template.HTML      `bson:"bio"`
	Birthday string             `bson:"birthday"`
	Deathday string             `bson:"deathday"`
	IMDbID   string             `bson:"imdb_id"`
}

type RarbgCategory added in v1.1.0

type RarbgCategory string
const (
	RarbgCatEbooks          RarbgCategory = "ebooks"
	RarbgCatGamesPCIso      RarbgCategory = "games_pc_iso"
	RarbgCatGamesPCRip      RarbgCategory = "games_pc_rip"
	RarbgCatGamesPS3        RarbgCategory = "games_ps3"
	RarbgCatGamesPS4        RarbgCategory = "games_ps4"
	RarbgCatGamesXbox360    RarbgCategory = "games_xbox360"
	RarbgCatMovies          RarbgCategory = "movies"
	RarbgCatMoviesBDFull    RarbgCategory = "movies_bd_full"
	RarbgCatMoviesBDRemux   RarbgCategory = "movies_bd_remux"
	RarbgCatMoviesX264      RarbgCategory = "movies_x264"
	RarbgCatMoviesX2643D    RarbgCategory = "movies_x264_3d"
	RarbgCatMoviesX2644K    RarbgCategory = "movies_x264_4k"
	RarbgCatMoviesX264720   RarbgCategory = "movies_x264_720"
	RarbgCatMoviesX265      RarbgCategory = "movies_x265"
	RarbgCatMoviesX2654K    RarbgCategory = "movies_x265_4k"
	RarbgCatMoviesX2654KHDR RarbgCategory = "movies_x265_4k_hdr"
	RarbgCatMoviesXvid      RarbgCategory = "movies_xvid"
	RarbgCatMoviesXvid720   RarbgCategory = "movies_xvid_720"
	RarbgCatMusicFlac       RarbgCategory = "music_flac"
	RarbgCatMusicMp3        RarbgCategory = "music_mp3"
	RarbgCatSoftwarePCIso   RarbgCategory = "software_pc_iso"
	RarbgCatTV              RarbgCategory = "tv"
	RarbgCatTVSD            RarbgCategory = "tv_sd"
	RarbgCatTVUHD           RarbgCategory = "tv_uhd"
	RarbgCatXXX             RarbgCategory = "xxx"
)

type RarbgTorrent added in v1.1.0

type RarbgTorrent struct {
	Hash     string    `bson:"hash"`
	Title    string    `bson:"title"`
	DT       time.Time `bson:"dt"`
	Category string    `bson:"cat"`
	Size     *int64    `bson:"size"`
	IMDbID   *string   `bson:"imdb"`
}

type SubsInfo

type SubsInfo struct {
	CodecID  string
	Language string
	Forced   string
}

type Subtitle

type Subtitle struct {
	Language string `bson:"language"`
	Path     string `bson:"path"`
}

func GetExternalSubtitles

func GetExternalSubtitles(filmFilePath string, subFiles []string) (subs []Subtitle)

Fetches external subtitle files next to the media file. Subtitles file names must start with the media file name without extension. Ex: media: BigBuckBunny.mkv sub: BigBuckBunny.srt Language can be inferred from the subtitle file name, following ISO 639-1 codes. Ex: sub: BigBuckBunny.en.srt

type User

type User struct {
	ID       primitive.ObjectID `bson:"_id"`
	Name     string             `bson:"name"`
	Password string             `bson:"password"`
	IsOwner  bool               `bson:"is_owner"`
	IsAdmin  bool               `bson:"is_admin"`
}

User is a user

type VideoInfo

type VideoInfo struct {
	CodecID    string
	Profile    string
	Resolution string
	FrameRate  string
	BitDepth   string
}

type Volume

type Volume struct {
	ID          primitive.ObjectID `bson:"_id"`
	Name        string             `bson:"name"`
	Path        string             `bson:"path"`
	IsRecursive bool               `bson:"is_recursive"`
	MediaType   string             `bson:"media_type"`
}

Volume holds the volume paths to fetch media from

func (Volume) ListVideoFiles

func (v Volume) ListVideoFiles() ([]string, []string, error)

ListVideoFiles lists all the files that are considered as video in the volume

type VolumeFile

type VolumeFile struct {
	Path         string             `bson:"path"`
	FromVolume   primitive.ObjectID `bson:"from_volume"`
	Info         MediaInfo          `bson:"info"`
	ExtSubtitles []Subtitle         `bson:"ext_subtitles"`
}

Jump to

Keyboard shortcuts

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