domain

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AidTitleMap = map[int]string{}

Functions

func CheckDupes

func CheckDupes(a []Anime) int

func CleanCache added in v0.1.3

func CleanCache(rootDir string)

func CreateMapping

func CreateMapping(am *AnimeMovies, path string)

func GetMalIds

func GetMalIds(cfg *Config)

func GetTmdbIds

func GetTmdbIds(cfg *Config, rootPath string)

func GetTvdbIDs

func GetTvdbIDs()

func ScrapeMal

func ScrapeMal()

func SetAnimePaths added in v0.1.4

func SetAnimePaths(rootDir string)

func StoreAnime

func StoreAnime(a []Anime, path AnimePath)

func UpdateMaster

func UpdateMaster(am1 *AnimeMovies, am2 *AnimeMovies, path string)

Types

type Anime

type Anime struct {
	MainTitle    string `json:"title"`
	EnglishTitle string `json:"enTitle,omitempty"`
	MalID        int    `json:"malid"`
	AnidbID      int    `json:"anidbid,omitempty"`
	TvdbID       int    `json:"tvdbid,omitempty"`
	TmdbID       int    `json:"tmdbid,omitempty"`
	Type         string `json:"type"`
	ReleaseDate  string `json:"releaseDate"`
}

Anime stores information about an anime

func GetAnime

func GetAnime(path AnimePath) []Anime

func RemoveIndex

func RemoveIndex(a []Anime, index int) []Anime

type AnimeFile added in v0.1.4

type AnimeFile string

type AnimeMovie

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

type AnimeMovies

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

func (*AnimeMovies) Add

func (am *AnimeMovies) Add(title string, tmdbid, malid int)

func (*AnimeMovies) Get

func (am *AnimeMovies) Get(path string) error

func (*AnimeMovies) Store

func (am *AnimeMovies) Store(path string)

type AnimePath added in v0.1.4

type AnimePath string
var AniDBIDPath AnimePath
var MalIDPath AnimePath
var TMDBIDPath AnimePath
var TVDBIDPath AnimePath

type AnimeService

type AnimeService struct {
	Anime      Anime
	AnimeSlice []Anime
	// contains filtered or unexported fields
}

func NewAnimeService

func NewAnimeService(c *colly.Collector) *AnimeService

type Animetitles

type Animetitles struct {
	XMLName xml.Name `xml:"animetitles"`
	Anime   []struct {
		Aid   string `xml:"aid,attr"`
		Title []struct {
			Text string `xml:",chardata"`
			Type string `xml:"type,attr"`
			Lang string `xml:"lang,attr"`
		} `xml:"title"`
	} `xml:"anime"`
}

type Config

type Config struct {
	MalClientID string `json:"mal-client-id"`
	TmdbApiKey  string `json:"tmdb-api-key"`
}

type MalResponse

type MalResponse struct {
	Data []struct {
		Node struct {
			ID          int    `json:"id"`
			Title       string `json:"title"`
			MainPicture struct {
				Medium string `json:"medium"`
				Large  string `json:"large"`
			} `json:"main_picture"`
			MediaType         string `json:"media_type"`
			AlternativeTitles struct {
				Synonyms []string `json:"synonyms"`
				English  string   `json:"en"`
				Japanese string   `json:"ja"`
			} `json:"alternative_titles"`
			StartDate string `json:"start_date"`
		} `json:"node"`
		Ranking struct {
			Rank int `json:"rank"`
		} `json:"ranking"`
	} `json:"data"`
	Paging struct {
		Next string `json:"next"`
	} `json:"paging"`
}

type TMDBAPIResponse

type TMDBAPIResponse struct {
	Page    int `json:"page"`
	Results []struct {
		Adult            bool    `json:"adult"`
		BackdropPath     string  `json:"backdrop_path"`
		GenreIds         []int   `json:"genre_ids"`
		ID               int     `json:"id"`
		OriginalLanguage string  `json:"original_language"`
		OriginalTitle    string  `json:"original_title"`
		Overview         string  `json:"overview"`
		Popularity       float64 `json:"popularity"`
		PosterPath       string  `json:"poster_path"`
		ReleaseDate      string  `json:"release_date"`
		Title            string  `json:"title"`
		Video            bool    `json:"video"`
		VoteAverage      float64 `json:"vote_average"`
		VoteCount        int     `json:"vote_count"`
	} `json:"results"`
	TotalPages   int `json:"total_pages"`
	TotalResults int `json:"total_results"`
}

Jump to

Keyboard shortcuts

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