Documentation
¶
Index ¶
- func GetLibraryEpisode(kodiID int) (*Show, *Episode)
- func GetLibrarySeason(kodiID int) (*Show, *Season)
- func GetShowForEpisode(kodiID int) (*Show, *Episode)
- func HasMovies() bool
- func HasShows() bool
- func IsAddedToLibrary(id string, mediaType MediaItemType) (isAdded bool)
- func IsDuplicateEpisode(tmdbShowID int, seasonNumber int, episodeNumber int) bool
- func IsDuplicateMovie(tmdbID string) bool
- func IsDuplicateMovieByInt(tmdbID int) bool
- func IsDuplicateShow(tmdbID string) bool
- func IsDuplicateShowByInt(tmdbID int) bool
- type ContainerType
- type Episode
- type Library
- type LibraryContainer
- func (c *LibraryContainer) Add(media MediaItemType, uids *UniqueIDs, ids ...int)
- func (c *LibraryContainer) Clear()
- func (c *LibraryContainer) GetKeys(media MediaItemType, traktID int, tmdbID int, imdbID string, ids ...int) (traktKey, tmdbKey, imdbKey uint64)
- func (c *LibraryContainer) Has(media MediaItemType, uids *UniqueIDs, ids ...int) bool
- func (c *LibraryContainer) HasWithType(media MediaItemType, scraperType ScraperType, id int) bool
- type MediaItemType
- type Movie
- type MutexType
- type Resume
- type ScraperType
- type Season
- type Show
- type Status
- type UniqueIDs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLibraryEpisode ¶
GetLibraryEpisode finds Show/Episode from library
func GetLibrarySeason ¶
GetLibrarySeason finds Show/Season from library
func GetShowForEpisode ¶
GetShowForEpisode returns 'show' and 'episode'
func IsAddedToLibrary ¶
func IsAddedToLibrary(id string, mediaType MediaItemType) (isAdded bool)
IsAddedToLibrary checks if specific TMDB exists in the library
func IsDuplicateEpisode ¶
IsDuplicateEpisode checks if episode exists in the library
func IsDuplicateMovie ¶
IsDuplicateMovie checks if movie exists in the library
func IsDuplicateMovieByInt ¶
IsDuplicateMovieByInt checks if movie exists in the library
func IsDuplicateShow ¶
IsDuplicateShow checks if show exists in the library
func IsDuplicateShowByInt ¶
IsDuplicateShowByInt checks if show exists in the library
Types ¶
type ContainerType ¶
type ContainerType int
const ( WatchlistedMoviesContainer ContainerType = iota WatchedMoviesContainer CollectedMoviesContainer UserlistedMoviesContainer WatchlistedShowsContainer WatchedShowsContainer CollectedShowsContainer UserlistedShowsContainer )
type Episode ¶
type Episode struct { ID int Title string Season int Episode int File string DateAdded time.Time UIDs *UniqueIDs XbmcUIDs *xbmc.UniqueIDs Resume *Resume }
Episode represents Episode content type
type Library ¶
type Library struct { Mu map[MutexType]*sync.RWMutex // Stores all the unique IDs collected UIDs []*UniqueIDs Movies []*Movie Shows []*Show Containers map[ContainerType]*LibraryContainer Pending Status Running Status // contains filtered or unexported fields }
func (*Library) GetContainer ¶
func (l *Library) GetContainer(id ContainerType) *LibraryContainer
type LibraryContainer ¶
func NewLibraryContainer ¶
func NewLibraryContainer() *LibraryContainer
func (*LibraryContainer) Add ¶
func (c *LibraryContainer) Add(media MediaItemType, uids *UniqueIDs, ids ...int)
func (*LibraryContainer) Clear ¶
func (c *LibraryContainer) Clear()
func (*LibraryContainer) GetKeys ¶
func (c *LibraryContainer) GetKeys(media MediaItemType, traktID int, tmdbID int, imdbID string, ids ...int) (traktKey, tmdbKey, imdbKey uint64)
func (*LibraryContainer) Has ¶
func (c *LibraryContainer) Has(media MediaItemType, uids *UniqueIDs, ids ...int) bool
func (*LibraryContainer) HasWithType ¶
func (c *LibraryContainer) HasWithType(media MediaItemType, scraperType ScraperType, id int) bool
type MediaItemType ¶
type MediaItemType int
const ( MovieType MediaItemType = iota ShowType SeasonType EpisodeType )
type Movie ¶
type Movie struct { ID int Title string File string Year int DateAdded time.Time UIDs *UniqueIDs XbmcUIDs *xbmc.UniqueIDs Resume *Resume }
Movie represents Movie content type
func GetLibraryMovie ¶
GetLibraryMovie finds Movie from library
type Resume ¶
Resume shows watched progress information
func GetEpisodeResume ¶
GetEpisodeResume returns Resume info for kodi id
func GetMovieResume ¶
GetMovieResume returns Resume info for kodi id
type ScraperType ¶
type ScraperType int
const ( TVDBScraper ScraperType = iota TMDBScraper TraktScraper IMDBScraper )
type Season ¶
type Season struct { ID int Title string Season int Episodes int UIDs *UniqueIDs XbmcUIDs *xbmc.UniqueIDs }
Season represents Season content type
type Show ¶
type Show struct { ID int Title string Year int DateAdded time.Time Seasons []*Season Episodes []*Episode UIDs *UniqueIDs XbmcUIDs *xbmc.UniqueIDs }
Show represents Show content type
type Status ¶
type Status struct { IsOverall bool IsMovies bool IsShows bool IsEpisodes bool IsTrakt bool IsKodi bool IsKodiMovies bool IsKodiShows bool }
Status represents library bool statuses
type UniqueIDs ¶
type UniqueIDs struct { MediaType MediaItemType `json:"media"` Kodi int `json:"kodi"` TMDB int `json:"tmdb"` TVDB int `json:"tvdb"` IMDB string `json:"imdb"` Trakt int `json:"trakt"` Playcount int `json:"playcount"` }
UniqueIDs represents all IDs for a library item
func GetUIDsFromKodi ¶
GetUIDsFromKodi returns UIDs object for provided Kodi ID