Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.
CVideoDatabase Class Reference

#include <VideoDatabase.h>

Inheritance diagram for CVideoDatabase:
CDatabase

Classes

class  CActor
 
class  CSeason
 
class  CSetInfo
 

Public Member Functions

 CVideoDatabase (void)
 
 ~CVideoDatabase (void) override
 
bool Open () override
 
bool CommitTransaction () override
 
int AddNewEpisode (int idShow, CVideoInfoTag &details)
 
void SetPlayCount (const CFileItem &item, int count, const CDateTime &date=CDateTime())
 Set the playcount of an item Sets the playcount and last played date to a given value. More...
 
void IncrementPlayCount (const CFileItem &item)
 Increment the playcount of an item Increments the playcount and updates the last played date. More...
 
int GetPlayCount (const CFileItem &item)
 Get the playcount of an item. More...
 
int GetPlayCount (const std::string &strFilenameAndPath)
 Get the playcount of a filename and path. More...
 
void UpdateLastPlayed (const CFileItem &item)
 Update the last played time of an item Updates the last played date. More...
 
bool GetPlayCounts (const std::string &path, CFileItemList &items)
 Get the playcount and resume point of a list of items Note that if the resume point is already set on an item, it won't be overridden. More...
 
void UpdateMovieTitle (int idMovie, const std::string &strNewMovieTitle, VIDEODB_CONTENT_TYPE iType=VIDEODB_CONTENT_MOVIES)
 
bool UpdateVideoSortTitle (int idDb, const std::string &strNewSortTitle, VIDEODB_CONTENT_TYPE iType=VIDEODB_CONTENT_MOVIES)
 
bool HasMovieInfo (const std::string &strFilenameAndPath)
 
bool HasTvShowInfo (const std::string &strFilenameAndPath)
 
bool HasEpisodeInfo (const std::string &strFilenameAndPath)
 
bool HasMusicVideoInfo (const std::string &strFilenameAndPath)
 
void GetFilePathById (int idMovie, std::string &filePath, VIDEODB_CONTENT_TYPE iType)
 
std::string GetGenreById (int id)
 
std::string GetCountryById (int id)
 
std::string GetSetById (int id)
 
std::string GetTagById (int id)
 
std::string GetPersonById (int id)
 
std::string GetStudioById (int id)
 
std::string GetTvShowTitleById (int id)
 
std::string GetMusicVideoAlbumById (int id)
 
int GetTvShowForEpisode (int idEpisode)
 
int GetSeasonForEpisode (int idEpisode)
 
bool LoadVideoInfo (const std::string &strFilenameAndPath, CVideoInfoTag &details, int getDetails=VideoDbDetailsAll)
 
bool GetMovieInfo (const std::string &strFilenameAndPath, CVideoInfoTag &details, int idMovie=-1, int getDetails=VideoDbDetailsAll)
 
bool GetTvShowInfo (const std::string &strPath, CVideoInfoTag &details, int idTvShow=-1, CFileItem *item=NULL, int getDetails=VideoDbDetailsAll)
 
bool GetSeasonInfo (int idSeason, CVideoInfoTag &details, bool allDetails=true)
 
bool GetEpisodeBasicInfo (const std::string &strFilenameAndPath, CVideoInfoTag &details, int idEpisode=-1)
 
bool GetEpisodeInfo (const std::string &strFilenameAndPath, CVideoInfoTag &details, int idEpisode=-1, int getDetails=VideoDbDetailsAll)
 
bool GetMusicVideoInfo (const std::string &strFilenameAndPath, CVideoInfoTag &details, int idMVideo=-1, int getDetails=VideoDbDetailsAll)
 
bool GetSetInfo (int idSet, CVideoInfoTag &details)
 
bool GetFileInfo (const std::string &strFilenameAndPath, CVideoInfoTag &details, int idFile=-1)
 
int GetPathId (const std::string &strPath)
 
int GetTvShowId (const std::string &strPath)
 
int GetEpisodeId (const std::string &strFilenameAndPath, int idEpisode=-1, int idSeason=-1)
 
int GetSeasonId (int idShow, int season)
 
void GetEpisodesByFile (const std::string &strFilenameAndPath, std::vector< CVideoInfoTag > &episodes)
 
int SetDetailsForItem (CVideoInfoTag &details, const std::map< std::string, std::string > &artwork)
 
int SetDetailsForItem (int id, const MediaType &mediaType, CVideoInfoTag &details, const std::map< std::string, std::string > &artwork)
 
int SetDetailsForMovie (CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, int idMovie=-1)
 
int SetDetailsForMovieSet (const CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, int idSet=-1)
 
int SetDetailsForTvShow (const std::vector< std::pair< std::string, std::string > > &paths, CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, const std::map< int, std::map< std::string, std::string > > &seasonArt, int idTvShow=-1)
 add a tvshow to the library, setting metadata detail First checks for whether this TV Show is already in the database (based on idTvShow, or via GetMatchingTvShow) and if present adds the paths to the show. If not present, we add a new show and set the show metadata. More...
 
bool UpdateDetailsForTvShow (int idTvShow, CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, const std::map< int, std::map< std::string, std::string > > &seasonArt)
 
int SetDetailsForSeason (const CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, int idShow, int idSeason=-1)
 
int SetDetailsForEpisode (CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, int idShow, int idEpisode=-1)
 
int SetDetailsForMusicVideo (CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, int idMVideo=-1)
 
void SetStreamDetailsForFile (const CStreamDetails &details, const std::string &strFileNameAndPath)
 
void SetStreamDetailsForFileId (const CStreamDetails &details, int idFile)
 
bool SetSingleValue (VIDEODB_CONTENT_TYPE type, int dbId, int dbField, const std::string &strValue)
 
bool SetSingleValue (VIDEODB_CONTENT_TYPE type, int dbId, Field dbField, const std::string &strValue)
 
bool SetSingleValue (const std::string &table, const std::string &fieldName, const std::string &strValue, const std::string &conditionName="", int conditionValue=-1)
 
int UpdateDetailsForMovie (int idMovie, CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, const std::set< std::string > &updatedDetails)
 
void DeleteMovie (int idMovie, bool bKeepId=false)
 
void DeleteTvShow (int idTvShow, bool bKeepId=false)
 
void DeleteTvShow (const std::string &strPath)
 
void DeleteSeason (int idSeason, bool bKeepId=false)
 
void DeleteEpisode (int idEpisode, bool bKeepId=false)
 
void DeleteMusicVideo (int idMusicVideo, bool bKeepId=false)
 
void DeleteDetailsForTvShow (int idTvShow)
 
void DeleteStreamDetails (int idFile)
 
void RemoveContentForPath (const std::string &strPath, CGUIDialogProgress *progress=NULL)
 
void UpdateFanart (const CFileItem &item, VIDEODB_CONTENT_TYPE type)
 
void DeleteSet (int idSet)
 
void DeleteTag (int idTag, VIDEODB_CONTENT_TYPE mediaType)
 
bool GetVideoSettings (int idFile, CVideoSettings &settings)
 Get video settings for the specified file id. More...
 
bool GetVideoSettings (const CFileItem &item, CVideoSettings &settings)
 Get video settings for the specified file item. More...
 
bool GetVideoSettings (const std::string &filePath, CVideoSettings &settings)
 Get video settings for the specified file path. More...
 
void SetVideoSettings (const CFileItem &item, const CVideoSettings &settings)
 Set video settings for the specified file path. More...
 
void SetVideoSettings (int idFile, const CVideoSettings &settings)
 Set video settings for the specified file path. More...
 
void EraseVideoSettings (const CFileItem &item)
 EraseVideoSettings() Erases the videoSettings table and reconstructs it. More...
 
void EraseAllVideoSettings ()
 
void EraseAllVideoSettings (const std::string &path)
 
void EraseAllForPath (const std::string &path)
 
bool GetStackTimes (const std::string &filePath, std::vector< uint64_t > &times)
 GetStackTimes() obtains any saved video times for the stacked file. More...
 
void SetStackTimes (const std::string &filePath, const std::vector< uint64_t > &times)
 Sets the stack times for a particular video file. More...
 
void GetBookMarksForFile (const std::string &strFilenameAndPath, VECBOOKMARKS &bookmarks, CBookmark::EType type=CBookmark::STANDARD, bool bAppend=false, long partNumber=0)
 
void AddBookMarkToFile (const std::string &strFilenameAndPath, const CBookmark &bookmark, CBookmark::EType type=CBookmark::STANDARD)
 
bool GetResumeBookMark (const std::string &strFilenameAndPath, CBookmark &bookmark)
 
void DeleteResumeBookMark (const CFileItem &item)
 
void ClearBookMarkOfFile (const std::string &strFilenameAndPath, CBookmark &bookmark, CBookmark::EType type=CBookmark::STANDARD)
 
void ClearBookMarksOfFile (const std::string &strFilenameAndPath, CBookmark::EType type=CBookmark::STANDARD)
 
void ClearBookMarksOfFile (int idFile, CBookmark::EType type=CBookmark::STANDARD)
 
bool GetBookMarkForEpisode (const CVideoInfoTag &tag, CBookmark &bookmark)
 
void AddBookMarkForEpisode (const CVideoInfoTag &tag, const CBookmark &bookmark)
 
void DeleteBookMarkForEpisode (const CVideoInfoTag &tag)
 
bool GetResumePoint (CVideoInfoTag &tag)
 
bool GetStreamDetails (CFileItem &item)
 
bool GetStreamDetails (CVideoInfoTag &tag) const
 
CVideoInfoTag GetDetailsByTypeAndId (VIDEODB_CONTENT_TYPE type, int id)
 
void SetScraperForPath (const std::string &filePath, const ADDON::ScraperPtr &info, const VIDEO::SScanSettings &settings)
 
ADDON::ScraperPtr GetScraperForPath (const std::string &strPath)
 
ADDON::ScraperPtr GetScraperForPath (const std::string &strPath, VIDEO::SScanSettings &settings)
 
ADDON::ScraperPtr GetScraperForPath (const std::string &strPath, VIDEO::SScanSettings &settings, bool &foundDirectly)
 Retrieve the scraper and settings we should use for the specified path If the scraper is not set on this particular path, we'll recursively check parent folders. More...
 
std::string GetContentForPath (const std::string &strPath)
 Retrieve the content type of videos in the given path If content is set on the folder, we return the given content type, except in the case of tvshows, where we first check for whether we have episodes directly in the path (thus return episodes) or whether we've found a scraper directly (shows). Any folders inbetween are treated as seasons (regardless of whether they actually are seasons). Note that any subfolders in movies will be treated as movies. More...
 
bool GetItemsForPath (const std::string &content, const std::string &path, CFileItemList &items)
 Get videos of the given content type from the given path. More...
 
bool ScraperInUse (const std::string &scraperID) const
 Check whether a given scraper is in use. More...
 
bool SetPathHash (const std::string &path, const std::string &hash)
 
bool GetPathHash (const std::string &path, std::string &hash)
 
bool GetPaths (std::set< std::string > &paths)
 
bool GetPathsForTvShow (int idShow, std::set< int > &paths)
 
bool GetPathsLinkedToTvShow (int idShow, std::vector< std::string > &paths)
 return the paths linked to a tvshow. More...
 
bool GetSubPaths (const std::string &basepath, std::vector< std::pair< int, std::string > > &subpaths)
 retrieve subpaths of a given path. Assumes a hierarchical folder structure More...
 
bool GetSourcePath (const std::string &path, std::string &sourcePath)
 
bool GetSourcePath (const std::string &path, std::string &sourcePath, VIDEO::SScanSettings &settings)
 
int GetMatchingMusicVideo (const std::string &strArtist, const std::string &strAlbum="", const std::string &strTitle="")
 
void GetMoviesByActor (const std::string &strActor, CFileItemList &items)
 
void GetTvShowsByActor (const std::string &strActor, CFileItemList &items)
 
void GetEpisodesByActor (const std::string &strActor, CFileItemList &items)
 
void GetMusicVideosByArtist (const std::string &strArtist, CFileItemList &items)
 
void GetMusicVideosByAlbum (const std::string &strAlbum, CFileItemList &items)
 
void GetMovieGenresByName (const std::string &strSearch, CFileItemList &items)
 
void GetTvShowGenresByName (const std::string &strSearch, CFileItemList &items)
 
void GetMusicVideoGenresByName (const std::string &strSearch, CFileItemList &items)
 
void GetMovieCountriesByName (const std::string &strSearch, CFileItemList &items)
 
void GetMusicVideoAlbumsByName (const std::string &strSearch, CFileItemList &items)
 
void GetMovieActorsByName (const std::string &strSearch, CFileItemList &items)
 
void GetTvShowsActorsByName (const std::string &strSearch, CFileItemList &items)
 
void GetMusicVideoArtistsByName (const std::string &strSearch, CFileItemList &items)
 
void GetMovieDirectorsByName (const std::string &strSearch, CFileItemList &items)
 
void GetTvShowsDirectorsByName (const std::string &strSearch, CFileItemList &items)
 
void GetMusicVideoDirectorsByName (const std::string &strSearch, CFileItemList &items)
 
void GetMoviesByName (const std::string &strSearch, CFileItemList &items)
 
void GetTvShowsByName (const std::string &strSearch, CFileItemList &items)
 
void GetEpisodesByName (const std::string &strSearch, CFileItemList &items)
 
void GetMusicVideosByName (const std::string &strSearch, CFileItemList &items)
 
void GetEpisodesByPlot (const std::string &strSearch, CFileItemList &items)
 
void GetMoviesByPlot (const std::string &strSearch, CFileItemList &items)
 
bool LinkMovieToTvshow (int idMovie, int idShow, bool bRemove)
 
bool IsLinkedToTvshow (int idMovie)
 
bool GetLinksToTvShow (int idMovie, std::vector< int > &ids)
 
bool GetGenresNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetCountriesNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetStudiosNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetYearsNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter())
 
bool GetActorsNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetDirectorsNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetWritersNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetSetsNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool ignoreSingleMovieSets=false)
 
bool GetTagsNav (const std::string &strBaseDir, CFileItemList &items, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetMusicVideoAlbumsNav (const std::string &strBaseDir, CFileItemList &items, int idArtist, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetMoviesNav (const std::string &strBaseDir, CFileItemList &items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idCountry=-1, int idSet=-1, int idTag=-1, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetTvShowsNav (const std::string &strBaseDir, CFileItemList &items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idTag=-1, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetSeasonsNav (const std::string &strBaseDir, CFileItemList &items, int idActor=-1, int idDirector=-1, int idGenre=-1, int idYear=-1, int idShow=-1, bool getLinkedMovies=true)
 
bool GetEpisodesNav (const std::string &strBaseDir, CFileItemList &items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idShow=-1, int idSeason=-1, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetMusicVideosNav (const std::string &strBaseDir, CFileItemList &items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1, int idTag=-1, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetRecentlyAddedMoviesNav (const std::string &strBaseDir, CFileItemList &items, unsigned int limit=0, int getDetails=VideoDbDetailsNone)
 
bool GetRecentlyAddedEpisodesNav (const std::string &strBaseDir, CFileItemList &items, unsigned int limit=0, int getDetails=VideoDbDetailsNone)
 
bool GetRecentlyAddedMusicVideosNav (const std::string &strBaseDir, CFileItemList &items, unsigned int limit=0, int getDetails=VideoDbDetailsNone)
 
bool GetInProgressTvShowsNav (const std::string &strBaseDir, CFileItemList &items, unsigned int limit=0, int getDetails=VideoDbDetailsNone)
 
bool HasContent ()
 
bool HasContent (VIDEODB_CONTENT_TYPE type)
 
bool HasSets () const
 
void CleanDatabase (CGUIDialogProgressBarHandle *handle=NULL, const std::set< int > &paths=std::set< int >(), bool showProgress=true)
 
int AddFile (const std::string &url, const std::string &parentPath="", const CDateTime &dateAdded=CDateTime(), int playcount=0, const CDateTime &lastPlayed=CDateTime())
 Add a file to the database, if necessary If the file is already in the database, we simply return its id. More...
 
int AddFile (const CFileItem &item)
 Add a file to the database, if necessary Works for both videodb:// items and normal fileitems. More...
 
int AddFile (const CVideoInfoTag &details, const std::string &parentPath="")
 Add a file to the database, if necessary Works for both videodb:// items and normal fileitems. More...
 
int AddPath (const std::string &strPath, const std::string &parentPath="", const CDateTime &dateAdded=CDateTime())
 Add a path to the database, if necessary If the path is already in the database, we simply return its id. More...
 
void UpdateFileDateAdded (CVideoInfoTag &details)
 Updates the dateAdded field in the files table for the file with the given idFile and the given path based on the files modification date. More...
 
void ExportToXML (const std::string &path, bool singleFile=true, bool images=false, bool actorThumbs=false, bool overwrite=false)
 
void ExportActorThumbs (const std::string &path, const CVideoInfoTag &tag, bool singleFiles, bool overwrite=false)
 
void ImportFromXML (const std::string &path)
 
void DumpToDummyFiles (const std::string &path)
 
bool ImportArtFromXML (const TiXmlNode *node, std::map< std::string, std::string > &artwork)
 
bool GetMoviesByWhere (const std::string &strBaseDir, const Filter &filter, CFileItemList &items, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetSetsByWhere (const std::string &strBaseDir, const Filter &filter, CFileItemList &items, bool ignoreSingleMovieSets=false)
 
bool GetTvShowsByWhere (const std::string &strBaseDir, const Filter &filter, CFileItemList &items, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetSeasonsByWhere (const std::string &strBaseDir, const Filter &filter, CFileItemList &items, bool appendFullShowPath=true, const SortDescription &sortDescription=SortDescription())
 
bool GetEpisodesByWhere (const std::string &strBaseDir, const Filter &filter, CFileItemList &items, bool appendFullShowPath=true, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetMusicVideosByWhere (const std::string &baseDir, const Filter &filter, CFileItemList &items, bool checkLocks=true, const SortDescription &sortDescription=SortDescription(), int getDetails=VideoDbDetailsNone)
 
bool GetSortedVideos (const MediaType &mediaType, const std::string &strBaseDir, const SortDescription &sortDescription, CFileItemList &items, const Filter &filter=Filter())
 
bool GetItems (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter(), const SortDescription &sortDescription=SortDescription())
 
bool GetItems (const std::string &strBaseDir, const std::string &mediaType, const std::string &itemType, CFileItemList &items, const Filter &filter=Filter(), const SortDescription &sortDescription=SortDescription())
 
bool GetItems (const std::string &strBaseDir, VIDEODB_CONTENT_TYPE mediaType, const std::string &itemType, CFileItemList &items, const Filter &filter=Filter(), const SortDescription &sortDescription=SortDescription())
 
std::string GetItemById (const std::string &itemType, int id)
 
unsigned int GetRandomMusicVideoIDs (const std::string &strWhere, std::vector< std::pair< int, int > > &songIDs)
 Gets music video IDs in random order that match the where clause. More...
 
void SetArtForItem (int mediaId, const MediaType &mediaType, const std::string &artType, const std::string &url)
 
void SetArtForItem (int mediaId, const MediaType &mediaType, const std::map< std::string, std::string > &art)
 
bool GetArtForItem (int mediaId, const MediaType &mediaType, std::map< std::string, std::string > &art)
 
std::string GetArtForItem (int mediaId, const MediaType &mediaType, const std::string &artType)
 
bool HasArtForItem (int mediaId, const MediaType &mediaType)
 
bool RemoveArtForItem (int mediaId, const MediaType &mediaType, const std::string &artType)
 
bool RemoveArtForItem (int mediaId, const MediaType &mediaType, const std::set< std::string > &artTypes)
 
bool GetTvShowSeasons (int showId, std::map< int, int > &seasons)
 
bool GetTvShowNamedSeasons (int showId, std::map< int, std::string > &seasons)
 
bool GetTvShowSeasonArt (int mediaId, std::map< int, std::map< std::string, std::string > > &seasonArt)
 
bool GetArtTypes (const MediaType &mediaType, std::vector< std::string > &artTypes)
 
std::vector< std::string > GetAvailableArtTypesForItem (int mediaId, const MediaType &mediaType)
 Fetch the distinct types of available-but-unassigned art held in the database for a specific media item. More...
 
std::vector< CScraperUrl::SUrlEntryGetAvailableArtForItem (int mediaId, const MediaType &mediaType, const std::string &artType)
 Fetch the list of available-but-unassigned art URLs held in the database for a specific media item and art type. More...
 
int AddTag (const std::string &tag)
 
void AddTagToItem (int idItem, int idTag, const std::string &type)
 
void RemoveTagFromItem (int idItem, int idTag, const std::string &type)
 
void RemoveTagsFromItem (int idItem, const std::string &type)
 
bool GetFilter (CDbUrl &videoUrl, Filter &filter, SortDescription &sorting) override
 
int AddSeason (int showID, int season, const std::string &name="")
 Will check if the season exists and if that is not the case add it to the database. More...
 
int AddSet (const std::string &strSet, const std::string &strOverview="")
 
void ClearMovieSet (int idMovie)
 
void SetMovieSet (int idMovie, int idSet)
 
bool SetVideoUserRating (int dbId, int rating, const MediaType &mediaType)
 
bool GetUseAllExternalAudioForVideo (const std::string &videoPath)
 
- Public Member Functions inherited from CDatabase
 CDatabase ()
 
virtual ~CDatabase (void)
 
bool IsOpen ()
 
virtual void Close ()
 
bool Compress (bool bForce=true)
 
void Interrupt ()
 
bool Open (const DatabaseSettings &db)
 
void BeginTransaction ()
 
void RollbackTransaction ()
 
void CopyDB (const std::string &latestDb)
 
void DropAnalytics ()
 
std::string PrepareSQL (std::string strStmt,...) const
 
std::string GetSingleValue (const std::string &strTable, const std::string &strColumn, const std::string &strWhereClause=std::string(), const std::string &strOrderBy=std::string())
 Get a single value from a table. More...
 
std::string GetSingleValue (const std::string &query)
 
std::string GetSingleValue (const std::string &query, std::unique_ptr< dbiplus::Dataset > &ds)
 Get a single value from a query on a dataset. More...
 
int GetSingleValueInt (const std::string &strTable, const std::string &strColumn, const std::string &strWhereClause=std::string(), const std::string &strOrderBy=std::string())
 Get a single integer value from a table. More...
 
int GetSingleValueInt (const std::string &query)
 
int GetSingleValueInt (const std::string &query, std::unique_ptr< dbiplus::Dataset > &ds)
 Get a single integer value from a query on a dataset. More...
 
bool DeleteValues (const std::string &strTable, const Filter &filter=Filter())
 Delete values from a table. More...
 
bool ExecuteQuery (const std::string &strQuery)
 Execute a query that does not return any result. Note that if BeginMultipleExecute() has been called, the query will be queued until CommitMultipleExecute() is called. More...
 
bool ResultQuery (const std::string &strQuery)
 Execute a query that returns a result. More...
 
bool BeginMultipleExecute ()
 Start a multiple execution queue. Any ExecuteQuery() function following this call will be queued rather than executed until CommitMultipleExecute() is performed. NOTE: Queries that rely on any queued execute query will not function as expected during this period! More...
 
bool CommitMultipleExecute ()
 Commit the multiple execution queue to the database. Queries are performed within a transaction, and the transaction is rolled back should any one query fail. More...
 
bool QueueInsertQuery (const std::string &strQuery)
 Put an INSERT or REPLACE query in the queue. More...
 
bool CommitInsertQueries ()
 Commit all queries in the queue. More...
 
size_t GetInsertQueriesCount ()
 Get the number of INSERT queries in the queue. More...
 
bool QueueDeleteQuery (const std::string &strQuery)
 Put a DELETE query in the queue. More...
 
bool CommitDeleteQueries ()
 Commit all queued DELETE queries. More...
 
size_t GetDeleteQueriesCount ()
 Get the number of DELETE queries in the queue. More...
 
virtual bool BuildSQL (const std::string &strBaseDir, const std::string &strQuery, Filter &filter, std::string &strSQL, CDbUrl &dbUrl)
 
virtual bool BuildSQL (const std::string &strBaseDir, const std::string &strQuery, Filter &filter, std::string &strSQL, CDbUrl &dbUrl, SortDescription &sorting)
 
bool Connect (const std::string &dbName, const DatabaseSettings &db, bool create)
 

Static Public Member Functions

static void VideoContentTypeToString (VIDEODB_CONTENT_TYPE type, std::string &out)
 

Protected Member Functions

int AddNewMovie (CVideoInfoTag &details)
 
int AddNewMusicVideo (CVideoInfoTag &details)
 
int GetMovieId (const std::string &strFilenameAndPath)
 
int GetMusicVideoId (const std::string &strFilenameAndPath)
 
int GetFileId (const CFileItem &item)
 Get the id of this fileitem Works for both videodb:// items and normal fileitems. More...
 
int GetFileId (const CVideoInfoTag &details)
 
int GetAndFillFileId (CVideoInfoTag &details)
 Get the id of the file of this item and store it in the item. More...
 
int GetFileId (const std::string &url)
 Get the id of a file from path. More...
 
int AddToTable (const std::string &table, const std::string &firstField, const std::string &secondField, const std::string &value)
 
int UpdateRatings (int mediaId, const char *mediaType, const RatingMap &values, const std::string &defaultRating)
 
int AddRatings (int mediaId, const char *mediaType, const RatingMap &values, const std::string &defaultRating)
 
int UpdateUniqueIDs (int mediaId, const char *mediaType, const CVideoInfoTag &details)
 
int AddUniqueIDs (int mediaId, const char *mediaType, const CVideoInfoTag &details)
 
int AddActor (const std::string &strActor, const std::string &thumbURL, const std::string &thumb="")
 
int AddTvShow ()
 
bool AddPathToTvShow (int idShow, const std::string &path, const std::string &parentPath, const CDateTime &dateAdded=CDateTime())
 Adds a path to the tvshow link table. More...
 
int GetMatchingTvShow (const CVideoInfoTag &show)
 Check whether a show is already in the library. Matches on unique identifier or matching title and premiered date. More...
 
void AddLinkToActor (int mediaId, const char *mediaType, int actorId, const std::string &role, int order)
 
void AddToLinkTable (int mediaId, const std::string &mediaType, const std::string &table, int valueId, const char *foreignKey=NULL)
 
void RemoveFromLinkTable (int mediaId, const std::string &mediaType, const std::string &table, int valueId, const char *foreignKey=NULL)
 
void AddLinksToItem (int mediaId, const std::string &mediaType, const std::string &field, const std::vector< std::string > &values)
 
void UpdateLinksToItem (int mediaId, const std::string &mediaType, const std::string &field, const std::vector< std::string > &values)
 
void AddActorLinksToItem (int mediaId, const std::string &mediaType, const std::string &field, const std::vector< std::string > &values)
 
void UpdateActorLinksToItem (int mediaId, const std::string &mediaType, const std::string &field, const std::vector< std::string > &values)
 
void AddCast (int mediaId, const char *mediaType, const std::vector< SActorInfo > &cast)
 
CVideoInfoTag GetDetailsForMovie (std::unique_ptr< dbiplus::Dataset > &pDS, int getDetails=VideoDbDetailsNone)
 
CVideoInfoTag GetDetailsForMovie (const dbiplus::sql_record *const record, int getDetails=VideoDbDetailsNone)
 
CVideoInfoTag GetDetailsForTvShow (std::unique_ptr< dbiplus::Dataset > &pDS, int getDetails=VideoDbDetailsNone, CFileItem *item=NULL)
 
CVideoInfoTag GetDetailsForTvShow (const dbiplus::sql_record *const record, int getDetails=VideoDbDetailsNone, CFileItem *item=NULL)
 
CVideoInfoTag GetBasicDetailsForEpisode (std::unique_ptr< dbiplus::Dataset > &pDS)
 
CVideoInfoTag GetBasicDetailsForEpisode (const dbiplus::sql_record *const record)
 
CVideoInfoTag GetDetailsForEpisode (std::unique_ptr< dbiplus::Dataset > &pDS, int getDetails=VideoDbDetailsNone)
 
CVideoInfoTag GetDetailsForEpisode (const dbiplus::sql_record *const record, int getDetails=VideoDbDetailsNone)
 
CVideoInfoTag GetDetailsForMusicVideo (std::unique_ptr< dbiplus::Dataset > &pDS, int getDetails=VideoDbDetailsNone)
 
CVideoInfoTag GetDetailsForMusicVideo (const dbiplus::sql_record *const record, int getDetails=VideoDbDetailsNone)
 
bool GetPeopleNav (const std::string &strBaseDir, CFileItemList &items, const char *type, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetNavCommon (const std::string &strBaseDir, CFileItemList &items, const char *type, int idContent=-1, const Filter &filter=Filter(), bool countOnly=false)
 
void GetCast (int media_id, const std::string &media_type, std::vector< SActorInfo > &cast)
 
void GetTags (int media_id, const std::string &media_type, std::vector< std::string > &tags)
 
void GetRatings (int media_id, const std::string &media_type, RatingMap &ratings)
 
void GetUniqueIDs (int media_id, const std::string &media_type, CVideoInfoTag &details)
 
void GetDetailsFromDB (std::unique_ptr< dbiplus::Dataset > &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset=2)
 
void GetDetailsFromDB (const dbiplus::sql_record *const record, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset=2)
 
std::string GetValueString (const CVideoInfoTag &details, int min, int max, const SDbTableOffsets *offsets) const
 
- Protected Member Functions inherited from CDatabase
void Split (const std::string &strFileNameAndPath, std::string &strPath, std::string &strFileName)
 
bool CreateDatabase ()
 Create database tables and analytics as needed. Calls CreateTables() and CreateAnalytics() on child classes. More...
 
int GetDBVersion ()
 
bool BuildSQL (const std::string &strQuery, const Filter &filter, std::string &strSQL)
 

Additional Inherited Members

- Public Types inherited from CDatabase
typedef struct CDatabase::DatasetFieldInfo DatasetFieldInfo
 
- Protected Attributes inherited from CDatabase
bool m_sqlite
 whether we use sqlite (defaults to true) More...
 
std::unique_ptr< dbiplus::Databasem_pDB
 
std::unique_ptr< dbiplus::Datasetm_pDS
 
std::unique_ptr< dbiplus::Datasetm_pDS2
 
const CProfileManagerm_profileManager
 

Constructor & Destructor Documentation

◆ CVideoDatabase()

CVideoDatabase::CVideoDatabase ( void  )
default

◆ ~CVideoDatabase()

CVideoDatabase::~CVideoDatabase ( void  )
overridedefault

Member Function Documentation

◆ AddActor()

int CVideoDatabase::AddActor ( const std::string &  strActor,
const std::string &  thumbURL,
const std::string &  thumb = "" 
)
protected

◆ AddActorLinksToItem()

void CVideoDatabase::AddActorLinksToItem ( int  mediaId,
const std::string &  mediaType,
const std::string &  field,
const std::vector< std::string > &  values 
)
protected

◆ AddBookMarkForEpisode()

void CVideoDatabase::AddBookMarkForEpisode ( const CVideoInfoTag tag,
const CBookmark bookmark 
)

◆ AddBookMarkToFile()

void CVideoDatabase::AddBookMarkToFile ( const std::string &  strFilenameAndPath,
const CBookmark bookmark,
CBookmark::EType  type = CBookmark::STANDARD 
)

◆ AddCast()

void CVideoDatabase::AddCast ( int  mediaId,
const char *  mediaType,
const std::vector< SActorInfo > &  cast 
)
protected

◆ AddFile() [1/3]

int CVideoDatabase::AddFile ( const CFileItem item)

Add a file to the database, if necessary Works for both videodb:// items and normal fileitems.

Parameters
itemCFileItem to add.
Returns
id of the file, -1 if it could not be added.

◆ AddFile() [2/3]

int CVideoDatabase::AddFile ( const CVideoInfoTag details,
const std::string &  parentPath = "" 
)

Add a file to the database, if necessary Works for both videodb:// items and normal fileitems.

Parameters
urlfull path of the file to add.
detailsdetails of the item to add.
Returns
id of the file, -1 if it could not be added.

◆ AddFile() [3/3]

int CVideoDatabase::AddFile ( const std::string &  url,
const std::string &  parentPath = "",
const CDateTime dateAdded = CDateTime(),
int  playcount = 0,
const CDateTime lastPlayed = CDateTime() 
)

Add a file to the database, if necessary If the file is already in the database, we simply return its id.

Parameters
url- full path of the file to add.
parentPaththe parent path of the path to add. If empty, URIUtils::GetParentPath() will determine the path.
dateAddeddatetime when the file was added to the filesystem/database
playcountthe playcount of the file to add.
lastPlayedthe date and time when the file to add was last played.
Returns
id of the file, -1 if it could not be added.

◆ AddLinksToItem()

void CVideoDatabase::AddLinksToItem ( int  mediaId,
const std::string &  mediaType,
const std::string &  field,
const std::vector< std::string > &  values 
)
protected

◆ AddLinkToActor()

void CVideoDatabase::AddLinkToActor ( int  mediaId,
const char *  mediaType,
int  actorId,
const std::string &  role,
int  order 
)
protected

◆ AddNewEpisode()

int CVideoDatabase::AddNewEpisode ( int  idShow,
CVideoInfoTag details 
)

◆ AddNewMovie()

int CVideoDatabase::AddNewMovie ( CVideoInfoTag details)
protected

◆ AddNewMusicVideo()

int CVideoDatabase::AddNewMusicVideo ( CVideoInfoTag details)
protected

◆ AddPath()

int CVideoDatabase::AddPath ( const std::string &  strPath,
const std::string &  parentPath = "",
const CDateTime dateAdded = CDateTime() 
)

Add a path to the database, if necessary If the path is already in the database, we simply return its id.

Parameters
strPaththe path to add
parentPaththe parent path of the path to add. If empty, URIUtils::GetParentPath() will determine the path.
dateAddeddatetime when the path was added to the filesystem/database
Returns
id of the file, -1 if it could not be added.

◆ AddPathToTvShow()

bool CVideoDatabase::AddPathToTvShow ( int  idShow,
const std::string &  path,
const std::string &  parentPath,
const CDateTime dateAdded = CDateTime() 
)
protected

Adds a path to the tvshow link table.

Parameters
idShowthe id of the show.
paththe path to add.
parentPaththe parent path of the path to add.
dateAddeddate/time when the path was added
Returns
true if successfully added, false otherwise.

◆ AddRatings()

int CVideoDatabase::AddRatings ( int  mediaId,
const char *  mediaType,
const RatingMap values,
const std::string &  defaultRating 
)
protected

◆ AddSeason()

int CVideoDatabase::AddSeason ( int  showID,
int  season,
const std::string &  name = "" 
)

Will check if the season exists and if that is not the case add it to the database.

Parameters
showIDThe id of the show in question.
seasonThe season number we want to add.
Returns
The dbId of the season.

◆ AddSet()

int CVideoDatabase::AddSet ( const std::string &  strSet,
const std::string &  strOverview = "" 
)

◆ AddTag()

int CVideoDatabase::AddTag ( const std::string &  tag)

◆ AddTagToItem()

void CVideoDatabase::AddTagToItem ( int  idItem,
int  idTag,
const std::string &  type 
)

◆ AddToLinkTable()

void CVideoDatabase::AddToLinkTable ( int  mediaId,
const std::string &  mediaType,
const std::string &  table,
int  valueId,
const char *  foreignKey = NULL 
)
protected

◆ AddToTable()

int CVideoDatabase::AddToTable ( const std::string &  table,
const std::string &  firstField,
const std::string &  secondField,
const std::string &  value 
)
protected

◆ AddTvShow()

int CVideoDatabase::AddTvShow ( )
protected

◆ AddUniqueIDs()

int CVideoDatabase::AddUniqueIDs ( int  mediaId,
const char *  mediaType,
const CVideoInfoTag details 
)
protected

◆ CleanDatabase()

void CVideoDatabase::CleanDatabase ( CGUIDialogProgressBarHandle handle = NULL,
const std::set< int > &  paths = std::set<int>(),
bool  showProgress = true 
)

◆ ClearBookMarkOfFile()

void CVideoDatabase::ClearBookMarkOfFile ( const std::string &  strFilenameAndPath,
CBookmark bookmark,
CBookmark::EType  type = CBookmark::STANDARD 
)

◆ ClearBookMarksOfFile() [1/2]

void CVideoDatabase::ClearBookMarksOfFile ( const std::string &  strFilenameAndPath,
CBookmark::EType  type = CBookmark::STANDARD 
)

◆ ClearBookMarksOfFile() [2/2]

void CVideoDatabase::ClearBookMarksOfFile ( int  idFile,
CBookmark::EType  type = CBookmark::STANDARD 
)

◆ ClearMovieSet()

void CVideoDatabase::ClearMovieSet ( int  idMovie)

◆ CommitTransaction()

bool CVideoDatabase::CommitTransaction ( )
overridevirtual

Reimplemented from CDatabase.

◆ DeleteBookMarkForEpisode()

void CVideoDatabase::DeleteBookMarkForEpisode ( const CVideoInfoTag tag)

◆ DeleteDetailsForTvShow()

void CVideoDatabase::DeleteDetailsForTvShow ( int  idTvShow)

◆ DeleteEpisode()

void CVideoDatabase::DeleteEpisode ( int  idEpisode,
bool  bKeepId = false 
)
Todo:
move this below CommitTransaction() once UPnP doesn't rely on this anymore

◆ DeleteMovie()

void CVideoDatabase::DeleteMovie ( int  idMovie,
bool  bKeepId = false 
)
Todo:
move this below CommitTransaction() once UPnP doesn't rely on this anymore

◆ DeleteMusicVideo()

void CVideoDatabase::DeleteMusicVideo ( int  idMusicVideo,
bool  bKeepId = false 
)
Todo:
move this below CommitTransaction() once UPnP doesn't rely on this anymore

◆ DeleteResumeBookMark()

void CVideoDatabase::DeleteResumeBookMark ( const CFileItem item)

◆ DeleteSeason()

void CVideoDatabase::DeleteSeason ( int  idSeason,
bool  bKeepId = false 
)

◆ DeleteSet()

void CVideoDatabase::DeleteSet ( int  idSet)

◆ DeleteStreamDetails()

void CVideoDatabase::DeleteStreamDetails ( int  idFile)

◆ DeleteTag()

void CVideoDatabase::DeleteTag ( int  idTag,
VIDEODB_CONTENT_TYPE  mediaType 
)

◆ DeleteTvShow() [1/2]

void CVideoDatabase::DeleteTvShow ( const std::string &  strPath)

◆ DeleteTvShow() [2/2]

void CVideoDatabase::DeleteTvShow ( int  idTvShow,
bool  bKeepId = false 
)
Todo:
move this below CommitTransaction() once UPnP doesn't rely on this anymore

◆ DumpToDummyFiles()

void CVideoDatabase::DumpToDummyFiles ( const std::string &  path)

◆ EraseAllForPath()

void CVideoDatabase::EraseAllForPath ( const std::string &  path)

Erases all entries for files starting with path, including the files and path entries

Parameters
pathpattern

◆ EraseAllVideoSettings() [1/2]

void CVideoDatabase::EraseAllVideoSettings ( )

Erases all video settings

◆ EraseAllVideoSettings() [2/2]

void CVideoDatabase::EraseAllVideoSettings ( const std::string &  path)

Erases video settings for files starting with path

Parameters
pathpattern

◆ EraseVideoSettings()

void CVideoDatabase::EraseVideoSettings ( const CFileItem item)

EraseVideoSettings() Erases the videoSettings table and reconstructs it.

Erases video settings for file item

Parameters
fileitem

◆ ExportActorThumbs()

void CVideoDatabase::ExportActorThumbs ( const std::string &  path,
const CVideoInfoTag tag,
bool  singleFiles,
bool  overwrite = false 
)

◆ ExportToXML()

void CVideoDatabase::ExportToXML ( const std::string &  path,
bool  singleFile = true,
bool  images = false,
bool  actorThumbs = false,
bool  overwrite = false 
)

◆ GetActorsNav()

bool CVideoDatabase::GetActorsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetAndFillFileId()

int CVideoDatabase::GetAndFillFileId ( CVideoInfoTag details)
protected

Get the id of the file of this item and store it in the item.

Parameters
detailsCVideoInfoTag for which to get and store the id of the file
Returns
id of the file, -1 if it is not in the db.

◆ GetArtForItem() [1/2]

std::string CVideoDatabase::GetArtForItem ( int  mediaId,
const MediaType mediaType,
const std::string &  artType 
)

◆ GetArtForItem() [2/2]

bool CVideoDatabase::GetArtForItem ( int  mediaId,
const MediaType mediaType,
std::map< std::string, std::string > &  art 
)

◆ GetArtTypes()

bool CVideoDatabase::GetArtTypes ( const MediaType mediaType,
std::vector< std::string > &  artTypes 
)

◆ GetAvailableArtForItem()

std::vector< CScraperUrl::SUrlEntry > CVideoDatabase::GetAvailableArtForItem ( int  mediaId,
const MediaType mediaType,
const std::string &  artType 
)

Fetch the list of available-but-unassigned art URLs held in the database for a specific media item and art type.

Parameters
mediaIdthe id in the media table.
mediaTypecorresponds to the table the item resides in.
artTypee.g. "thumb", "fanart", etc.
Returns
list of URLs

◆ GetAvailableArtTypesForItem()

std::vector< std::string > CVideoDatabase::GetAvailableArtTypesForItem ( int  mediaId,
const MediaType mediaType 
)

Fetch the distinct types of available-but-unassigned art held in the database for a specific media item.

Parameters
mediaIdthe id in the media table.
mediaTypethe type of media, which corresponds to the table the item resides in.
Returns
the types of art e.g. "thumb", "fanart", etc.

◆ GetBasicDetailsForEpisode() [1/2]

CVideoInfoTag CVideoDatabase::GetBasicDetailsForEpisode ( const dbiplus::sql_record *const  record)
protected

◆ GetBasicDetailsForEpisode() [2/2]

CVideoInfoTag CVideoDatabase::GetBasicDetailsForEpisode ( std::unique_ptr< dbiplus::Dataset > &  pDS)
protected

◆ GetBookMarkForEpisode()

bool CVideoDatabase::GetBookMarkForEpisode ( const CVideoInfoTag tag,
CBookmark bookmark 
)

◆ GetBookMarksForFile()

void CVideoDatabase::GetBookMarksForFile ( const std::string &  strFilenameAndPath,
VECBOOKMARKS bookmarks,
CBookmark::EType  type = CBookmark::STANDARD,
bool  bAppend = false,
long  partNumber = 0 
)

◆ GetCast()

void CVideoDatabase::GetCast ( int  media_id,
const std::string &  media_type,
std::vector< SActorInfo > &  cast 
)
protected

◆ GetContentForPath()

std::string CVideoDatabase::GetContentForPath ( const std::string &  strPath)

Retrieve the content type of videos in the given path If content is set on the folder, we return the given content type, except in the case of tvshows, where we first check for whether we have episodes directly in the path (thus return episodes) or whether we've found a scraper directly (shows). Any folders inbetween are treated as seasons (regardless of whether they actually are seasons). Note that any subfolders in movies will be treated as movies.

Parameters
strPathpath to start searching in.
Returns
A content type string for the current path.

◆ GetCountriesNav()

bool CVideoDatabase::GetCountriesNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetCountryById()

std::string CVideoDatabase::GetCountryById ( int  id)

◆ GetDetailsByTypeAndId()

CVideoInfoTag CVideoDatabase::GetDetailsByTypeAndId ( VIDEODB_CONTENT_TYPE  type,
int  id 
)

◆ GetDetailsForEpisode() [1/2]

CVideoInfoTag CVideoDatabase::GetDetailsForEpisode ( const dbiplus::sql_record *const  record,
int  getDetails = VideoDbDetailsNone 
)
protected

◆ GetDetailsForEpisode() [2/2]

CVideoInfoTag CVideoDatabase::GetDetailsForEpisode ( std::unique_ptr< dbiplus::Dataset > &  pDS,
int  getDetails = VideoDbDetailsNone 
)
protected

◆ GetDetailsForMovie() [1/2]

CVideoInfoTag CVideoDatabase::GetDetailsForMovie ( const dbiplus::sql_record *const  record,
int  getDetails = VideoDbDetailsNone 
)
protected

◆ GetDetailsForMovie() [2/2]

CVideoInfoTag CVideoDatabase::GetDetailsForMovie ( std::unique_ptr< dbiplus::Dataset > &  pDS,
int  getDetails = VideoDbDetailsNone 
)
protected

◆ GetDetailsForMusicVideo() [1/2]

CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo ( const dbiplus::sql_record *const  record,
int  getDetails = VideoDbDetailsNone 
)
protected

◆ GetDetailsForMusicVideo() [2/2]

CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo ( std::unique_ptr< dbiplus::Dataset > &  pDS,
int  getDetails = VideoDbDetailsNone 
)
protected

◆ GetDetailsForTvShow() [1/2]

CVideoInfoTag CVideoDatabase::GetDetailsForTvShow ( const dbiplus::sql_record *const  record,
int  getDetails = VideoDbDetailsNone,
CFileItem item = NULL 
)
protected

◆ GetDetailsForTvShow() [2/2]

CVideoInfoTag CVideoDatabase::GetDetailsForTvShow ( std::unique_ptr< dbiplus::Dataset > &  pDS,
int  getDetails = VideoDbDetailsNone,
CFileItem item = NULL 
)
protected

◆ GetDetailsFromDB() [1/2]

void CVideoDatabase::GetDetailsFromDB ( const dbiplus::sql_record *const  record,
int  min,
int  max,
const SDbTableOffsets offsets,
CVideoInfoTag details,
int  idxOffset = 2 
)
protected

◆ GetDetailsFromDB() [2/2]

void CVideoDatabase::GetDetailsFromDB ( std::unique_ptr< dbiplus::Dataset > &  pDS,
int  min,
int  max,
const SDbTableOffsets offsets,
CVideoInfoTag details,
int  idxOffset = 2 
)
protected

◆ GetDirectorsNav()

bool CVideoDatabase::GetDirectorsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetEpisodeBasicInfo()

bool CVideoDatabase::GetEpisodeBasicInfo ( const std::string &  strFilenameAndPath,
CVideoInfoTag details,
int  idEpisode = -1 
)

◆ GetEpisodeId()

int CVideoDatabase::GetEpisodeId ( const std::string &  strFilenameAndPath,
int  idEpisode = -1,
int  idSeason = -1 
)

◆ GetEpisodeInfo()

bool CVideoDatabase::GetEpisodeInfo ( const std::string &  strFilenameAndPath,
CVideoInfoTag details,
int  idEpisode = -1,
int  getDetails = VideoDbDetailsAll 
)

◆ GetEpisodesByActor()

void CVideoDatabase::GetEpisodesByActor ( const std::string &  strActor,
CFileItemList items 
)

◆ GetEpisodesByFile()

void CVideoDatabase::GetEpisodesByFile ( const std::string &  strFilenameAndPath,
std::vector< CVideoInfoTag > &  episodes 
)

◆ GetEpisodesByName()

void CVideoDatabase::GetEpisodesByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetEpisodesByPlot()

void CVideoDatabase::GetEpisodesByPlot ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetEpisodesByWhere()

bool CVideoDatabase::GetEpisodesByWhere ( const std::string &  strBaseDir,
const Filter filter,
CFileItemList items,
bool  appendFullShowPath = true,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetEpisodesNav()

bool CVideoDatabase::GetEpisodesNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idGenre = -1,
int  idYear = -1,
int  idActor = -1,
int  idDirector = -1,
int  idShow = -1,
int  idSeason = -1,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetFileId() [1/3]

int CVideoDatabase::GetFileId ( const CFileItem item)
protected

Get the id of this fileitem Works for both videodb:// items and normal fileitems.

Parameters
itemCFileItem to grab the fileid of
Returns
id of the file, -1 if it is not in the db.

◆ GetFileId() [2/3]

int CVideoDatabase::GetFileId ( const CVideoInfoTag details)
protected

◆ GetFileId() [3/3]

int CVideoDatabase::GetFileId ( const std::string &  url)
protected

Get the id of a file from path.

Parameters
urlfull path to the file
Returns
id of the file, -1 if it is not in the db.

◆ GetFileInfo()

bool CVideoDatabase::GetFileInfo ( const std::string &  strFilenameAndPath,
CVideoInfoTag details,
int  idFile = -1 
)

◆ GetFilePathById()

void CVideoDatabase::GetFilePathById ( int  idMovie,
std::string &  filePath,
VIDEODB_CONTENT_TYPE  iType 
)

◆ GetFilter()

bool CVideoDatabase::GetFilter ( CDbUrl videoUrl,
Filter filter,
SortDescription sorting 
)
overridevirtual

Reimplemented from CDatabase.

◆ GetGenreById()

std::string CVideoDatabase::GetGenreById ( int  id)

◆ GetGenresNav()

bool CVideoDatabase::GetGenresNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetInProgressTvShowsNav()

bool CVideoDatabase::GetInProgressTvShowsNav ( const std::string &  strBaseDir,
CFileItemList items,
unsigned int  limit = 0,
int  getDetails = VideoDbDetailsNone 
)

◆ GetItemById()

std::string CVideoDatabase::GetItemById ( const std::string &  itemType,
int  id 
)

◆ GetItems() [1/3]

bool CVideoDatabase::GetItems ( const std::string &  strBaseDir,
CFileItemList items,
const Filter filter = Filter(),
const SortDescription sortDescription = SortDescription() 
)

◆ GetItems() [2/3]

bool CVideoDatabase::GetItems ( const std::string &  strBaseDir,
const std::string &  mediaType,
const std::string &  itemType,
CFileItemList items,
const Filter filter = Filter(),
const SortDescription sortDescription = SortDescription() 
)

◆ GetItems() [3/3]

bool CVideoDatabase::GetItems ( const std::string &  strBaseDir,
VIDEODB_CONTENT_TYPE  mediaType,
const std::string &  itemType,
CFileItemList items,
const Filter filter = Filter(),
const SortDescription sortDescription = SortDescription() 
)

◆ GetItemsForPath()

bool CVideoDatabase::GetItemsForPath ( const std::string &  content,
const std::string &  path,
CFileItemList items 
)

Get videos of the given content type from the given path.

Parameters
contentthe content type to fetch.
paththe path to fetch videos from.
itemsthe returned items
Returns
true if items are found, false otherwise.

◆ GetLinksToTvShow()

bool CVideoDatabase::GetLinksToTvShow ( int  idMovie,
std::vector< int > &  ids 
)

◆ GetMatchingMusicVideo()

int CVideoDatabase::GetMatchingMusicVideo ( const std::string &  strArtist,
const std::string &  strAlbum = "",
const std::string &  strTitle = "" 
)

◆ GetMatchingTvShow()

int CVideoDatabase::GetMatchingTvShow ( const CVideoInfoTag show)
protected

Check whether a show is already in the library. Matches on unique identifier or matching title and premiered date.

Parameters
showthe details of the show to check for.
Returns
the show id if found, else -1.

◆ GetMovieActorsByName()

void CVideoDatabase::GetMovieActorsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMovieCountriesByName()

void CVideoDatabase::GetMovieCountriesByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMovieDirectorsByName()

void CVideoDatabase::GetMovieDirectorsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMovieGenresByName()

void CVideoDatabase::GetMovieGenresByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMovieId()

int CVideoDatabase::GetMovieId ( const std::string &  strFilenameAndPath)
protected

◆ GetMovieInfo()

bool CVideoDatabase::GetMovieInfo ( const std::string &  strFilenameAndPath,
CVideoInfoTag details,
int  idMovie = -1,
int  getDetails = VideoDbDetailsAll 
)

◆ GetMoviesByActor()

void CVideoDatabase::GetMoviesByActor ( const std::string &  strActor,
CFileItemList items 
)

◆ GetMoviesByName()

void CVideoDatabase::GetMoviesByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMoviesByPlot()

void CVideoDatabase::GetMoviesByPlot ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMoviesByWhere()

bool CVideoDatabase::GetMoviesByWhere ( const std::string &  strBaseDir,
const Filter filter,
CFileItemList items,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetMoviesNav()

bool CVideoDatabase::GetMoviesNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idGenre = -1,
int  idYear = -1,
int  idActor = -1,
int  idDirector = -1,
int  idStudio = -1,
int  idCountry = -1,
int  idSet = -1,
int  idTag = -1,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetMusicVideoAlbumById()

std::string CVideoDatabase::GetMusicVideoAlbumById ( int  id)

◆ GetMusicVideoAlbumsByName()

void CVideoDatabase::GetMusicVideoAlbumsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMusicVideoAlbumsNav()

bool CVideoDatabase::GetMusicVideoAlbumsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idArtist,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetMusicVideoArtistsByName()

void CVideoDatabase::GetMusicVideoArtistsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMusicVideoDirectorsByName()

void CVideoDatabase::GetMusicVideoDirectorsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMusicVideoGenresByName()

void CVideoDatabase::GetMusicVideoGenresByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMusicVideoId()

int CVideoDatabase::GetMusicVideoId ( const std::string &  strFilenameAndPath)
protected

◆ GetMusicVideoInfo()

bool CVideoDatabase::GetMusicVideoInfo ( const std::string &  strFilenameAndPath,
CVideoInfoTag details,
int  idMVideo = -1,
int  getDetails = VideoDbDetailsAll 
)

◆ GetMusicVideosByAlbum()

void CVideoDatabase::GetMusicVideosByAlbum ( const std::string &  strAlbum,
CFileItemList items 
)

◆ GetMusicVideosByArtist()

void CVideoDatabase::GetMusicVideosByArtist ( const std::string &  strArtist,
CFileItemList items 
)
Todo:
SMARTPLAYLISTS what is this here for???

◆ GetMusicVideosByName()

void CVideoDatabase::GetMusicVideosByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetMusicVideosByWhere()

bool CVideoDatabase::GetMusicVideosByWhere ( const std::string &  baseDir,
const Filter filter,
CFileItemList items,
bool  checkLocks = true,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetMusicVideosNav()

bool CVideoDatabase::GetMusicVideosNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idGenre = -1,
int  idYear = -1,
int  idArtist = -1,
int  idDirector = -1,
int  idStudio = -1,
int  idAlbum = -1,
int  idTag = -1,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetNavCommon()

bool CVideoDatabase::GetNavCommon ( const std::string &  strBaseDir,
CFileItemList items,
const char *  type,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)
protected

◆ GetPathHash()

bool CVideoDatabase::GetPathHash ( const std::string &  path,
std::string &  hash 
)

◆ GetPathId()

int CVideoDatabase::GetPathId ( const std::string &  strPath)

◆ GetPaths()

bool CVideoDatabase::GetPaths ( std::set< std::string > &  paths)

◆ GetPathsForTvShow()

bool CVideoDatabase::GetPathsForTvShow ( int  idShow,
std::set< int > &  paths 
)

◆ GetPathsLinkedToTvShow()

bool CVideoDatabase::GetPathsLinkedToTvShow ( int  idShow,
std::vector< std::string > &  paths 
)

return the paths linked to a tvshow.

Parameters
idShowthe id of the tvshow.
paths[out] the list of paths associated with the show.
Returns
true on success, false on failure.

◆ GetPeopleNav()

bool CVideoDatabase::GetPeopleNav ( const std::string &  strBaseDir,
CFileItemList items,
const char *  type,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)
protected
Todo:
This routine (and probably others at this same level) use playcount as a reference to filter on at a later point. This means that we MUST filter these levels as you'll get double ups. Ideally we'd allow playcount to filter through as we normally do for tvshows to save this happening. Also, we apply this same filtering logic to the locked or unlocked paths to prevent these from showing. Whether or not this should happen is a tricky one - it complicates all the high level categories (everything above titles).

◆ GetPersonById()

std::string CVideoDatabase::GetPersonById ( int  id)

◆ GetPlayCount() [1/2]

int CVideoDatabase::GetPlayCount ( const CFileItem item)

Get the playcount of an item.

Parameters
itemCFileItem to get the playcount for
Returns
the playcount of the item, or -1 on error
See also
SetPlayCount, IncrementPlayCount, GetPlayCounts

◆ GetPlayCount() [2/2]

int CVideoDatabase::GetPlayCount ( const std::string &  strFilenameAndPath)

Get the playcount of a filename and path.

Parameters
strFilenameAndPathfilename and path to get the playcount for
Returns
the playcount of the item, or -1 on error
See also
SetPlayCount, IncrementPlayCount, GetPlayCounts

◆ GetPlayCounts()

bool CVideoDatabase::GetPlayCounts ( const std::string &  path,
CFileItemList items 
)

Get the playcount and resume point of a list of items Note that if the resume point is already set on an item, it won't be overridden.

Parameters
paththe path to fetch videos from
itemsCFileItemList to fetch the playcounts for
See also
GetPlayCount, SetPlayCount, IncrementPlayCount
Todo:
also test a single query for the above and below

◆ GetRandomMusicVideoIDs()

unsigned int CVideoDatabase::GetRandomMusicVideoIDs ( const std::string &  strWhere,
std::vector< std::pair< int, int > > &  songIDs 
)

Gets music video IDs in random order that match the where clause.

Parameters
strWherethe SQL where clause to apply in the query
songIDsa vector of <2, id> pairs suited to party mode use
Returns
count of music video IDs found.

◆ GetRatings()

void CVideoDatabase::GetRatings ( int  media_id,
const std::string &  media_type,
RatingMap ratings 
)
protected

◆ GetRecentlyAddedEpisodesNav()

bool CVideoDatabase::GetRecentlyAddedEpisodesNav ( const std::string &  strBaseDir,
CFileItemList items,
unsigned int  limit = 0,
int  getDetails = VideoDbDetailsNone 
)

◆ GetRecentlyAddedMoviesNav()

bool CVideoDatabase::GetRecentlyAddedMoviesNav ( const std::string &  strBaseDir,
CFileItemList items,
unsigned int  limit = 0,
int  getDetails = VideoDbDetailsNone 
)

◆ GetRecentlyAddedMusicVideosNav()

bool CVideoDatabase::GetRecentlyAddedMusicVideosNav ( const std::string &  strBaseDir,
CFileItemList items,
unsigned int  limit = 0,
int  getDetails = VideoDbDetailsNone 
)

◆ GetResumeBookMark()

bool CVideoDatabase::GetResumeBookMark ( const std::string &  strFilenameAndPath,
CBookmark bookmark 
)

◆ GetResumePoint()

bool CVideoDatabase::GetResumePoint ( CVideoInfoTag tag)

◆ GetScraperForPath() [1/3]

ScraperPtr CVideoDatabase::GetScraperForPath ( const std::string &  strPath)

◆ GetScraperForPath() [2/3]

ScraperPtr CVideoDatabase::GetScraperForPath ( const std::string &  strPath,
VIDEO::SScanSettings settings 
)

◆ GetScraperForPath() [3/3]

ScraperPtr CVideoDatabase::GetScraperForPath ( const std::string &  strPath,
VIDEO::SScanSettings settings,
bool foundDirectly 
)

Retrieve the scraper and settings we should use for the specified path If the scraper is not set on this particular path, we'll recursively check parent folders.

Parameters
strPathpath to start searching in.
settings[out] scan settings for this folder.
foundDirectly[out] true if a scraper was found directly for strPath, false if it was in a parent path.
Returns
A ScraperPtr containing the scraper information. Returns NULL if a trivial (Content == CONTENT_NONE) scraper or no scraper is found.

◆ GetSeasonForEpisode()

int CVideoDatabase::GetSeasonForEpisode ( int  idEpisode)

◆ GetSeasonId()

int CVideoDatabase::GetSeasonId ( int  idShow,
int  season 
)

◆ GetSeasonInfo()

bool CVideoDatabase::GetSeasonInfo ( int  idSeason,
CVideoInfoTag details,
bool  allDetails = true 
)

◆ GetSeasonsByWhere()

bool CVideoDatabase::GetSeasonsByWhere ( const std::string &  strBaseDir,
const Filter filter,
CFileItemList items,
bool  appendFullShowPath = true,
const SortDescription sortDescription = SortDescription() 
)

◆ GetSeasonsNav()

bool CVideoDatabase::GetSeasonsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idActor = -1,
int  idDirector = -1,
int  idGenre = -1,
int  idYear = -1,
int  idShow = -1,
bool  getLinkedMovies = true 
)

◆ GetSetById()

std::string CVideoDatabase::GetSetById ( int  id)

◆ GetSetInfo()

bool CVideoDatabase::GetSetInfo ( int  idSet,
CVideoInfoTag details 
)

◆ GetSetsByWhere()

bool CVideoDatabase::GetSetsByWhere ( const std::string &  strBaseDir,
const Filter filter,
CFileItemList items,
bool  ignoreSingleMovieSets = false 
)

◆ GetSetsNav()

bool CVideoDatabase::GetSetsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  ignoreSingleMovieSets = false 
)

◆ GetSortedVideos()

bool CVideoDatabase::GetSortedVideos ( const MediaType mediaType,
const std::string &  strBaseDir,
const SortDescription sortDescription,
CFileItemList items,
const Filter filter = Filter() 
)

◆ GetSourcePath() [1/2]

bool CVideoDatabase::GetSourcePath ( const std::string &  path,
std::string &  sourcePath 
)

◆ GetSourcePath() [2/2]

bool CVideoDatabase::GetSourcePath ( const std::string &  path,
std::string &  sourcePath,
VIDEO::SScanSettings settings 
)

◆ GetStackTimes()

bool CVideoDatabase::GetStackTimes ( const std::string &  filePath,
std::vector< uint64_t > &  times 
)

GetStackTimes() obtains any saved video times for the stacked file.

Return values
Returnstrue if the stack times exist, false otherwise.

◆ GetStreamDetails() [1/2]

bool CVideoDatabase::GetStreamDetails ( CFileItem item)

◆ GetStreamDetails() [2/2]

bool CVideoDatabase::GetStreamDetails ( CVideoInfoTag tag) const

◆ GetStudioById()

std::string CVideoDatabase::GetStudioById ( int  id)

◆ GetStudiosNav()

bool CVideoDatabase::GetStudiosNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetSubPaths()

bool CVideoDatabase::GetSubPaths ( const std::string &  basepath,
std::vector< std::pair< int, std::string > > &  subpaths 
)

retrieve subpaths of a given path. Assumes a hierarchical folder structure

Parameters
basepaththe root path to retrieve subpaths for
subpathsthe returned subpaths
Returns
true if we successfully retrieve subpaths (may be zero), false on error

◆ GetTagById()

std::string CVideoDatabase::GetTagById ( int  id)

◆ GetTags()

void CVideoDatabase::GetTags ( int  media_id,
const std::string &  media_type,
std::vector< std::string > &  tags 
)
protected

◆ GetTagsNav()

bool CVideoDatabase::GetTagsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetTvShowForEpisode()

int CVideoDatabase::GetTvShowForEpisode ( int  idEpisode)

◆ GetTvShowGenresByName()

void CVideoDatabase::GetTvShowGenresByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetTvShowId()

int CVideoDatabase::GetTvShowId ( const std::string &  strPath)

◆ GetTvShowInfo()

bool CVideoDatabase::GetTvShowInfo ( const std::string &  strPath,
CVideoInfoTag details,
int  idTvShow = -1,
CFileItem item = NULL,
int  getDetails = VideoDbDetailsAll 
)

◆ GetTvShowNamedSeasons()

bool CVideoDatabase::GetTvShowNamedSeasons ( int  showId,
std::map< int, std::string > &  seasons 
)

◆ GetTvShowsActorsByName()

void CVideoDatabase::GetTvShowsActorsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetTvShowsByActor()

void CVideoDatabase::GetTvShowsByActor ( const std::string &  strActor,
CFileItemList items 
)

◆ GetTvShowsByName()

void CVideoDatabase::GetTvShowsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetTvShowsByWhere()

bool CVideoDatabase::GetTvShowsByWhere ( const std::string &  strBaseDir,
const Filter filter,
CFileItemList items,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetTvShowsDirectorsByName()

void CVideoDatabase::GetTvShowsDirectorsByName ( const std::string &  strSearch,
CFileItemList items 
)

◆ GetTvShowSeasonArt()

bool CVideoDatabase::GetTvShowSeasonArt ( int  mediaId,
std::map< int, std::map< std::string, std::string > > &  seasonArt 
)

◆ GetTvShowSeasons()

bool CVideoDatabase::GetTvShowSeasons ( int  showId,
std::map< int, int > &  seasons 
)

◆ GetTvShowsNav()

bool CVideoDatabase::GetTvShowsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idGenre = -1,
int  idYear = -1,
int  idActor = -1,
int  idDirector = -1,
int  idStudio = -1,
int  idTag = -1,
const SortDescription sortDescription = SortDescription(),
int  getDetails = VideoDbDetailsNone 
)

◆ GetTvShowTitleById()

std::string CVideoDatabase::GetTvShowTitleById ( int  id)

◆ GetUniqueIDs()

void CVideoDatabase::GetUniqueIDs ( int  media_id,
const std::string &  media_type,
CVideoInfoTag details 
)
protected

◆ GetUseAllExternalAudioForVideo()

bool CVideoDatabase::GetUseAllExternalAudioForVideo ( const std::string &  videoPath)

◆ GetValueString()

std::string CVideoDatabase::GetValueString ( const CVideoInfoTag details,
int  min,
int  max,
const SDbTableOffsets offsets 
) const
protected

◆ GetVideoSettings() [1/3]

bool CVideoDatabase::GetVideoSettings ( const CFileItem item,
CVideoSettings settings 
)

Get video settings for the specified file item.

Parameters
itemitem to get the settings for
Returns
true if video settings found, false otherwise
See also
SetVideoSettings

◆ GetVideoSettings() [2/3]

bool CVideoDatabase::GetVideoSettings ( const std::string &  filePath,
CVideoSettings settings 
)

Get video settings for the specified file path.

GetVideoSettings() obtains any saved video settings for the current file.

Parameters
filePathfilepath to get the settings for
Returns
true if video settings found, false otherwise
See also
SetVideoSettings
Return values
Returnstrue if the settings exist, false otherwise.

◆ GetVideoSettings() [3/3]

bool CVideoDatabase::GetVideoSettings ( int  idFile,
CVideoSettings settings 
)

Get video settings for the specified file id.

Parameters
idFilefile id to get the settings for
Returns
true if video settings found, false otherwise
See also
SetVideoSettings

◆ GetWritersNav()

bool CVideoDatabase::GetWritersNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter(),
bool  countOnly = false 
)

◆ GetYearsNav()

bool CVideoDatabase::GetYearsNav ( const std::string &  strBaseDir,
CFileItemList items,
int  idContent = -1,
const Filter filter = Filter() 
)

◆ HasArtForItem()

bool CVideoDatabase::HasArtForItem ( int  mediaId,
const MediaType mediaType 
)

◆ HasContent() [1/2]

bool CVideoDatabase::HasContent ( )

◆ HasContent() [2/2]

bool CVideoDatabase::HasContent ( VIDEODB_CONTENT_TYPE  type)

◆ HasEpisodeInfo()

bool CVideoDatabase::HasEpisodeInfo ( const std::string &  strFilenameAndPath)

◆ HasMovieInfo()

bool CVideoDatabase::HasMovieInfo ( const std::string &  strFilenameAndPath)

◆ HasMusicVideoInfo()

bool CVideoDatabase::HasMusicVideoInfo ( const std::string &  strFilenameAndPath)

◆ HasSets()

bool CVideoDatabase::HasSets ( ) const

◆ HasTvShowInfo()

bool CVideoDatabase::HasTvShowInfo ( const std::string &  strFilenameAndPath)

◆ ImportArtFromXML()

bool CVideoDatabase::ImportArtFromXML ( const TiXmlNode *  node,
std::map< std::string, std::string > &  artwork 
)

◆ ImportFromXML()

void CVideoDatabase::ImportFromXML ( const std::string &  path)

◆ IncrementPlayCount()

void CVideoDatabase::IncrementPlayCount ( const CFileItem item)

Increment the playcount of an item Increments the playcount and updates the last played date.

Parameters
itemCFileItem to increment the playcount for
See also
GetPlayCount, SetPlayCount, GetPlayCounts

◆ IsLinkedToTvshow()

bool CVideoDatabase::IsLinkedToTvshow ( int  idMovie)

◆ LinkMovieToTvshow()

bool CVideoDatabase::LinkMovieToTvshow ( int  idMovie,
int  idShow,
bool  bRemove 
)

◆ LoadVideoInfo()

bool CVideoDatabase::LoadVideoInfo ( const std::string &  strFilenameAndPath,
CVideoInfoTag details,
int  getDetails = VideoDbDetailsAll 
)

◆ Open()

bool CVideoDatabase::Open ( )
overridevirtual

Reimplemented from CDatabase.

◆ RemoveArtForItem() [1/2]

bool CVideoDatabase::RemoveArtForItem ( int  mediaId,
const MediaType mediaType,
const std::set< std::string > &  artTypes 
)

◆ RemoveArtForItem() [2/2]

bool CVideoDatabase::RemoveArtForItem ( int  mediaId,
const MediaType mediaType,
const std::string &  artType 
)

◆ RemoveContentForPath()

void CVideoDatabase::RemoveContentForPath ( const std::string &  strPath,
CGUIDialogProgress progress = NULL 
)

◆ RemoveFromLinkTable()

void CVideoDatabase::RemoveFromLinkTable ( int  mediaId,
const std::string &  mediaType,
const std::string &  table,
int  valueId,
const char *  foreignKey = NULL 
)
protected

◆ RemoveTagFromItem()

void CVideoDatabase::RemoveTagFromItem ( int  idItem,
int  idTag,
const std::string &  type 
)

◆ RemoveTagsFromItem()

void CVideoDatabase::RemoveTagsFromItem ( int  idItem,
const std::string &  type 
)

◆ ScraperInUse()

bool CVideoDatabase::ScraperInUse ( const std::string &  scraperID) const

Check whether a given scraper is in use.

Parameters
scraperIDthe scraper to check for.
Returns
true if the scraper is in use, false otherwise.

◆ SetArtForItem() [1/2]

void CVideoDatabase::SetArtForItem ( int  mediaId,
const MediaType mediaType,
const std::map< std::string, std::string > &  art 
)

◆ SetArtForItem() [2/2]

void CVideoDatabase::SetArtForItem ( int  mediaId,
const MediaType mediaType,
const std::string &  artType,
const std::string &  url 
)

◆ SetDetailsForEpisode()

int CVideoDatabase::SetDetailsForEpisode ( CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
int  idShow,
int  idEpisode = -1 
)

◆ SetDetailsForItem() [1/2]

int CVideoDatabase::SetDetailsForItem ( CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork 
)

◆ SetDetailsForItem() [2/2]

int CVideoDatabase::SetDetailsForItem ( int  id,
const MediaType mediaType,
CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork 
)

◆ SetDetailsForMovie()

int CVideoDatabase::SetDetailsForMovie ( CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
int  idMovie = -1 
)

◆ SetDetailsForMovieSet()

int CVideoDatabase::SetDetailsForMovieSet ( const CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
int  idSet = -1 
)

◆ SetDetailsForMusicVideo()

int CVideoDatabase::SetDetailsForMusicVideo ( CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
int  idMVideo = -1 
)

◆ SetDetailsForSeason()

int CVideoDatabase::SetDetailsForSeason ( const CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
int  idShow,
int  idSeason = -1 
)

◆ SetDetailsForTvShow()

int CVideoDatabase::SetDetailsForTvShow ( const std::vector< std::pair< std::string, std::string > > &  paths,
CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
const std::map< int, std::map< std::string, std::string > > &  seasonArt,
int  idTvShow = -1 
)

add a tvshow to the library, setting metadata detail First checks for whether this TV Show is already in the database (based on idTvShow, or via GetMatchingTvShow) and if present adds the paths to the show. If not present, we add a new show and set the show metadata.

Parameters
pathsa vector<string,string> list of the path(s) and parent path(s) for the show.
detailsa CVideoInfoTag filled with the metadata for the show.
artworkthe artwork map for the show.
seasonArtthe artwork map for seasons.
idTvShowthe database id of the tvshow if known (defaults to -1)
Returns
the id of the tvshow.

◆ SetMovieSet()

void CVideoDatabase::SetMovieSet ( int  idMovie,
int  idSet 
)

◆ SetPathHash()

bool CVideoDatabase::SetPathHash ( const std::string &  path,
const std::string &  hash 
)

◆ SetPlayCount()

void CVideoDatabase::SetPlayCount ( const CFileItem item,
int  count,
const CDateTime date = CDateTime() 
)

Set the playcount of an item Sets the playcount and last played date to a given value.

Parameters
itemCFileItem to set the playcount for
countThe playcount to set.
dateThe date the file was last viewed (does not denote the video was watched to completion). If empty we current datetime (if count > 0) or never viewed (if count = 0).
See also
GetPlayCount, IncrementPlayCount, UpdateLastPlayed

◆ SetScraperForPath()

void CVideoDatabase::SetScraperForPath ( const std::string &  filePath,
const ADDON::ScraperPtr info,
const VIDEO::SScanSettings settings 
)

◆ SetSingleValue() [1/3]

bool CVideoDatabase::SetSingleValue ( const std::string &  table,
const std::string &  fieldName,
const std::string &  strValue,
const std::string &  conditionName = "",
int  conditionValue = -1 
)

◆ SetSingleValue() [2/3]

bool CVideoDatabase::SetSingleValue ( VIDEODB_CONTENT_TYPE  type,
int  dbId,
Field  dbField,
const std::string &  strValue 
)

◆ SetSingleValue() [3/3]

bool CVideoDatabase::SetSingleValue ( VIDEODB_CONTENT_TYPE  type,
int  dbId,
int  dbField,
const std::string &  strValue 
)

◆ SetStackTimes()

void CVideoDatabase::SetStackTimes ( const std::string &  filePath,
const std::vector< uint64_t > &  times 
)

Sets the stack times for a particular video file.

◆ SetStreamDetailsForFile()

void CVideoDatabase::SetStreamDetailsForFile ( const CStreamDetails details,
const std::string &  strFileNameAndPath 
)

◆ SetStreamDetailsForFileId()

void CVideoDatabase::SetStreamDetailsForFileId ( const CStreamDetails details,
int  idFile 
)

◆ SetVideoSettings() [1/2]

void CVideoDatabase::SetVideoSettings ( const CFileItem item,
const CVideoSettings settings 
)

Set video settings for the specified file path.

Parameters
fileItemto set the settings for
See also
GetVideoSettings

◆ SetVideoSettings() [2/2]

void CVideoDatabase::SetVideoSettings ( int  idFile,
const CVideoSettings settings 
)

Set video settings for the specified file path.

Sets the settings for a particular video file.

Parameters
fileIdto set the settings for
See also
GetVideoSettings

◆ SetVideoUserRating()

bool CVideoDatabase::SetVideoUserRating ( int  dbId,
int  rating,
const MediaType mediaType 
)

◆ UpdateActorLinksToItem()

void CVideoDatabase::UpdateActorLinksToItem ( int  mediaId,
const std::string &  mediaType,
const std::string &  field,
const std::vector< std::string > &  values 
)
protected

◆ UpdateDetailsForMovie()

int CVideoDatabase::UpdateDetailsForMovie ( int  idMovie,
CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
const std::set< std::string > &  updatedDetails 
)

◆ UpdateDetailsForTvShow()

bool CVideoDatabase::UpdateDetailsForTvShow ( int  idTvShow,
CVideoInfoTag details,
const std::map< std::string, std::string > &  artwork,
const std::map< int, std::map< std::string, std::string > > &  seasonArt 
)

◆ UpdateFanart()

void CVideoDatabase::UpdateFanart ( const CFileItem item,
VIDEODB_CONTENT_TYPE  type 
)

◆ UpdateFileDateAdded()

void CVideoDatabase::UpdateFileDateAdded ( CVideoInfoTag details)

Updates the dateAdded field in the files table for the file with the given idFile and the given path based on the files modification date.

Parameters
detailsdetails of the video file

◆ UpdateLastPlayed()

void CVideoDatabase::UpdateLastPlayed ( const CFileItem item)

Update the last played time of an item Updates the last played date.

Parameters
itemCFileItem to update the last played time for
See also
GetPlayCount, SetPlayCount, IncrementPlayCount, GetPlayCounts

◆ UpdateLinksToItem()

void CVideoDatabase::UpdateLinksToItem ( int  mediaId,
const std::string &  mediaType,
const std::string &  field,
const std::vector< std::string > &  values 
)
protected

◆ UpdateMovieTitle()

void CVideoDatabase::UpdateMovieTitle ( int  idMovie,
const std::string &  strNewMovieTitle,
VIDEODB_CONTENT_TYPE  iType = VIDEODB_CONTENT_MOVIES 
)

◆ UpdateRatings()

int CVideoDatabase::UpdateRatings ( int  mediaId,
const char *  mediaType,
const RatingMap values,
const std::string &  defaultRating 
)
protected

◆ UpdateUniqueIDs()

int CVideoDatabase::UpdateUniqueIDs ( int  mediaId,
const char *  mediaType,
const CVideoInfoTag details 
)
protected

◆ UpdateVideoSortTitle()

bool CVideoDatabase::UpdateVideoSortTitle ( int  idDb,
const std::string &  strNewSortTitle,
VIDEODB_CONTENT_TYPE  iType = VIDEODB_CONTENT_MOVIES 
)

◆ VideoContentTypeToString()

static void CVideoDatabase::VideoContentTypeToString ( VIDEODB_CONTENT_TYPE  type,
std::string &  out 
)
inlinestatic

The documentation for this class was generated from the following files: