Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
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)
 
CDateTime SetPlayCount (const CFileItem &item, int count, const CDateTime &date=CDateTime())
 Set the playcount of an item, update last played time Sets the playcount and last played date to a given value.
 
CDateTime IncrementPlayCount (const CFileItem &item)
 Increment the playcount of an item Increments the playcount and updates the last played date.
 
int GetPlayCount (const CFileItem &item)
 Get the playcount of an item.
 
int GetPlayCount (const std::string &strFilenameAndPath)
 Get the playcount of a filename and path.
 
CDateTime GetLastPlayed (const std::string &strFilenameAndPath)
 Get the last played time of a filename and path.
 
CDateTime UpdateLastPlayed (const CFileItem &item)
 Update the last played time of an item Updates the last played date.
 
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.
 
void UpdateMovieTitle (int idMovie, const std::string &strNewMovieTitle, VideoDbContentType iType=VideoDbContentType::MOVIES)
 
bool UpdateVideoSortTitle (int idDb, const std::string &strNewSortTitle, VideoDbContentType iType=VideoDbContentType::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, VideoDbContentType 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 idVersion=-1, int getDetails=VideoDbDetailsAll)
 
bool GetTvShowInfo (const std::string &strPath, CVideoInfoTag &details, int idTvShow=-1, CFileItem *item=NULL, int getDetails=VideoDbDetailsAll)
 
bool GetSeasonInfo (const std::string &path, int season, CVideoInfoTag &details, CFileItem *item)
 
bool GetSeasonInfo (int idSeason, CVideoInfoTag &details, CFileItem *item)
 
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, CFileItem *item=nullptr)
 
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.
 
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)
 
bool SetFileForEpisode (const std::string &fileAndPath, int idEpisode, int idFile)
 
bool SetFileForMovie (const std::string &fileAndPath, int idMovie, int idFile)
 
int SetDetailsForMusicVideo (CVideoInfoTag &details, const std::map< std::string, std::string > &artwork, int idMVideo=-1)
 
int SetStreamDetailsForFile (const CStreamDetails &details, const std::string &strFileNameAndPath)
 
bool SetStreamDetailsForFileId (const CStreamDetails &details, int idFile)
 Clear any existing stream details and add the new provided details to a file.
 
bool SetSingleValue (VideoDbContentType type, int dbId, int dbField, const std::string &strValue)
 
bool SetSingleValue (VideoDbContentType 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)
 
bool DeleteMovie (int idMovie, DeleteMovieCascadeAction action=DeleteMovieCascadeAction::ALL_ASSETS, DeleteMovieHashAction hashAction=DeleteMovieHashAction::HASH_DELETE)
 Remove a movie from the library.
 
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, VideoDbContentType type)
 
void DeleteSet (int idSet)
 
void DeleteTag (int idTag, VideoDbContentType mediaType)
 
bool GetVideoSettings (int idFile, CVideoSettings &settings)
 Get video settings for the specified file id.
 
bool GetVideoSettings (const CFileItem &item, CVideoSettings &settings)
 Get video settings for the specified file item.
 
bool GetVideoSettings (const std::string &filePath, CVideoSettings &settings)
 Get video settings for the specified file path.
 
void SetVideoSettings (const CFileItem &item, const CVideoSettings &settings)
 Set video settings for the specified file path.
 
void SetVideoSettings (int idFile, const CVideoSettings &settings)
 Set video settings for the specified file path.
 
void EraseVideoSettings (const CFileItem &item)
 EraseVideoSettings() Erases the videoSettings table and reconstructs it.
 
void EraseAllVideoSettings ()
 
void EraseAllVideoSettings (const std::string &path)
 
void EraseAllForPath (const std::string &path)
 
void EraseAllForFile (const std::string &fileNameAndPath)
 
bool GetStackTimes (const std::string &filePath, std::vector< uint64_t > &times)
 GetStackTimes() obtains any saved video times for the stacked file.
 
void SetStackTimes (const std::string &filePath, const std::vector< uint64_t > &times)
 Sets the stack times for a particular video file.
 
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, const 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)
 
bool GetStreamDetails (const std::string &filenameAndPath, CStreamDetails &details)
 
bool GetDetailsByTypeAndId (CFileItem &item, VideoDbContentType type, int id)
 
CVideoInfoTag GetDetailsByTypeAndId (VideoDbContentType type, int id)
 
void SetScraperForPath (const std::string &filePath, const ADDON::ScraperPtr &info, const KODI::VIDEO::SScanSettings &settings)
 
ADDON::ScraperPtr GetScraperForPath (const std::string &strPath)
 
ADDON::ScraperPtr GetScraperForPath (const std::string &strPath, KODI::VIDEO::SScanSettings &settings)
 
ADDON::ScraperPtr GetScraperForPath (const std::string &strPath, KODI::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.
 
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.
 
bool GetItemsForPath (const std::string &content, const std::string &path, CFileItemList &items)
 Get videos of the given content type from the given path.
 
bool ScraperInUse (const std::string &scraperID) const
 Check whether a given scraper is in use.
 
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.
 
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
 
bool GetSourcePath (const std::string &path, std::string &sourcePath)
 
bool GetSourcePath (const std::string &path, std::string &sourcePath, KODI::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, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetCountriesNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetStudiosNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetYearsNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter())
 
bool GetActorsNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetDirectorsNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetWritersNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetSetsNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool ignoreSingleMovieSets=false)
 
bool GetTagsNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, 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 (VideoDbContentType 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.
 
int AddFile (const CFileItem &item)
 Add a file to the database, if necessary Works for both videodb:// items and normal fileitems.
 
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.
 
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.
 
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.
 
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, VideoDbContentType 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.
 
bool SetArtForItem (int mediaId, const MediaType &mediaType, const std::string &artType, const std::string &url)
 
bool 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)
 
void UpdateArtForItem (int mediaId, const MediaType &mediaType)
 
bool GetArtForAsset (int assetId, ArtFallbackOptions fallback, std::map< std::string, std::string > &art)
 Retrieve all art for the given video asset, with optional fallback to the art of the parent/owner of the asset.
 
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)
 
std::string GetTvShowNamedSeasonById (int tvshowId, int seasonId)
 Get the custom named season.
 
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.
 
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.
 
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.
 
int AddSet (const std::string &strSet, const std::string &strOverview="", const bool updateOverview=true)
 
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)
 
std::string GetSetByNameLike (const std::string &nameLike) const
 
std::string GetVideoItemTitle (VideoDbContentType itemType, int dbId)
 
std::string GetVideoVersionById (int id)
 
void GetVideoVersions (VideoDbContentType itemType, int dbId, CFileItemList &items, VideoAssetType videoAssetType)
 
void GetDefaultVideoVersion (VideoDbContentType itemType, int dbId, CFileItem &item)
 
bool ConvertVideoToVersion (VideoDbContentType itemType, int dbIdSource, int dbIdTarget, int idVideoVersion, VideoAssetType assetType)
 Remove a video from the library and transfer all of its assets to another video of the same type.
 
void SetDefaultVideoVersion (VideoDbContentType itemType, int dbId, int idFile)
 
void SetVideoVersion (int idFile, int idVideoVersion)
 
int AddVideoVersionType (const std::string &typeVideoVersion, VideoAssetTypeOwner owner, VideoAssetType assetType)
 
bool AddVideoAsset (VideoDbContentType itemType, int dbId, int idVideoAsset, VideoAssetType videoAssetType, CFileItem &item)
 Create a new video asset from the provided item and type and attach it to an owner A file record is created for items with a path new to the database.
 
bool DeleteVideoAsset (int idFile)
 
bool IsDefaultVideoVersion (int idFile)
 
bool GetVideoVersionTypes (VideoDbContentType idContent, VideoAssetType asset, CFileItemList &items)
 
bool SetVideoVersionDefaultArt (int dbId, int idFrom, VideoDbContentType type)
 
void InitializeVideoVersionTypeTable (int schemaVersion)
 
void UpdateVideoVersionTypeTable ()
 
bool GetVideoVersionsNav (const std::string &strBaseDir, CFileItemList &items, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter())
 
VideoAssetInfo GetVideoVersionInfo (const std::string &filenameAndPath)
 
bool GetAssetsForVideo (VideoDbContentType itemType, int mediaId, VideoAssetType assetType, CFileItemList &items)
 
bool GetDefaultVersionForVideo (VideoDbContentType itemType, int mediaId, CFileItem &item)
 
bool UpdateAssetsOwner (const std::string &mediaType, int dbIdSource, int dbIdTarget)
 
int GetMovieId (const std::string &strFilenameAndPath)
 
std::string GetMovieTitle (int idMovie)
 
void GetSameVideoItems (const CFileItem &item, CFileItemList &items)
 
int GetFileIdByMovie (int idMovie)
 
std::string GetFileBasePathById (int idFile)
 
std::vector< std::string > GetUsedImages (const std::vector< std::string > &imagesToCheck)
 Check the passed in list of images if used in this database. Used to clean the image cache.
 
- 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()) const
 Get a single value from a table.
 
std::string GetSingleValue (const std::string &query) const
 
std::string GetSingleValue (const std::string &query, const std::unique_ptr< dbiplus::Dataset > &ds) const
 Get a single value from a query on a dataset.
 
int GetSingleValueInt (const std::string &strTable, const std::string &strColumn, const std::string &strWhereClause=std::string(), const std::string &strOrderBy=std::string()) const
 Get a single integer value from a table.
 
int GetSingleValueInt (const std::string &query) const
 
int GetSingleValueInt (const std::string &query, const std::unique_ptr< dbiplus::Dataset > &ds) const
 Get a single integer value from a query on a dataset.
 
bool DeleteValues (const std::string &strTable, const Filter &filter=Filter())
 Delete values from a table.
 
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.
 
bool ResultQuery (const std::string &strQuery) const
 Execute a query that returns a result.
 
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!
 
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.
 
bool QueueInsertQuery (const std::string &strQuery)
 Put an INSERT or REPLACE query in the queue.
 
bool CommitInsertQueries ()
 Commit all queries in the queue.
 
size_t GetInsertQueriesCount ()
 Get the number of INSERT queries in the queue.
 
bool QueueDeleteQuery (const std::string &strQuery)
 Put a DELETE query in the queue.
 
bool CommitDeleteQueries ()
 Commit all queued DELETE queries.
 
size_t GetDeleteQueriesCount ()
 Get the number of DELETE queries in the queue.
 
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 (VideoDbContentType type, std::string &out)
 

Protected Member Functions

int AddNewMovie (CVideoInfoTag &details)
 
int AddNewMusicVideo (CVideoInfoTag &details)
 
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.
 
int GetFileId (const CVideoInfoTag &details)
 
int GetAndFillFileId (CVideoInfoTag &details)
 Get the id of the file of this item and store it in the item.
 
int GetFileId (const std::string &url)
 Get the id of a file from path.
 
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.
 
int GetMatchingTvShow (const CVideoInfoTag &show)
 Check whether a show is already in the library. Matches on unique identifier or matching title and premiered date.
 
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, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, const Filter &filter=Filter(), bool countOnly=false)
 
bool GetNavCommon (const std::string &strBaseDir, CFileItemList &items, const char *type, VideoDbContentType idContent=VideoDbContentType::UNKNOWN, 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.
 
int GetDBVersion ()
 
bool BuildSQL (const std::string &strQuery, const Filter &filter, std::string &strSQL) const
 

Additional Inherited Members

- Protected Attributes inherited from CDatabase
bool m_sqlite
 whether we use sqlite (defaults to true)
 
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 = "",
const bool updateOverview = true )

◆ 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

◆ AddVideoAsset()

bool CVideoDatabase::AddVideoAsset ( VideoDbContentType itemType,
int dbId,
int idVideoAsset,
VideoAssetType videoAssetType,
CFileItem & item )

Create a new video asset from the provided item and type and attach it to an owner A file record is created for items with a path new to the database.

Parameters
[in]itemTypeParent's type
[in]dbIdParent's id
[in]idVideoAssetVideo asset identifier / name
[in]videoAssetTypeType of the video asset
[in]itemItem to be made into a video asset
Returns
Success status. true:success, false:failure

◆ AddVideoVersionType()

int CVideoDatabase::AddVideoVersionType ( const std::string & typeVideoVersion,
VideoAssetTypeOwner owner,
VideoAssetType assetType )

◆ 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,
const 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.

◆ ConvertVideoToVersion()

bool CVideoDatabase::ConvertVideoToVersion ( VideoDbContentType itemType,
int dbIdSource,
int dbIdTarget,
int idVideoVersion,
VideoAssetType assetType )

Remove a video from the library and transfer all of its assets to another video of the same type.

Parameters
itemTypeType of the video being converted
dbIdSourceid of the video being converted
dbIdTargetid that the video will be attached to
idVideoVersionnew versiontype of the default version of the video
assetTypenew asset type of the default version of the video
Returns
true for success, false otherwise

◆ 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()

Remove a movie from the library.

Parameters
[in]idMovieThe id of the movie
[in]actionVersions of the movie to be deleted
[in]hashActionPreserve or invalidate the hash of the movie path
Returns
operation success. true for success, false for failure
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,
VideoDbContentType 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

◆ DeleteVideoAsset()

bool CVideoDatabase::DeleteVideoAsset ( int idFile)

◆ DumpToDummyFiles()

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

◆ EraseAllForFile()

void CVideoDatabase::EraseAllForFile ( const std::string & fileNameAndPath)

Erases all entries for the given file, including path entry if no longer used

Parameters
fileNameAndPathThe name and path of the file to erase db entries for

◆ 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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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.

◆ GetArtForAsset()

bool CVideoDatabase::GetArtForAsset ( int assetId,
ArtFallbackOptions fallback,
std::map< std::string, std::string > & art )

Retrieve all art for the given video asset, with optional fallback to the art of the parent/owner of the asset.

Parameters
assetIdid of the file of the asset
fallbackoptionally request fallback to the art of the parent/owner for each art type that is not defined for the asset
artcollection of the retrieved art
Returns

◆ 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 )

◆ GetAssetsForVideo()

bool CVideoDatabase::GetAssetsForVideo ( VideoDbContentType itemType,
int mediaId,
VideoAssetType assetType,
CFileItemList & items )
Todo
add bool return type to GetVideoVersions

◆ 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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
const Filter & filter = Filter(),
bool countOnly = false )

◆ GetCountryById()

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

◆ GetDefaultVersionForVideo()

bool CVideoDatabase::GetDefaultVersionForVideo ( VideoDbContentType itemType,
int mediaId,
CFileItem & item )

◆ GetDefaultVideoVersion()

void CVideoDatabase::GetDefaultVideoVersion ( VideoDbContentType itemType,
int dbId,
CFileItem & item )

◆ GetDetailsByTypeAndId() [1/2]

bool CVideoDatabase::GetDetailsByTypeAndId ( CFileItem & item,
VideoDbContentType type,
int id )

◆ GetDetailsByTypeAndId() [2/2]

CVideoInfoTag CVideoDatabase::GetDetailsByTypeAndId ( VideoDbContentType 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
Todo
videotag member + guiinfo int needed? – Currently not needed; having it available as item prop seems sufficient for skinning

◆ 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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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 )

◆ GetFileBasePathById()

std::string CVideoDatabase::GetFileBasePathById ( int idFile)

◆ 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.

◆ GetFileIdByMovie()

int CVideoDatabase::GetFileIdByMovie ( int idMovie)

◆ GetFileInfo()

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

◆ GetFilePathById()

void CVideoDatabase::GetFilePathById ( int idMovie,
std::string & filePath,
VideoDbContentType 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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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,
VideoDbContentType 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.

◆ GetLastPlayed()

CDateTime CVideoDatabase::GetLastPlayed ( const std::string & strFilenameAndPath)

Get the last played time of a filename and path.

Parameters
strFilenameAndPathfilename and path to get the last played time for
Returns
the last played time of the item, or an invalid CDateTime on error
See also
UpdateLastPlayed

◆ 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)

◆ GetMovieInfo()

bool CVideoDatabase::GetMovieInfo ( const std::string & strFilenameAndPath,
CVideoInfoTag & details,
int idMovie = -1,
int idVersion = -1,
int getDetails = VideoDbDetailsAll )
Todo
get rid of "videos with versions as folder" hack!

◆ 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 )
Todo
get rid of "videos with versions as folder" hack!

◆ 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 )

◆ GetMovieTitle()

std::string CVideoDatabase::GetMovieTitle ( int idMovie)

◆ 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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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)

◆ GetSameVideoItems()

void CVideoDatabase::GetSameVideoItems ( const CFileItem & item,
CFileItemList & items )

◆ GetScraperForPath() [1/3]

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

◆ GetScraperForPath() [2/3]

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

◆ GetScraperForPath() [3/3]

ScraperPtr CVideoDatabase::GetScraperForPath ( const std::string & strPath,
KODI::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() [1/3]

bool CVideoDatabase::GetSeasonInfo ( const std::string & path,
int season,
CVideoInfoTag & details,
CFileItem * item )

◆ GetSeasonInfo() [2/3]

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

◆ GetSeasonInfo() [3/3]

bool CVideoDatabase::GetSeasonInfo ( int idSeason,
CVideoInfoTag & details,
CFileItem * item )

◆ 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)

◆ GetSetByNameLike()

std::string CVideoDatabase::GetSetByNameLike ( const std::string & nameLike) const

◆ GetSetInfo()

bool CVideoDatabase::GetSetInfo ( int idSet,
CVideoInfoTag & details,
CFileItem * item = nullptr )

◆ 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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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,
KODI::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/3]

bool CVideoDatabase::GetStreamDetails ( CFileItem & item)

◆ GetStreamDetails() [2/3]

bool CVideoDatabase::GetStreamDetails ( const std::string & filenameAndPath,
CStreamDetails & details )

◆ GetStreamDetails() [3/3]

bool CVideoDatabase::GetStreamDetails ( CVideoInfoTag & tag)

◆ GetStudioById()

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

◆ GetStudiosNav()

bool CVideoDatabase::GetStudiosNav ( const std::string & strBaseDir,
CFileItemList & items,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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 )

◆ GetTvShowNamedSeasonById()

std::string CVideoDatabase::GetTvShowNamedSeasonById ( int tvshowId,
int seasonId )

Get the custom named season.

Parameters
tvshowIdThe tv show id relative to the season.
seasonIdThe season id for which to search the named title.
Returns
The named title if found, otherwise empty.

◆ 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)

◆ GetUsedImages()

std::vector< std::string > CVideoDatabase::GetUsedImages ( const std::vector< std::string > & imagesToCheck)

Check the passed in list of images if used in this database. Used to clean the image cache.

Parameters
imagesToCheck
Returns
a list of the passed in images used by this database.

◆ GetValueString()

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

◆ GetVideoItemTitle()

std::string CVideoDatabase::GetVideoItemTitle ( VideoDbContentType itemType,
int dbId )

◆ 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

◆ GetVideoVersionById()

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

◆ GetVideoVersionInfo()

VideoAssetInfo CVideoDatabase::GetVideoVersionInfo ( const std::string & filenameAndPath)

◆ GetVideoVersions()

void CVideoDatabase::GetVideoVersions ( VideoDbContentType itemType,
int dbId,
CFileItemList & items,
VideoAssetType videoAssetType )

◆ GetVideoVersionsNav()

bool CVideoDatabase::GetVideoVersionsNav ( const std::string & strBaseDir,
CFileItemList & items,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
const Filter & filter = Filter() )

◆ GetVideoVersionTypes()

bool CVideoDatabase::GetVideoVersionTypes ( VideoDbContentType idContent,
VideoAssetType asset,
CFileItemList & items )

◆ GetWritersNav()

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

◆ GetYearsNav()

bool CVideoDatabase::GetYearsNav ( const std::string & strBaseDir,
CFileItemList & items,
VideoDbContentType idContent = VideoDbContentType::UNKNOWN,
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 ( VideoDbContentType 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()

CDateTime 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
Returns
on success, the new last played time set, invalid datetime otherwise.
See also
GetPlayCount, SetPlayCount, GetPlayCounts

◆ InitializeVideoVersionTypeTable()

void CVideoDatabase::InitializeVideoVersionTypeTable ( int schemaVersion)

◆ IsDefaultVideoVersion()

bool CVideoDatabase::IsDefaultVideoVersion ( int idFile)

◆ 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]

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

◆ SetArtForItem() [2/2]

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

◆ SetDefaultVideoVersion()

void CVideoDatabase::SetDefaultVideoVersion ( VideoDbContentType itemType,
int dbId,
int idFile )

◆ 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.

◆ SetFileForEpisode()

bool CVideoDatabase::SetFileForEpisode ( const std::string & fileAndPath,
int idEpisode,
int idFile )

◆ SetFileForMovie()

bool CVideoDatabase::SetFileForMovie ( const std::string & fileAndPath,
int idMovie,
int idFile )

◆ SetMovieSet()

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

◆ SetPathHash()

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

◆ SetPlayCount()

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

Set the playcount of an item, update last played time 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 use current datetime (if count > 0) or never viewed (if count = 0).
Returns
on success, the new last played time set, invalid datetime otherwise.
See also
GetPlayCount, IncrementPlayCount, UpdateLastPlayed

◆ SetScraperForPath()

void CVideoDatabase::SetScraperForPath ( const std::string & filePath,
const ADDON::ScraperPtr & info,
const KODI::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 ( VideoDbContentType type,
int dbId,
Field dbField,
const std::string & strValue )

◆ SetSingleValue() [3/3]

bool CVideoDatabase::SetSingleValue ( VideoDbContentType 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()

int CVideoDatabase::SetStreamDetailsForFile ( const CStreamDetails & details,
const std::string & strFileNameAndPath )
Todo
ugly error return mechanism, fixme

◆ SetStreamDetailsForFileId()

bool CVideoDatabase::SetStreamDetailsForFileId ( const CStreamDetails & details,
int idFile )

Clear any existing stream details and add the new provided details to a file.

Parameters
[in]detailsNew stream details
[in]idFileIdentifier of the file
Returns
operation success. true for success, false for failure

◆ 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 )

◆ SetVideoVersion()

void CVideoDatabase::SetVideoVersion ( int idFile,
int idVideoVersion )

◆ SetVideoVersionDefaultArt()

bool CVideoDatabase::SetVideoVersionDefaultArt ( int dbId,
int idFrom,
VideoDbContentType type )

◆ UpdateActorLinksToItem()

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

◆ UpdateArtForItem()

void CVideoDatabase::UpdateArtForItem ( int mediaId,
const MediaType & mediaType )

◆ UpdateAssetsOwner()

bool CVideoDatabase::UpdateAssetsOwner ( const std::string & mediaType,
int dbIdSource,
int dbIdTarget )

◆ 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,
VideoDbContentType 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()

CDateTime 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
Returns
on success, the last played time set, invalid datetime otherwise.
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,
VideoDbContentType iType = VideoDbContentType::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,
VideoDbContentType iType = VideoDbContentType::MOVIES )

◆ UpdateVideoVersionTypeTable()

void CVideoDatabase::UpdateVideoVersionTypeTable ( )

◆ VideoContentTypeToString()

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

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