library

package
v0.0.0-...-29a3764 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MovieType ...
	MovieType = iota
	// ShowType ...
	ShowType
	// SeasonType ...
	SeasonType
	// EpisodeType ...
	EpisodeType
)
View Source
const (
	// StateDeleted ...
	StateDeleted = iota
	// StateActive ...
	StateActive
)
View Source
const (
	// ActionUpdate ...
	ActionUpdate = iota
	// ActionDelete ...
	ActionDelete
	// ActionSafeDelete ...
	ActionSafeDelete
)
View Source
const (
	// TVDBScraper ...
	TVDBScraper = iota
	// TMDBScraper ...
	TMDBScraper
	// TraktScraper ...
	TraktScraper
	// IMDBScraper ...
	IMDBScraper
)
View Source
const (
	// Active ...
	Active = iota
	// Deleted ...
	Deleted
)
View Source
const (
	// Delete ...
	Delete = iota
	// Update ...
	Update
	// Batch ...
	Batch
	// BatchDelete ...
	BatchDelete
	// DeleteTorrent ...
	DeleteTorrent
)

Variables

View Source
var (
	// IsTraktInitialized used to mark if we need only incremental updates from Trakt
	IsTraktInitialized bool
)

Functions

func AddMovie

func AddMovie(tmdbID string, force bool) (*tmdb.Movie, error)

AddMovie is adding movie to the library

func AddShow

func AddShow(tmdbID string, force bool) (*tmdb.Show, error)

AddShow is adding show to the library

func ClearCacheKey

func ClearCacheKey(key string)

ClearCacheKey deletes specific key

func ClearPageCache

func ClearPageCache()

ClearPageCache deletes cached page listings

func ClearResolveCache

func ClearResolveCache()

ClearResolveCache deletes cached IDs resolve

func ClearTmdbCache

func ClearTmdbCache()

ClearTmdbCache deletes cached tmdb data

func ClearTraktCache

func ClearTraktCache()

ClearTraktCache deletes cached trakt data

func CloseLibrary

func CloseLibrary()

CloseLibrary ...

func DiffTraktShows

func DiffTraktShows(previous, current []*trakt.Shows, isInitialized bool) []*trakt.Shows

DiffTraktShows ...

func GetLibraryEpisode

func GetLibraryEpisode(kodiID int) (*Show, *Episode)

GetLibraryEpisode finds Show/Episode from library

func GetLibrarySeason

func GetLibrarySeason(kodiID int) (*Show, *Season)

GetLibrarySeason finds Show/Season from library

func GetShowForEpisode

func GetShowForEpisode(kodiID int) (*Show, *Episode)

GetShowForEpisode returns 'show' and 'episode'

func Init

func Init()

Init makes preparations on program start

func InitDB

func InitDB()

InitDB ...

func IsAddedToLibrary

func IsAddedToLibrary(id string, mediaType int) (isAdded bool)

IsAddedToLibrary checks if specific TMDB exists in the library

func IsDuplicateEpisode

func IsDuplicateEpisode(tmdbShowID int, seasonNumber int, episodeNumber int) bool

IsDuplicateEpisode checks if episode exists in the library

func IsDuplicateMovie

func IsDuplicateMovie(tmdbID string) bool

IsDuplicateMovie checks if movie exists in the library

func IsDuplicateShow

func IsDuplicateShow(tmdbID string) bool

IsDuplicateShow checks if show exists in the library

func IsDuplicateShowByInt

func IsDuplicateShowByInt(tmdbID int) bool

IsDuplicateShowByInt checks if show exists in the library

func MarkKodiAdded

func MarkKodiAdded()

MarkKodiAdded ...

func MarkKodiRefresh

func MarkKodiRefresh()

MarkKodiRefresh ...

func MarkKodiUpdated

func MarkKodiUpdated()

MarkKodiUpdated ...

func MoviesLibraryPath

func MoviesLibraryPath() string

MoviesLibraryPath contains calculated path for saving Movies strm files

func PlanKodiUpdate

func PlanKodiUpdate()

PlanKodiUpdate ...

func PlanMoviesUpdate

func PlanMoviesUpdate()

PlanMoviesUpdate ...

func PlanOverallUpdate

func PlanOverallUpdate()

PlanOverallUpdate ...

func PlanShowUpdate

func PlanShowUpdate(showID int)

PlanShowUpdate ...

func PlanShowsUpdate

func PlanShowsUpdate()

PlanShowsUpdate ...

func PlanTraktUpdate

func PlanTraktUpdate()

PlanTraktUpdate ...

func Refresh

func Refresh() error

Refresh is updating library from Kodi

func RefreshEpisode

func RefreshEpisode(kodiID, action int)

RefreshEpisode ...

func RefreshEpisodes

func RefreshEpisodes() error

RefreshEpisodes updates episodes list for selected show in the library

func RefreshKodi

func RefreshKodi() error

RefreshKodi runs Kodi library refresh

func RefreshLocal

func RefreshLocal() error

RefreshLocal checks media directory to save up-to-date strm library

func RefreshMovie

func RefreshMovie(kodiID, action int)

RefreshMovie ...

func RefreshMovies

func RefreshMovies() error

RefreshMovies updates movies in the library

func RefreshOnScan

func RefreshOnScan() error

RefreshOnScan is launched when scan is finished

func RefreshSeasons

func RefreshSeasons() error

RefreshSeasons updates seasons list for selected show in the library

func RefreshShow

func RefreshShow(kodiID, action int)

RefreshShow ...

func RefreshShows

func RefreshShows() error

RefreshShows updates shows in the library

func RefreshTrakt

func RefreshTrakt() error

RefreshTrakt gets user activities from Trakt to see if we need to add movies/set watched status and so on

func RefreshTraktCollected

func RefreshTraktCollected(itemType int, isRefreshNeeded bool) error

RefreshTraktCollected ...

func RefreshTraktHidden

func RefreshTraktHidden(itemType int, isRefreshNeeded bool) error

RefreshTraktHidden ...

func RefreshTraktLists

func RefreshTraktLists(isRefreshNeeded bool) error

RefreshTraktLists ...

func RefreshTraktPaused

func RefreshTraktPaused(itemType int, isRefreshNeeded bool) error

RefreshTraktPaused ...

func RefreshTraktWatched

func RefreshTraktWatched(itemType int, isRefreshNeeded bool) error

RefreshTraktWatched ...

func RefreshTraktWatchlisted

func RefreshTraktWatchlisted(itemType int, isRefreshNeeded bool) error

RefreshTraktWatchlisted ...

func RefreshUIDs

func RefreshUIDs() error

RefreshUIDs updates unique IDs for each library item This collects already saved UIDs for easier access

func RefreshUIDsRunner

func RefreshUIDsRunner(force bool) error

RefreshUIDsRunner completes RefreshUIDs target

func RemoveEpisode

func RemoveEpisode(tmdbID int, showID int, seasonNumber int, episodeNumber int) error

RemoveEpisode removes episode from the library

func RemoveMovie

func RemoveMovie(tmdbID int) (*tmdb.Movie, error)

RemoveMovie removes movie from the library

func RemoveShow

func RemoveShow(tmdbID string) (*tmdb.Show, error)

RemoveShow removes show from the library

func ShowsLibraryPath

func ShowsLibraryPath() string

ShowsLibraryPath contains calculated path for saving Shows strm files

func SyncMoviesList

func SyncMoviesList(listID string, updating bool, isUpdateNeeded bool) (err error)

SyncMoviesList updates trakt movie collections in cache

func SyncShowsList

func SyncShowsList(listID string, updating bool, isUpdateNeeded bool) (err error)

SyncShowsList updates trakt collections in cache

func URLForHTTP

func URLForHTTP(pattern string, args ...interface{}) string

URLForHTTP ...

func URLForXBMC

func URLForXBMC(pattern string, args ...interface{}) string

URLForXBMC ...

func URLQuery

func URLQuery(route string, query ...string) string

URLQuery ...

Types

type DBItem

type DBItem struct {
	ID       int `json:"id"`
	State    int `json:"state"`
	Type     int `json:"type"`
	TVShowID int `json:"showid"`
}

DBItem ...

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

func (*Episode) IsWatched

func (e *Episode) IsWatched() bool

IsWatched returns watched state

type Library

type Library struct {

	// Stores all the unique IDs collected
	UIDs []*UniqueIDs

	Movies []*Movie
	Shows  []*Show

	WatchedTrakt []uint64

	Pending Status
	Running Status
	// contains filtered or unexported fields
}

Library represents library

func Get

func Get() *Library

Get returns singleton instance for Library

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

func GetLibraryMovie(kodiID int) *Movie

GetLibraryMovie finds Movie from library

func GetMovieByIMDB

func GetMovieByIMDB(id string) (*Movie, error)

GetMovieByIMDB ...

func GetMovieByTMDB

func GetMovieByTMDB(id int) (*Movie, error)

GetMovieByTMDB ...

func (*Movie) IsWatched

func (m *Movie) IsWatched() bool

IsWatched returns watched state

type Resume

type Resume struct {
	Position float64 `json:"position"`
	Total    float64 `json:"total"`
}

Resume shows watched progress information

func GetEpisodeResume

func GetEpisodeResume(kodiID int) *Resume

GetEpisodeResume returns Resume info for kodi id

func GetMovieResume

func GetMovieResume(kodiID int) *Resume

GetMovieResume returns Resume info for kodi id

func (*Resume) Reset

func (r *Resume) Reset()

Reset ...

func (*Resume) ToString

func (r *Resume) ToString() string

ToString ...

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

func GetLibraryShow

func GetLibraryShow(kodiID int) *Show

GetLibraryShow finds Show from library

func GetShowByIMDB

func GetShowByIMDB(id string) (*Show, error)

GetShowByIMDB ...

func GetShowByTMDB

func GetShowByTMDB(id int) (*Show, error)

GetShowByTMDB ...

func (*Show) GetEpisode

func (s *Show) GetEpisode(season, episode int) *Episode

GetEpisode ...

func (*Show) IsWatched

func (s *Show) IsWatched() bool

IsWatched returns watched state

type Status

type Status struct {
	IsOverall  bool
	IsMovies   bool
	IsShows    bool
	IsEpisodes bool
	IsTrakt    bool
	IsKodi     bool
}

Status represents library bool statuses

type UniqueIDs

type UniqueIDs struct {
	MediaType int    `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

func GetUIDsFromKodi(kodiID int) *UniqueIDs

GetUIDsFromKodi returns UIDs object for provided Kodi ID

Jump to

Keyboard shortcuts

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