shows

package
v62.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *storm.DB, name, regexp string, seasonal, active bool, minimal int64) (string, error)

New creates a new show

func ToProtoShows

func ToProtoShows(shows []Show) *golpje.ProtoShows

ToProtoShows returns a proto shows from a single show

Types

type Show

type Show struct {
	ID       string
	Name     string
	Regexp   string
	Active   bool
	Seasonal bool
	Minimal  int64
}

Show a local alias of the protobuf Show

func All

func All(db *storm.DB) ([]Show, error)

All returns all shows

func FromProto

func FromProto(in *golpje.ProtoShow) Show

FromProto converts a proto message to a Show

func GetFromID

func GetFromID(db *storm.DB, uuid string) (Show, error)

GetFromID retrieve a show from an UUID

func GetFromName

func GetFromName(db *storm.DB, name string) (Show, error)

GetFromName retrieve a show from an UUID

func (Show) AddDownload

func (s Show) AddDownload(db *storm.DB, title, magnetlink string) (string, error)

AddDownload adds an episode to a show

func (Show) AddEpisode

func (s Show) AddEpisode(db *storm.DB, title string) (string, error)

AddEpisode adds an episode from the filesystem to a show

func (Show) Delete

func (s Show) Delete(db *storm.DB) error

Delete removes a show from the database

func (Show) DeleteAllEpisodes

func (s Show) DeleteAllEpisodes(db *storm.DB) error

DeleteAllEpisodes removes all episodes from the datastore

func (Show) GetSeasonDir

func (s Show) GetSeasonDir(title, showBasePath string) string

GetSeasonDir returns the seasonal directory where episodes with given title are stored

func (Show) Path

func (s Show) Path(showBasePath string) string

Path returns the directory in which all shows are located

func (Show) Print

func (s Show) Print(db *storm.DB)

Print provides a convenient way of pretty printing a show

func (Show) SetDownloadFailed

func (s Show) SetDownloadFailed(db *storm.DB, title string) error

SetDownloadFailed changes the state of an episode to downloaded

func (Show) SetDownloaded

func (s Show) SetDownloaded(db *storm.DB, title string) error

SetDownloaded changes the state of an episode to downloaded

func (Show) ShouldDownload

func (s Show) ShouldDownload(db *storm.DB, title string) (bool, error)

ShouldDownload returns if the episode has not been downloaded yet and still should

func (Show) ToProto

func (s Show) ToProto() *golpje.ProtoShow

ToProto converts a Show to a proto message

Jump to

Keyboard shortcuts

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