domain

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TVDBSchema = "https://github.com/varoOP/shinkro-mapping/raw/main/.github/schema-tvdb.json"

	TMDBSchema = "https://github.com/varoOP/shinkro-mapping/raw/main/.github/schema-tmdb.json"
)

Variables

This section is empty.

Functions

func ChecklocalMaps added in v0.1.1

func ChecklocalMaps(cfg *Config) (error, bool)

func NewAnimeMaps added in v0.1.1

func NewAnimeMaps(cfg *Config) (*AnimeTVDBMap, *AnimeMovies, error)

Types

type Anime

type Anime struct {
	Malid        int            `yaml:"malid" json:"malid"`
	Title        string         `yaml:"title" json:"title"`
	Type         string         `yaml:"type" json:"type"`
	Tvdbid       int            `yaml:"tvdbid" json:"tvdbid"`
	TvdbSeason   int            `yaml:"tvdbseason" json:"tvdbseason"`
	Start        int            `yaml:"start" json:"start"`
	UseMapping   bool           `yaml:"useMapping" json:"useMapping"`
	AnimeMapping []AnimeMapping `yaml:"animeMapping" json:"animeMapping"`
}

type AnimeMapping added in v0.1.1

type AnimeMapping struct {
	TvdbSeason int `yaml:"tvdbseason" json:"tvdbseason"`
	Start      int `yaml:"start" json:"start"`
}

type AnimeMovie added in v0.1.1

type AnimeMovie struct {
	MainTitle string `yaml:"mainTitle" json:"mainTitle"`
	TMDBID    int    `yaml:"tmdbid" json:"tmdbid"`
	MALID     int    `yaml:"malid" json:"malid"`
}

type AnimeMovies added in v0.1.1

type AnimeMovies struct {
	AnimeMovie []AnimeMovie `yaml:"animeMovies" json:"animeMovies"`
}

func (*AnimeMovies) CheckMap added in v0.1.1

func (am *AnimeMovies) CheckMap(tmdbid int) (bool, *AnimeMovie)

type AnimeTVDBMap added in v0.1.1

type AnimeTVDBMap struct {
	Anime []Anime `yaml:"AnimeMap" json:"AnimeMap"`
}

func (*AnimeTVDBMap) CheckMap added in v0.1.1

func (s *AnimeTVDBMap) CheckMap(tvdbid, tvdbseason, ep int) (bool, *Anime)

type AnimeUpdate

type AnimeUpdate struct {
	Client      *mal.Client
	DB          *database.DB
	Config      *Config
	Plex        *plex.PlexWebhook
	Anime       *Anime
	AnimeMovie  *AnimeMovie
	TVDBMapping *AnimeTVDBMap
	TMDBMapping *AnimeMovies
	InTVDBMap   bool
	InTMDBMap   bool
	Media       *database.Media
	Malid       int
	Start       int
	Ep          int
	MyList      *MyList
	Malresp     *mal.AnimeListStatus
	Log         zerolog.Logger
	Notify      *Notification
}

func NewAnimeUpdate

func NewAnimeUpdate(db *database.DB, cfg *Config, log *zerolog.Logger, n *Notification) AnimeUpdate

func (*AnimeUpdate) SendUpdate

func (a *AnimeUpdate) SendUpdate(ctx context.Context) error

type Config

type Config struct {
	ConfigPath        string
	Username          string   `koanf:"Username"`
	Password          string   `koanf:"Password"`
	Host              string   `koanf:"Host"`
	Port              int      `koanf:"Port"`
	PlexUser          string   `koanf:"PlexUsername"`
	PlexUrl           string   `koanf:"Url"`
	PlexToken         string   `koanf:"Token"`
	AnimeLibraries    []string `koanf:"AnimeLibraries"`
	ApiKey            string   `koanf:"ApiKey"`
	BaseUrl           string   `koanf:"BaseUrl"`
	CustomMapTVDB     bool
	CustomMapTVDBPath string
	CustomMapTMDB     bool
	CustomMapTMDBPath string
	TVDBMalMap        *AnimeTVDBMap
	TMDBMalMap        *AnimeMovies
	DiscordWebHookURL string `koanf:"DiscordWebhookUrl"`
	LogLevel          string `koanf:"LogLevel"`
	LogMaxSize        int    `koanf:"LogMaxSize"`
	LogMaxBackups     int    `koanf:"LogMaxBackups"`
}

func (*Config) LocalMapsExist added in v0.1.1

func (cfg *Config) LocalMapsExist()

type Key

type Key string
const (
	PlexPayload Key = "plexPayload"
	Agent       Key = "agent"
)

type MyList

type MyList struct {
	Status     mal.AnimeStatus
	RewatchNum int
	EpNum      int
	WatchedNum int
	Title      string
	Picture    string
}

type Notification

type Notification struct {
	Error   chan error
	Anime   chan AnimeUpdate
	PayLoad *NotificationPayload
	Url     string
}

type NotificationPayload

type NotificationPayload struct {
	Event          string
	Title          string
	Url            string
	Status         string
	Score          int
	StartDate      string
	FinishDate     string
	TotalEps       int
	WatchedEps     int
	TimesRewatched int
	ImageUrl       string
	Message        string
}

Jump to

Keyboard shortcuts

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