library

package
v0.0.0-...-a6eb964 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: Apache-2.0 Imports: 25 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 (

	// Scanning shows if Kodi library Scan is in progress
	Scanning = false
	// TraktScanning shows if Trakt is working
	TraktScanning = false
)

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 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) (err error)

IsDuplicateEpisode checks if episode exists in the library

func IsDuplicateMovie

func IsDuplicateMovie(tmdbID string) error

IsDuplicateMovie checks if movie exists in the library

func IsDuplicateShow

func IsDuplicateShow(tmdbID string) error

IsDuplicateShow checks if show exists in the library

func MoviesLibraryPath

func MoviesLibraryPath() string

MoviesLibraryPath contains calculated path for saving Movies strm files

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 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 RefreshOnClean

func RefreshOnClean() error

RefreshOnClean is launched when clear is finished

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 starts a trakt sync

func RefreshUIDs

func RefreshUIDs() error

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

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) (err error)

SyncMoviesList updates trakt movie collections in cache

func SyncShowsList

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

SyncShowsList updates trakt collections in cache

func SyncTraktWatched

func SyncTraktWatched() (haveChanges bool, err error)

SyncTraktWatched gets watched list and updates watched status in the library

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
	UIDs     *UniqueIDs
	XbmcUIDs *xbmc.UniqueIDs
	Resume   *Resume
}

Episode represents Episode content type

type Library

type Library struct {

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

	// Stores Library Movies
	Movies map[int]*Movie

	// Stored Library Shows
	Shows map[int]*Show

	WatchedTrakt map[uint64]bool
	// 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
	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 ...

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
	Seasons  map[int]*Season
	Episodes map[int]*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 ...

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