app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

This file is autogenerated by Golem Do NOT make modifications, they will be lost

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background(m Medium) string

func Cover

func Cover(m Medium) string

func DownloadsCreate

func DownloadsCreate(c *gin.Context)

func DownloadsDelete

func DownloadsDelete(c *gin.Context, id string)

func DownloadsIndex

func DownloadsIndex(c *gin.Context)

func DownloadsMedium added in v0.2.0

func DownloadsMedium(c *gin.Context, id string)

func DownloadsRecent added in v0.2.0

func DownloadsRecent(c *gin.Context)

func DownloadsSelect added in v0.2.0

func DownloadsSelect(c *gin.Context, id string)

func DownloadsSetting added in v0.2.0

func DownloadsSetting(c *gin.Context, id string)

func DownloadsShow

func DownloadsShow(c *gin.Context, id string)

func DownloadsUpdate

func DownloadsUpdate(c *gin.Context, id string)

func EpisodesSetting added in v0.2.0

func EpisodesSetting(c *gin.Context, id string)

func EpisodesUpdate

func EpisodesUpdate(c *gin.Context, id string)

func FeedsCreate added in v0.2.0

func FeedsCreate(c *gin.Context)

func FeedsDelete added in v0.2.0

func FeedsDelete(c *gin.Context, id string)

func FeedsIndex added in v0.2.0

func FeedsIndex(c *gin.Context)

func FeedsShow added in v0.2.0

func FeedsShow(c *gin.Context, id string)

func FeedsUpdate added in v0.2.0

func FeedsUpdate(c *gin.Context, id string)

func Index

func Index(c *gin.Context)

func MoviesCreate

func MoviesCreate(c *gin.Context)

func MoviesDelete

func MoviesDelete(c *gin.Context, id string)

func MoviesIndex

func MoviesIndex(c *gin.Context)

func MoviesPaths added in v0.2.0

func MoviesPaths(c *gin.Context, id string)

func MoviesSetting added in v0.2.0

func MoviesSetting(c *gin.Context, id string)

func MoviesShow

func MoviesShow(c *gin.Context, id string)

func MoviesUpdate

func MoviesUpdate(c *gin.Context, id string)

func ReleasesCreate

func ReleasesCreate(c *gin.Context)

func ReleasesDelete

func ReleasesDelete(c *gin.Context, id string)

func ReleasesIndex

func ReleasesIndex(c *gin.Context)

func ReleasesSetting added in v0.2.0

func ReleasesSetting(c *gin.Context, id string)

func ReleasesShow

func ReleasesShow(c *gin.Context, id string)

func ReleasesUpdate

func ReleasesUpdate(c *gin.Context, id string)

func SeriesCreate

func SeriesCreate(c *gin.Context)

func SeriesCurrentSeason added in v0.2.0

func SeriesCurrentSeason(c *gin.Context, id string)

func SeriesDelete

func SeriesDelete(c *gin.Context, id string)

func SeriesIndex

func SeriesIndex(c *gin.Context)

func SeriesPaths added in v0.2.0

func SeriesPaths(c *gin.Context, id string)

func SeriesSeasonEpisodes

func SeriesSeasonEpisodes(c *gin.Context, id string, season string)

func SeriesSeasonEpisodesAll added in v0.2.0

func SeriesSeasonEpisodesAll(c *gin.Context, id string)

func SeriesSeasons

func SeriesSeasons(c *gin.Context, id string)

func SeriesSetting added in v0.2.0

func SeriesSetting(c *gin.Context, id string)

func SeriesShow

func SeriesShow(c *gin.Context, id string)

func SeriesUpdate

func SeriesUpdate(c *gin.Context, id string)

func SeriesWatches added in v0.2.0

func SeriesWatches(c *gin.Context, id string)

func UpcomingIndex

func UpcomingIndex(c *gin.Context)

Types

type Application

type Application struct {
	Config *Config
	Router *gin.Engine
	DB     *Connector
	Cache  *Cache
	Log    *logrus.Entry
}

func App

func App() *Application

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(options redis.Options) (*Cache, error)

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Delete

func (c *Cache) Delete(k string) error

func (*Cache) Fetch

func (c *Cache) Fetch(k string, v interface{}, f func() (interface{}, error)) (bool, error)

func (*Cache) Get

func (c *Cache) Get(k string, v interface{}) (bool, error)

func (*Cache) Set

func (c *Cache) Set(k string, v interface{}) error

type Config

type Config struct {
	Mode        string                 `yaml:"mode"`
	Port        int                    `yaml:"port"`
	Connections map[string]*Connection `yaml:"connections"`
	Cron        bool                   `yaml:"cron"`
	Redis       struct {
		Address string `yaml:"address"`
	} `yaml:"redis"`
	Filesystems struct {
		Enabled     bool     `yaml:"enabled"`
		Directories []string `yaml:"directories"`
	} `yaml:"filesystems"`
}

func ConfigInstance

func ConfigInstance() *Config

func (*Config) Validate

func (c *Config) Validate() error

type Connection

type Connection struct {
	URI        string `yaml:"uri,omitempty"`
	Database   string `yaml:"database,omitempty"`
	Collection string `yaml:"collection,omitempty"`
}

type Connector

type Connector struct {
	Download *grimoire.Store[*Download]
	Episode  *grimoire.Store[*Episode]
	Feed     *grimoire.Store[*Feed]
	Medium   *grimoire.Store[*Medium]
	Movie    *grimoire.Store[*Movie]
	Release  *grimoire.Store[*Release]
	Series   *grimoire.Store[*Series]
	Watch    *grimoire.Store[*Watch]
}

func NewConnector

func NewConnector() (*Connector, error)

func (*Connector) ActiveDownloads

func (c *Connector) ActiveDownloads() ([]*Download, error)

func (*Connector) DownloadSelect added in v0.2.0

func (c *Connector) DownloadSelect(id, mediumId string, num int) error

func (*Connector) DownloadSetting added in v0.2.0

func (c *Connector) DownloadSetting(id, setting string, value bool) error

func (*Connector) EpisodePaths added in v0.2.0

func (c *Connector) EpisodePaths(id string) ([]Path, error)

func (*Connector) EpisodeSetting

func (c *Connector) EpisodeSetting(id, setting string, value bool) error

func (*Connector) MediumWatched added in v0.2.0

func (c *Connector) MediumWatched(id primitive.ObjectID) bool

func (*Connector) MoviePaths added in v0.2.0

func (c *Connector) MoviePaths(id string) ([]Path, error)

func (*Connector) MovieSetting added in v0.2.0

func (c *Connector) MovieSetting(id, setting string, value bool) error

func (*Connector) RecentDownloads added in v0.2.0

func (c *Connector) RecentDownloads(page int) ([]*Download, error)

func (*Connector) ReleaseSetting added in v0.2.0

func (c *Connector) ReleaseSetting(id, setting string, value bool) error

func (*Connector) SeriesActive

func (c *Connector) SeriesActive() ([]*Series, error)

func (*Connector) SeriesAll

func (c *Connector) SeriesAll() ([]*Series, error)

func (*Connector) SeriesAllUnwatched

func (c *Connector) SeriesAllUnwatched(s *Series) (int, error)

func (*Connector) SeriesAllUnwatchedCached added in v0.2.0

func (c *Connector) SeriesAllUnwatchedCached(s *Series) (int, error)

func (*Connector) SeriesCurrentSeason added in v0.2.0

func (c *Connector) SeriesCurrentSeason(id string) (int, error)

func (*Connector) SeriesPaths added in v0.2.0

func (c *Connector) SeriesPaths(id string) ([]Path, error)

func (*Connector) SeriesSeasonEpisodes

func (c *Connector) SeriesSeasonEpisodes(id string, season string) ([]*Episode, error)

func (*Connector) SeriesSeasonEpisodesAll added in v0.2.0

func (c *Connector) SeriesSeasonEpisodesAll(id string) ([]*Episode, error)

func (*Connector) SeriesSeasons

func (c *Connector) SeriesSeasons(id string) ([]int, error)

func (*Connector) SeriesSetting

func (c *Connector) SeriesSetting(id, setting string, value bool) error

func (*Connector) SeriesWatches added in v0.2.0

func (c *Connector) SeriesWatches(id string) ([]*Watch, error)

func (*Connector) Upcoming

func (c *Connector) Upcoming() ([]*Episode, error)

type Download

type Download struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	MediumId  primitive.ObjectID `json:"medium_id" bson:"medium_id"`
	Medium    *Medium            `json:"medium" bson:"-"`
	Auto      bool               `json:"auto" bson:"auto"`
	Multi     bool               `json:"multi" bson:"multi"`
	Force     bool               `json:"force" bson:"force"`
	Url       string             `json:"url" bson:"url"`
	ReleaseId string             `json:"release_id" bson:"tdo_id"`
	Thash     string             `json:"thash" bson:"thash"`
	Selected  string             `json:"selected" bson:"selected"`
	Status    string             `json:"status" bson:"status"`
	Files     []*DownloadFile    `json:"download_files" bson:"download_files"`
}

func NewDownload

func NewDownload() *Download

type DownloadFile added in v0.2.0

type DownloadFile struct {
	Id       primitive.ObjectID `json:"id" bson:"_id"`
	MediumId primitive.ObjectID `json:"medium_id" bson:"medium_id"`
	Medium   *Medium            `json:"medium" bson:"medium"`
	Num      int                `json:"num" bson:"num"`
}

func NewDownloadFile added in v0.2.0

func NewDownloadFile() *DownloadFile

type DownloadSelector added in v0.2.0

type DownloadSelector struct {
	MediumId string
	Num      int
}

type Episode

type Episode struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type           string             `json:"type" bson:"_type"`
	SeriesId       primitive.ObjectID `json:"series_id" bson:"series_id"`
	Kind           primitive.Symbol   `json:"kind" bson:"kind"`
	Source         string             `json:"source" bson:"source"`
	SourceId       string             `json:"source_id" bson:"source_id"`
	Title          string             `json:"title" bson:"title"`
	Description    string             `json:"description" bson:"description"`
	Slug           string             `json:"slug" bson:"slug"`
	Text           []string           `json:"text" bson:"text"`
	Display        string             `json:"display" bson:"display"`
	Directory      string             `json:"directory" bson:"directory"`
	Search         string             `json:"search" bson:"search"`
	SeasonNumber   int                `json:"season_number" bson:"season_number"`
	EpisodeNumber  int                `json:"episode_number" bson:"episode_number"`
	AbsoluteNumber int                `json:"absolute_number" bson:"absolute_number"`
	SearchParams   *SearchParams      `json:"search_params" bson:"search_params"`
	Active         bool               `json:"active" bson:"active"`
	Downloaded     bool               `json:"downloaded" bson:"downloaded"`
	Completed      bool               `json:"completed" bson:"completed"`
	Skipped        bool               `json:"skipped" bson:"skipped"`
	Watched        bool               `json:"watched" bson:"watched"`
	Broken         bool               `json:"broken" bson:"broken"`
	Unwatched      int                `json:"unwatched" bson:"-"`
	ReleaseDate    time.Time          `json:"release_date" bson:"release_date"`
	Paths          []Path             `json:"paths" bson:"paths"`
	Cover          string             `json:"cover" bson:"-"`
	Background     string             `json:"background" bson:"-"`
}

func NewEpisode

func NewEpisode() *Episode

type Feed added in v0.2.0

type Feed struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Name      string    `json:"name" bson:"name"`
	Url       string    `json:"url" bson:"url"`
	Source    string    `json:"source" bson:"source"`
	Type      string    `json:"type" bson:"type"`
	Active    bool      `json:"active" bson:"active"`
	Processed time.Time `json:"processed" bson:"processed"`
}

func NewFeed added in v0.2.0

func NewFeed() *Feed

type Medium

type Medium struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type           string             `json:"type" bson:"_type"`
	Kind           primitive.Symbol   `json:"kind" bson:"kind"`
	Source         string             `json:"source" bson:"source"`
	SourceId       string             `json:"source_id" bson:"source_id"`
	Title          string             `json:"title" bson:"title"`
	Description    string             `json:"description" bson:"description"`
	Slug           string             `json:"slug" bson:"slug"`
	Text           []string           `json:"text" bson:"text"`
	Display        string             `json:"display" bson:"display"`
	Directory      string             `json:"directory" bson:"directory"`
	Search         string             `json:"search" bson:"search"`
	SearchParams   *SearchParams      `json:"search_params" bson:"search_params"`
	Active         bool               `json:"active" bson:"active"`
	Downloaded     bool               `json:"downloaded" bson:"downloaded"`
	Completed      bool               `json:"completed" bson:"completed"`
	Skipped        bool               `json:"skipped" bson:"skipped"`
	Watched        bool               `json:"watched" bson:"watched"`
	Broken         bool               `json:"broken" bson:"broken"`
	Favorite       bool               `json:"favorite" bson:"favorite"`
	Unwatched      int                `json:"unwatched" bson:"unwatched"`
	ReleaseDate    time.Time          `json:"release_date" bson:"release_date"`
	Paths          []Path             `json:"paths" bson:"paths"`
	Cover          string             `json:"cover" bson:"-"`
	Background     string             `json:"background" bson:"-"`
	SeriesId       primitive.ObjectID `json:"series_id" bson:"series_id"`
	SeasonNumber   int                `json:"season_number" bson:"season_number"`
	EpisodeNumber  int                `json:"episode_number" bson:"episode_number"`
	AbsoluteNumber int                `json:"absolute_number" bson:"absolute_number"`
}

func NewMedium

func NewMedium() *Medium

type Movie added in v0.2.0

type Movie struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type         string           `json:"type" bson:"_type"`
	Kind         primitive.Symbol `json:"kind" bson:"kind"`
	Source       string           `json:"source" bson:"source"`
	SourceId     string           `json:"source_id" bson:"source_id"`
	Title        string           `json:"title" bson:"title"`
	Description  string           `json:"description" bson:"description"`
	Slug         string           `json:"slug" bson:"slug"`
	Text         []string         `json:"text" bson:"text"`
	Display      string           `json:"display" bson:"display"`
	Directory    string           `json:"directory" bson:"directory"`
	Search       string           `json:"search" bson:"search"`
	SearchParams *SearchParams    `json:"search_params" bson:"search_params"`
	Active       bool             `json:"active" bson:"active"`
	Downloaded   bool             `json:"downloaded" bson:"downloaded"`
	Completed    bool             `json:"completed" bson:"completed"`
	Skipped      bool             `json:"skipped" bson:"skipped"`
	Watched      bool             `json:"watched" bson:"watched"`
	Broken       bool             `json:"broken" bson:"broken"`
	Favorite     bool             `json:"favorite" bson:"favorite"`
	ReleaseDate  time.Time        `json:"release_date" bson:"release_date"`
	Paths        []Path           `json:"paths" bson:"paths"`
	Cover        string           `json:"cover" bson:"-"`
	Background   string           `json:"background" bson:"-"`
}

func NewMovie added in v0.2.0

func NewMovie() *Movie

type Path added in v0.2.0

type Path struct {
	Id        primitive.ObjectID `json:"id" bson:"_id"`
	Type      primitive.Symbol   `json:"type" bson:"type"`
	Remote    string             `json:"remote" bson:"remote"`
	Local     string             `json:"local" bson:"local"`
	Extension string             `json:"extension" bson:"extension"`
	Size      int                `json:"size" bson:"size"`
	UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
}

type Release

type Release struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type        string    `json:"type" bson:"type"`
	Source      string    `json:"source" bson:"source"`
	Raw         string    `json:"raw" bson:"raw"`
	Title       string    `json:"title" bson:"title"`
	Description string    `json:"description" bson:"description"`
	Size        string    `json:"size" bson:"size"`
	View        string    `json:"view" bson:"view"`
	Download    string    `json:"download" bson:"download"`
	Infohash    string    `json:"infohash" bson:"infohash"`
	Name        string    `json:"name" bson:"name"`
	Season      int       `json:"season" bson:"season"`
	Episode     int       `json:"episode" bson:"episode"`
	Volume      int       `json:"volume" bson:"volume"`
	Checksum    string    `json:"checksum" bson:"checksum"`
	Group       string    `json:"group" bson:"group"`
	Author      string    `json:"author" bson:"author"`
	Verified    bool      `json:"verified" bson:"verified"`
	Widescreen  bool      `json:"widescreen" bson:"widescreen"`
	Uncensored  bool      `json:"uncensored" bson:"uncensored"`
	Bluray      bool      `json:"bluray" bson:"bluray"`
	Resolution  string    `json:"resolution" bson:"resolution"`
	Encoding    string    `json:"encoding" bson:"encoding"`
	Quality     string    `json:"quality" bson:"quality"`
	PublishedAt time.Time `json:"published_at" bson:"published_at"`
}

func NewRelease

func NewRelease() *Release

type SearchParams added in v0.2.0

type SearchParams struct {
	Type       string `json:"type" bson:"type"`
	Verified   bool   `json:"verified" bson:"verified"`
	Group      string `json:"group" bson:"group"`
	Author     string `json:"author" bson:"author"`
	Resolution int    `json:"resolution" bson:"resolution"`
	Source     string `json:"source" bson:"source"`
	Uncensored bool   `json:"uncensored" bson:"uncensored"`
	Bluray     bool   `json:"bluray" bson:"bluray"`
}

func NewSearchParams added in v0.2.0

func NewSearchParams() *SearchParams

type Series

type Series struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type          string           `json:"type" bson:"_type"`
	Kind          primitive.Symbol `json:"kind" bson:"kind"`
	Source        string           `json:"source" bson:"source"`
	SourceId      string           `json:"source_id" bson:"source_id"`
	Title         string           `json:"title" bson:"title"`
	Description   string           `json:"description" bson:"description"`
	Slug          string           `json:"slug" bson:"slug"`
	Text          []string         `json:"text" bson:"text"`
	Display       string           `json:"display" bson:"display"`
	Directory     string           `json:"directory" bson:"directory"`
	Search        string           `json:"search" bson:"search"`
	SearchParams  *SearchParams    `json:"search_params" bson:"search_params"`
	Active        bool             `json:"active" bson:"active"`
	Downloaded    bool             `json:"downloaded" bson:"downloaded"`
	Completed     bool             `json:"completed" bson:"completed"`
	Skipped       bool             `json:"skipped" bson:"skipped"`
	Watched       bool             `json:"watched" bson:"watched"`
	Broken        bool             `json:"broken" bson:"broken"`
	Favorite      bool             `json:"favorite" bson:"favorite"`
	Unwatched     int              `json:"unwatched" bson:"-"`
	ReleaseDate   time.Time        `json:"release_date" bson:"release_date"`
	Paths         []Path           `json:"paths" bson:"paths"`
	Cover         string           `json:"cover" bson:"-"`
	Background    string           `json:"background" bson:"-"`
	CurrentSeason int              `json:"currentSeason" bson:"-"`
	Seasons       []int            `json:"seasons" bson:"-"`
	Episodes      []*Episode       `json:"episodes" bson:"-"`
	Watches       []*Watch         `json:"watches" bson:"-"`
}

func NewSeries

func NewSeries() *Series

type Server

type Server struct {
	Router *gin.Engine
	Log    *logrus.Entry
	// contains filtered or unexported fields
}

func New

func New() (*Server, error)

func (*Server) Cron

func (s *Server) Cron() error

func (*Server) DownloadsProcess

func (s *Server) DownloadsProcess()

func (*Server) Routes

func (s *Server) Routes()

func (*Server) Start

func (s *Server) Start() error

func (*Server) Watcher

func (s *Server) Watcher()

type Setting

type Setting struct {
	Setting string
	Value   bool
}

type Watch

type Watch struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Username  string             `json:"username" bson:"username"`
	Player    string             `json:"player" bson:"player"`
	WatchedAt time.Time          `json:"watched_at" bson:"watched_at"`
	MediumId  primitive.ObjectID `json:"medium_id" bson:"medium_id"`
	Medium    *Medium            `json:"medium" bson:"-"`
}

func NewWatch

func NewWatch() *Watch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳