|
Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
|
Class to store and read tag information. More...
#include <MusicDatabase.h>
Public Member Functions | |
| CMusicDatabase () | |
| ~CMusicDatabase () override | |
| bool | Open () override |
| bool | CommitTransaction () override |
| void | EmptyCache () |
| void | Clean () const |
| int | Cleanup (CGUIDialogProgress *progressDialog=nullptr) |
| bool | LookupCDDBInfo (bool bRequery=false) const |
| void | DeleteCDDBInfo () const |
| int | AddSong (const int idSong, const CDateTime &dtDateNew, const int idAlbum, const std::string &strTitle, const std::string &strMusicBrainzTrackID, const std::string &strPathAndFileName, const std::string &strComment, const std::string &strMood, const std::string &strThumb, const std::string &artistDisp, const std::string &artistSort, const std::vector< std::string > &genres, int iTrack, int iDuration, const std::string &strReleaseDate, const std::string &strOrigReleaseDate, std::string &strDiscSubtitle, const int iTimesPlayed, int iStartOffset, int iEndOffset, const CDateTime &dtLastPlayed, float rating, int userrating, int votes, int iBPM, int iBitRate, int iSampleRate, int iChannels, const std::string &songVideoURL, const ReplayGain &replayGain) |
| Add a song to the database. | |
| bool | GetSong (int idSong, CSong &song) |
| bool | UpdateSong (CSong &song, bool bArtists=true, bool bArtistLinks=true) |
| Update a song and all its nested entities (genres, artists, contributors) | |
| int | UpdateSong (int idSong, const std::string &strTitle, const std::string &strMusicBrainzTrackID, const std::string &strPathAndFileName, const std::string &strComment, const std::string &strMood, const std::string &strThumb, const std::string &artistDisp, const std::string &artistSort, const std::vector< std::string > &genres, int iTrack, int iDuration, const std::string &strReleaseDate, const std::string &strOrigReleaseDate, const std::string &strDiscSubtitle, int iTimesPlayed, int iStartOffset, int iEndOffset, const CDateTime &dtLastPlayed, float rating, int userrating, int votes, const ReplayGain &replayGain, int iBPM, int iBitRate, int iSampleRate, int iChannels, const std::string &songVideoURL) |
| Update a song in the database. | |
| bool | GetSongByFileName (const std::string &strFileName, CSong &song, int64_t startOffset=0) |
| bool | GetSongsByPath (const std::string &strPath, std::map< std::string, std::vector< CSong > > &songmap, bool bAppendToMap=false) |
| bool | Search (const std::string &search, CFileItemList &items) |
| bool | RemoveSongsFromPath (const std::string &path, std::map< std::string, std::vector< CSong > > &songmap, bool exact=true) |
| void | CheckArtistLinksChanged () |
| bool | SetSongUserrating (const std::string &filePath, int userrating) |
| bool | SetSongUserrating (int idSong, int userrating) |
| bool | SetSongVotes (const std::string &filePath, int votes) |
| int | GetSongByArtistAndAlbumAndTitle (const std::string &strArtist, const std::string &strAlbum, const std::string &strTitle) |
| bool | AddAlbum (CAlbum &album, int idSource) |
| Add an album and all its songs to the database. | |
| bool | UpdateAlbum (CAlbum &album) |
| Update an album and all its nested entities (artists, songs etc) | |
| int | AddAlbum (const std::string &strAlbum, const std::string &strMusicBrainzAlbumID, const std::string &strReleaseGroupMBID, const std::string &strArtist, const std::string &strArtistSort, const std::string &strGenre, const std::string &strReleaseDate, const std::string &strOrigReleaseDate, bool bBoxedSet, const std::string &strRecordLabel, const std::string &strType, const std::string &strReleaseStatus, bool bCompilation, AudioType::Type releaseType) |
| Add an album to the database. | |
| bool | GetAlbum (int idAlbum, CAlbum &album, bool getSongs=true) |
| retrieve an album, optionally with all songs. | |
| int | UpdateAlbum (int idAlbum, const std::string &strAlbum, const std::string &strMusicBrainzAlbumID, const std::string &strReleaseGroupMBID, const std::string &strArtist, const std::string &strArtistSort, const std::string &strGenre, const std::string &strMoods, const std::string &strStyles, const std::string &strThemes, const std::string &strReview, const std::string &strImage, const std::string &strLabel, const std::string &strType, const std::string &strReleaseStatus, float fRating, int iUserrating, int iVotes, const std::string &strReleaseDate, const std::string &strOrigReleaseDate, bool bBoxedSet, bool bCompilation, AudioType::Type releaseType, bool bScrapedMBID) |
| bool | ClearAlbumLastScrapedTime (int idAlbum) |
| bool | HasAlbumBeenScraped (int idAlbum) const |
| bool | AddAudioBook (const CFileItem &item) |
| bool | SetResumeBookmarkForAudioBook (const CFileItem &item, int bookmark) |
| bool | GetResumeBookmarkForAudioBook (const CFileItem &item, int &bookmark) |
| bool | InsideScannedPath (const std::string &path) const |
| Checks if the given path is inside a folder that has already been scanned into the library. | |
| int | GetAlbumIdByPath (const std::string &path) |
| bool | GetAlbumFromSong (int idSong, CAlbum &album) |
| int | GetAlbumByName (const std::string &strAlbum, const std::string &strArtist="") |
| int | GetAlbumByName (const std::string &strAlbum, const std::vector< std::string > &artist) |
| bool | GetMatchingMusicVideoAlbum (const std::string &strAlbum, const std::string &strArtist, int &idAlbum, std::string &strReview) |
| bool | SearchAlbumsByArtistName (const std::string &strArtist, CFileItemList &items) |
| int | GetAlbumByMatch (const CAlbum &album) |
| std::string | GetAlbumById (int id) const |
| std::string | GetAlbumDiscTitle (int idAlbum, int idDisc) const |
| bool | SetAlbumUserrating (const int idAlbum, int userrating) |
| int | GetAlbumDiscsCount (int idAlbum) const |
| bool | UpdateArtist (const CArtist &artist) |
| int | AddArtist (const std::string &strArtist, const std::string &strMusicBrainzArtistID, const std::string &strSortName, bool bScrapedMBID=false) |
| int | AddArtist (const std::string &strArtist, const std::string &strMusicBrainzArtistID, bool bScrapedMBID=false) |
| bool | GetArtist (int idArtist, CArtist &artist, bool fetchAll=false) |
| bool | GetArtistExists (int idArtist) |
| int | GetLastArtist () const |
| int | GetArtistFromMBID (const std::string &strMusicBrainzArtistID, std::string &artistname) |
| int | UpdateArtist (int idArtist, const std::string &strArtist, const std::string &strSortName, const std::string &strMusicBrainzArtistID, bool bScrapedMBID, const std::string &strType, const std::string &strGender, const std::string &strDisambiguation, const std::string &strBorn, const std::string &strFormed, const std::string &strGenres, const std::string &strMoods, const std::string &strStyles, const std::string &strInstruments, const std::string &strBiography, const std::string &strDied, const std::string &strDisbanded, const std::string &strYearsActive, const std::string &strImage) |
| bool | UpdateArtistScrapedMBID (int idArtist, const std::string &strMusicBrainzArtistID) |
| bool | GetTranslateBlankArtist () const |
| void | SetTranslateBlankArtist (bool translate) |
| bool | HasArtistBeenScraped (int idArtist) const |
| bool | ClearArtistLastScrapedTime (int idArtist) |
| int | AddArtistDiscography (int idArtist, const CDiscoAlbum &discoAlbum) |
| bool | DeleteArtistDiscography (int idArtist) |
| bool | GetArtistDiscography (int idArtist, CFileItemList &items) |
| bool | AddArtistVideoLinks (const CArtist &artist) |
| bool | DeleteArtistVideoLinks (const int idArtist) |
| std::string | GetArtistById (int id) const |
| int | GetArtistByName (const std::string &strArtist) |
| int | GetArtistByMatch (const CArtist &artist) |
| bool | GetArtistFromSong (int idSong, CArtist &artist) |
| bool | IsSongArtist (int idSong, int idArtist) const |
| bool | IsSongAlbumArtist (int idSong, int idArtist) const |
| std::string | GetRoleById (int id) const |
| bool | UpdateArtistSortNames (int idArtist=-1) |
| Propagate artist sort name into the concatenated artist sort name strings held for songs and albums. | |
| int | AddPath (const std::string &strPath) |
| bool | GetPaths (std::set< std::string, std::less<> > &paths) |
| bool | SetPathHash (const std::string &path, const std::string &hash) |
| bool | GetPathHash (const std::string &path, std::string &hash) |
| bool | GetAlbumPaths (int idAlbum, std::vector< std::pair< std::string, int > > &paths) |
| bool | GetAlbumPath (int idAlbum, std::string &basePath) |
| int | GetDiscnumberForPathID (int idPath) |
| bool | GetOldArtistPath (int idArtist, std::string &path) |
| bool | GetArtistPath (const CArtist &artist, std::string &path) |
| bool | GetAlbumFolder (const CAlbum &album, const std::string &strAlbumPath, std::string &strFolder) |
| bool | GetArtistFolderName (const CArtist &artist, std::string &strFolder) |
| bool | GetArtistFolderName (const std::string &strArtist, const std::string &strMusicBrainzArtistID, std::string &strFolder) |
| bool | UpdateSources () |
| int | AddSource (const std::string &strName, const std::string &strMultipath, const std::vector< std::string > &vecPaths, int id=-1) |
| int | UpdateSource (const std::string &strOldName, const std::string &strName, const std::string &strMultipath, const std::vector< std::string > &vecPaths) |
| bool | RemoveSource (const std::string &strName) |
| int | GetSourceFromPath (const std::string &strPath) |
| bool | AddAlbumSource (int idAlbum, int idSource) |
| bool | AddAlbumSources (int idAlbum, const std::string &strPath) |
| bool | DeleteAlbumSources (int idAlbum) |
| bool | GetSources (CFileItemList &items) |
| bool | GetSourcesByArtist (int idArtist, CFileItem *item) |
| bool | GetSourcesByAlbum (int idAlbum, CFileItem *item) |
| bool | GetSourcesBySong (int idSong, const std::string &strPath, CFileItem *item) |
| int | GetSourceByName (const std::string &strSource) |
| std::string | GetSourceById (int id) const |
| int | AddGenre (std::string &strGenre) |
| std::string | GetGenreById (int id) const |
| int | GetGenreByName (const std::string &strGenre) |
| bool | AddAlbumArtist (int idArtist, int idAlbum, std::string_view strArtist, int iOrder) |
| bool | GetAlbumsByArtist (int idArtist, std::vector< int > &albums) |
| bool | GetArtistsByAlbum (int idAlbum, CFileItem *item) |
| bool | GetArtistsByAlbum (int idAlbum, std::vector< std::string > &artistIDs) |
| bool | DeleteAlbumArtistsByAlbum (int idAlbum) |
| int | AddRole (std::string_view strRole) |
| bool | AddSongArtist (int idArtist, int idSong, std::string_view strRole, std::string_view strArtist, int iOrder) |
| bool | AddSongArtist (int idArtist, int idSong, int idRole, std::string_view strArtist, int iOrder) |
| int | AddSongContributor (int idSong, const std::string &strRole, const std::string &strArtist, const std::string &strSort) |
| void | AddSongContributors (int idSong, const std::vector< CMusicRole > &contributors, const std::string &strSort) |
| int | GetRoleByName (const std::string &strRole) |
| bool | GetRolesByArtist (int idArtist, CFileItem *item) |
| bool | GetSongsByArtist (int idArtist, std::vector< int > &songs) |
| bool | GetArtistsBySong (int idSong, std::vector< int > &artists) |
| bool | DeleteSongArtistsBySong (int idSong) |
| bool | AddSongGenres (int idSong, const std::vector< std::string > &genres) |
| bool | GetGenresBySong (int idSong, std::vector< int > &genres) |
| bool | GetGenresByAlbum (int idAlbum, CFileItem *item) |
| bool | GetGenresByArtist (int idArtist, CFileItem *item) |
| bool | GetIsAlbumArtist (int idArtist, CFileItem *item) const |
| bool | GetTop100 (const std::string &strBaseDir, CFileItemList &items) |
| bool | GetTop100Albums (std::vector< CAlbum > &albums) |
| bool | GetTop100AlbumSongs (const std::string &strBaseDir, CFileItemList &item) |
| bool | GetRecentlyAddedAlbums (std::vector< CAlbum > &albums, unsigned int limit=0) |
| bool | GetRecentlyAddedAlbumSongs (const std::string &strBaseDir, CFileItemList &item, unsigned int limit=0) |
| bool | GetRecentlyPlayedAlbums (std::vector< CAlbum > &albums) |
| bool | GetRecentlyPlayedAlbumSongs (const std::string &strBaseDir, CFileItemList &item) |
| int | GetCompilationAlbumsCount () const |
| bool | IsAlbumBoxset (int idAlbum) const |
| int | GetBoxsetsCount () const |
| int | GetSinglesCount () |
| int | GetArtistCountForRole (int role) const |
| int | GetArtistCountForRole (const std::string &strRole) const |
| void | IncrementPlayCount (const CFileItem &item) |
| Increment the playcount of an item Increments the playcount and updates the last played date. | |
| bool | CleanupOrphanedItems () |
| bool | GetGenresNav (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetSourcesNav (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetYearsNav (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter()) |
| bool | GetRolesNav (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter()) |
| bool | GetArtistsNav (const std::string &strBaseDir, CFileItemList &items, const SortDescription &sortDescription, bool albumArtistsOnly=false, int idGenre=-1, int idAlbum=-1, int idSong=-1, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetCommonNav (const std::string &strBaseDir, const std::string &table, const std::string &labelField, CFileItemList &items, const Filter &filter, bool countOnly) |
| bool | GetAlbumTypesNav (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetMusicLabelsNav (const std::string &strBaseDir, CFileItemList &items, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetAlbumsNav (const std::string &strBaseDir, CFileItemList &items, const SortDescription &sortDescription, int idGenre=-1, int idArtist=-1, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetDiscsNav (const std::string &strBaseDir, CFileItemList &items, const SortDescription &sortDescription, int idAlbum, const Filter &filter=Filter(), bool countOnly=false) |
| bool | GetAlbumsByYear (const std::string &strBaseDir, CFileItemList &items, int year) |
| bool | GetSongsNav (const std::string &strBaseDir, CFileItemList &items, const SortDescription &sortDescription, int idGenre, int idArtist, int idAlbum) |
| bool | GetSongsByYear (const std::string &baseDir, CFileItemList &items, int year) |
| bool | GetSongsFullByWhere (const std::string &baseDir, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter, bool artistData=false) |
| bool | GetAlbumsByWhere (const std::string &baseDir, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter, bool countOnly=false) |
| bool | GetDiscsByWhere (const std::string &baseDir, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter, bool countOnly=false) |
| bool | GetDiscsByWhere (CMusicDbUrl &musicUrl, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter, bool countOnly=false) |
| bool | GetArtistsByWhere (const std::string &strBaseDir, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter, bool countOnly=false) |
| int | GetDiscsCount (const std::string &baseDir, const Filter &filter=Filter()) |
| int | GetSongsCount (const Filter &filter=Filter()) |
| bool | GetFilter (CDbUrl &musicUrl, Filter &filter, SortDescription &sorting) override |
| int | GetOrderFilter (KODI::MEDIA::TYPE type, const SortDescription &sorting, Filter &filter) const |
| unsigned int | GetRandomSongIDs (const Filter &filter, std::vector< std::pair< int, int > > &songIDs) |
| Gets song IDs in random order that match the filter criteria. | |
| bool | GetGenresJSON (CFileItemList &items, bool bSources=false) |
| bool | GetArtistsByWhereJSON (const std::set< std::string, std::less<> > &fields, const std::string &baseDir, CVariant &result, int &total, const SortDescription &sortDescription) |
| bool | GetAlbumsByWhereJSON (const std::set< std::string, std::less<> > &fields, const std::string &baseDir, CVariant &result, int &total, const SortDescription &sortDescription) |
| bool | GetSongsByWhereJSON (const std::set< std::string, std::less<> > &fields, const std::string &baseDir, CVariant &result, int &total, const SortDescription &sortDescription) |
| bool | SetScraper (int id, ADDON::ContentType content, const ADDON::ScraperPtr &scraper) |
| bool | SetScraperAll (const std::string &strBaseDir, const ADDON::ScraperPtr &scraper) |
| bool | GetScraper (int id, ADDON::ContentType content, ADDON::ScraperPtr &scraper) |
| bool | ScraperInUse (const std::string &scraperID) const |
| Check whether a given scraper is in use. | |
| bool | GetItems (const std::string &strBaseDir, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter=Filter()) |
| bool | GetItems (const std::string &strBaseDir, const std::string &itemType, CFileItemList &items, const SortDescription &sortDescription, const Filter &filter=Filter()) |
| std::string | GetItemById (const std::string &itemType, int id) const |
| void | ExportToXML (const CLibExportSettings &settings, CGUIDialogProgress *progressDialog=nullptr) |
| bool | ExportSongHistory (TiXmlNode *pNode, CGUIDialogProgress *progressDialog=nullptr) |
| void | ImportFromXML (const std::string &xmlFile, CGUIDialogProgress *progressDialog=nullptr) |
| bool | ImportSongHistory (const std::string &xmlFile, const int total, CGUIDialogProgress *progressDialog=nullptr) |
| void | SetPropertiesForFileItem (CFileItem &item) |
| void | SetItemUpdated (int mediaId, KODI::MEDIA::TYPE mediaType) |
| bool | SetArtForItem (int mediaId, const std::string &mediaType, const KODI::ART::Artwork &art) override |
Sets each piece of art for a database item, carrying on past one that fails. | |
| bool | GetArtForItem (int songId, int albumId, int artistId, bool bPrimaryArtist, std::vector< ArtForThumbLoader > &art) |
| Fetch all related art for a database item. Fetches multiple pieces of art for a database item including that for related media types Given song id art for the related album, artist(s) and albumartist(s) will also be fetched, looking up the album and artist when ids are not provided. Given album id (and not song id) art for the related artist(s) will also be fetched, looking up the artist(s) when id are not provided. | |
| bool | GetArtForItem (int mediaId, const std::string &mediaType, KODI::ART::Artwork &art) override |
| Fetch art for a database item. | |
| std::vector< std::string > | GetAvailableArtTypesForItem (int mediaId, KODI::MEDIA::TYPE mediaType) |
| Fetch the distinct types of available-but-unassigned art held in the database for a specific media item. | |
| std::vector< CScraperUrl::SUrlEntry > | GetAvailableArtForItem (int mediaId, KODI::MEDIA::TYPE 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. | |
| virtual int | GetMusicNeedsTagScan () |
| Check if music files need all tags rescanning regardless of file being unchanged because the tag processing has changed (which may happen without db version changes) since they where last scanned. | |
| void | SetMusicNeedsTagScan (int version) |
| Set minimum version number of db needed when tag data scanned from music files. | |
| void | SetMusicTagScanVersion (int version=0) |
| Set the version number of tag data. | |
| std::string | GetLibraryLastUpdated () const |
| void | SetLibraryLastUpdated () |
| std::string | GetLibraryLastCleaned () const |
| void | SetLibraryLastCleaned () |
| std::string | GetArtistLinksUpdated () const |
| void | SetArtistLinksUpdated () |
| std::string | GetGenresLastAdded () const |
| std::string | GetSongsLastAdded () const |
| std::string | GetAlbumsLastAdded () const |
| std::string | GetArtistsLastAdded () const |
| std::string | GetSongsLastModified () const |
| std::string | GetAlbumsLastModified () const |
| std::string | GetArtistsLastModified () const |
| std::vector< std::string > | GetUsedImages (const std::vector< std::string > &imagesToCheck) const |
| Check the passed in list of images if used in this database. Used to clean the image cache. | |
| std::string | GetArtForItem (int mediaId, const std::string &mediaType, const std::string &artType) |
| The url of one type of art for a library item, empty if it has none. | |
| bool | GetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, KODI::ART::Artwork &art) |
| std::string | GetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const std::string &artType) |
| bool | SetArtForItem (int mediaId, const std::string &mediaType, const std::string &artType, const std::string &url) |
| Sets art for a library item. | |
| bool | SetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const std::string &artType, const std::string &url) |
| The art functions above, for an item whose table is a media type. | |
| bool | SetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const KODI::ART::Artwork &art) |
Public Member Functions inherited from CDatabase | |
| CDatabase (const std::string &dbType) | |
| virtual | ~CDatabase () |
| bool | IsOpen () const |
| bool | Open (const DatabaseSettings &db) |
| virtual void | Close () |
| const std::string & | GetType () const |
| bool | Compress (bool bForce=true) |
| void | Interrupt () |
| void | BeginTransaction () |
| void | RollbackTransaction () |
| bool | InTransaction () const |
| void | CopyDB (const std::string &latestDb) |
| void | DropAnalytics () |
| std::string | PrepareSQL (std::string_view sqlFormat,...) 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, 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, 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 () const |
| 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 () const |
| 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) |
| ConnectionState | Connect (const std::string &dbName, const DatabaseSettings &db, bool create) |
| bool | SetArtForItem (int mediaId, const std::string &mediaType, const std::string &artType, const std::string &url) |
| Sets art for a library item. | |
| std::string | GetArtForItem (int mediaId, const std::string &mediaType, const std::string &artType) |
| The url of one type of art for a library item, empty if it has none. | |
| bool | RemoveArtForItem (int mediaId, const std::string &mediaType, const std::string &artType) |
| bool | RemoveArtForItem (int mediaId, const std::string &mediaType, const std::set< std::string, std::less<> > &artTypes) |
| bool | GetArtTypes (const std::string &mediaType, std::vector< std::string > &artTypes) |
Adds the distinct types of art held for a type of item to artTypes. | |
| bool | SetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const std::string &artType, const std::string &url) |
| The art functions above, for an item whose table is a media type. | |
| bool | SetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const KODI::ART::Artwork &art) |
| bool | GetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, KODI::ART::Artwork &art) |
| std::string | GetArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const std::string &artType) |
| bool | RemoveArtForItem (int mediaId, KODI::MEDIA::TYPE mediaType, const std::set< std::string, std::less<> > &artTypes) |
Static Public Member Functions | |
| static void | SetPropertiesFromArtist (CFileItem &item, const CArtist &artist) |
| static void | SetPropertiesFromAlbum (CFileItem &item, const CAlbum &album) |
Protected Member Functions | |
| void | CreateTables () override |
| void | CreateAnalytics () override |
| int | GetMinSchemaVersion () const override |
| int | GetSchemaVersion () const override |
| const char * | GetBaseDBName () const override |
Protected Member Functions inherited from CDatabase | |
| void | Split (const std::string &strFileNameAndPath, std::string &strPath, std::string &strFileName) const |
| bool | CreateDatabase () |
| Create database tables and analytics as needed. Calls CreateTables() and CreateAnalytics() on child classes. | |
| void | AddAutoIncrement (const std::string &table) |
| Rebuild a table so that its integer primary key never hands out a deleted row's id. For UpdateTables() only: the analytics must be dropped. MySQL already declares every integer primary key auto_increment, so there it does nothing. | |
| int | GetDBVersion () |
| bool | BuildSQL (std::string_view strQuery, const Filter &filter, std::string &strSQL) const |
Friends | |
| class | DatabaseUtils |
| class | TestDatabaseUtilsHelper |
Additional Inherited Members | |
Public Types inherited from CDatabase | |
| enum class | ConnectionState { STATE_ERROR , STATE_DATABASE_NOT_FOUND , STATE_CONNECTED } |
Protected Attributes inherited from CDatabase | |
| bool | m_sqlite {true} |
| whether we use sqlite (defaults to true) | |
| std::unique_ptr< dbiplus::Database > | m_pDB |
| std::unique_ptr< dbiplus::Dataset > | m_pDS |
| std::unique_ptr< dbiplus::Dataset > | m_pDS2 |
| const CProfileManager & | m_profileManager |
Class to store and read tag information.
CMusicDatabase can be used to read and store tag information for faster access. It is based on sqlite (http://www.sqlite.org).
Here is the database layout:
| CMusicDatabase::CMusicDatabase | ( | ) |
|
override |
Add an album and all its songs to the database.
| album | the album to add |
| idSource | the music source id |
| int CMusicDatabase::AddAlbum | ( | const std::string & | strAlbum, |
| const std::string & | strMusicBrainzAlbumID, | ||
| const std::string & | strReleaseGroupMBID, | ||
| const std::string & | strArtist, | ||
| const std::string & | strArtistSort, | ||
| const std::string & | strGenre, | ||
| const std::string & | strReleaseDate, | ||
| const std::string & | strOrigReleaseDate, | ||
| bool | bBoxedSet, | ||
| const std::string & | strRecordLabel, | ||
| const std::string & | strType, | ||
| const std::string & | strReleaseStatus, | ||
| bool | bCompilation, | ||
| AudioType::Type | releaseType ) |
Add an album to the database.
| strAlbum | the album title |
| strMusicBrainzAlbumID | the Musicbrainz Id |
| strReleaseGroupMBID | the MusicBrainz release group id |
| strArtist | the album artist name(s) display string |
| strArtistSort | the album artist name(s) sort string |
| strGenre | the album genre(s) |
| strReleaseDate | [in] the release date of the album ISO8601 format |
| strOrigReleaseDate | [in] the original release date of the album ISO8601 format |
| bBoxedSet | if the album is a boxset |
| strRecordLabel | the recording label |
| strType | album type (Musicbrainz release type e.g. "Broadcast, Soundtrack, live"), |
| strReleaseStatus | (see https://musicbrainz.org/doc/Release#Status) |
| bCompilation | if the album is a compilation |
| releaseType | "album" or "single" |
| bool CMusicDatabase::AddAlbumArtist | ( | int | idArtist, |
| int | idAlbum, | ||
| std::string_view | strArtist, | ||
| int | iOrder ) |
| int CMusicDatabase::AddArtist | ( | const std::string & | strArtist, |
| const std::string & | strMusicBrainzArtistID, | ||
| bool | bScrapedMBID = false ) |
| int CMusicDatabase::AddArtist | ( | const std::string & | strArtist, |
| const std::string & | strMusicBrainzArtistID, | ||
| const std::string & | strSortName, | ||
| bool | bScrapedMBID = false ) |
| int CMusicDatabase::AddArtistDiscography | ( | int | idArtist, |
| const CDiscoAlbum & | discoAlbum ) |
| int CMusicDatabase::AddGenre | ( | std::string & | strGenre | ) |
| int CMusicDatabase::AddPath | ( | const std::string & | strPath | ) |
| int CMusicDatabase::AddRole | ( | std::string_view | strRole | ) |
| int CMusicDatabase::AddSong | ( | const int | idSong, |
| const CDateTime & | dtDateNew, | ||
| const int | idAlbum, | ||
| const std::string & | strTitle, | ||
| const std::string & | strMusicBrainzTrackID, | ||
| const std::string & | strPathAndFileName, | ||
| const std::string & | strComment, | ||
| const std::string & | strMood, | ||
| const std::string & | strThumb, | ||
| const std::string & | artistDisp, | ||
| const std::string & | artistSort, | ||
| const std::vector< std::string > & | genres, | ||
| int | iTrack, | ||
| int | iDuration, | ||
| const std::string & | strReleaseDate, | ||
| const std::string & | strOrigReleaseDate, | ||
| std::string & | strDiscSubtitle, | ||
| const int | iTimesPlayed, | ||
| int | iStartOffset, | ||
| int | iEndOffset, | ||
| const CDateTime & | dtLastPlayed, | ||
| float | rating, | ||
| int | userrating, | ||
| int | votes, | ||
| int | iBPM, | ||
| int | iBitRate, | ||
| int | iSampleRate, | ||
| int | iChannels, | ||
| const std::string & | songVideoURL, | ||
| const ReplayGain & | replayGain ) |
Add a song to the database.
| idSong | [in] the original database ID of the song to reuse (-1 when new) |
| dtDateNew | [in] the datetime the original ID was new |
| idAlbum | [in] the database ID of the album for the song |
| strTitle | [in] the title of the song (required to be non-empty) |
| strMusicBrainzTrackID | [in] the MusicBrainz track ID of the song |
| strPathAndFileName | [in] the path and filename to the song |
| strComment | [in] the comment of the song |
| strMood | [in] the mood of the added song |
| strThumb | [in] the thumb of the song |
| artistDisp | [in] the assembled artist name(s) display string |
| artistSort | [in] the artist name(s) sort string |
| genres | [in] a vector of genres to which this song belongs |
| iTrack | [in] the track number and disc number of the song |
| iDuration | [in] the duration of the song |
| strReleaseDate | [in] the release date of the song ISO8601 format |
| strOrigReleaseDate | [in] the original release date of the song ISO8601 format |
| strDiscSubtitle | [in] subtitle of a disc |
| iTimesPlayed | [in] the number of times the song has been played |
| iStartOffset | [in] the start offset of the song (when using a single audio file with a .cue) |
| iEndOffset | [in] the end offset of the song (when using a single audio file with .cue) |
| dtLastPlayed | [in] the time the song was last played |
| rating | [in] a rating for the song |
| userrating | [in] a userrating (my rating) for the song |
| votes | [in] a vote counter for the song rating |
| iBPM | [in] the beats per minute of a song |
| iBitRate | [in] the bitrate of the song file |
| iSampleRate | [in] the sample rate of the song file |
| iChannels | [in] the number of audio channels in the song file |
| songVideoURL | [in] url to video of the song |
| replayGain | [in] album and track replaygain and peak values |
| bool CMusicDatabase::AddSongArtist | ( | int | idArtist, |
| int | idSong, | ||
| int | idRole, | ||
| std::string_view | strArtist, | ||
| int | iOrder ) |
| bool CMusicDatabase::AddSongArtist | ( | int | idArtist, |
| int | idSong, | ||
| std::string_view | strRole, | ||
| std::string_view | strArtist, | ||
| int | iOrder ) |
| int CMusicDatabase::AddSongContributor | ( | int | idSong, |
| const std::string & | strRole, | ||
| const std::string & | strArtist, | ||
| const std::string & | strSort ) |
| void CMusicDatabase::AddSongContributors | ( | int | idSong, |
| const std::vector< CMusicRole > & | contributors, | ||
| const std::string & | strSort ) |
| int CMusicDatabase::AddSource | ( | const std::string & | strName, |
| const std::string & | strMultipath, | ||
| const std::vector< std::string > & | vecPaths, | ||
| int | id = -1 ) |
| void CMusicDatabase::CheckArtistLinksChanged | ( | ) |
| void CMusicDatabase::Clean | ( | ) | const |
| int CMusicDatabase::Cleanup | ( | CGUIDialogProgress * | progressDialog = nullptr | ) |
| bool CMusicDatabase::CleanupOrphanedItems | ( | ) |
| void CMusicDatabase::DeleteCDDBInfo | ( | ) | const |
| void CMusicDatabase::EmptyCache | ( | ) |
| bool CMusicDatabase::ExportSongHistory | ( | TiXmlNode * | pNode, |
| CGUIDialogProgress * | progressDialog = nullptr ) |
| void CMusicDatabase::ExportToXML | ( | const CLibExportSettings & | settings, |
| CGUIDialogProgress * | progressDialog = nullptr ) |
retrieve an album, optionally with all songs.
| idAlbum | the database id of the album. |
| album | [out] the album to fill. |
| getSongs | whether or not to retrieve songs, defaults to true. |
| std::string CMusicDatabase::GetAlbumById | ( | int | id | ) | const |
| int CMusicDatabase::GetAlbumByName | ( | const std::string & | strAlbum, |
| const std::string & | strArtist = "" ) |
| int CMusicDatabase::GetAlbumByName | ( | const std::string & | strAlbum, |
| const std::vector< std::string > & | artist ) |
| bool CMusicDatabase::GetAlbumFolder | ( | const CAlbum & | album, |
| const std::string & | strAlbumPath, | ||
| std::string & | strFolder ) |
| int CMusicDatabase::GetAlbumIdByPath | ( | const std::string & | path | ) |
| bool CMusicDatabase::GetAlbumPaths | ( | int | idAlbum, |
| std::vector< std::pair< std::string, int > > & | paths ) |
| bool CMusicDatabase::GetAlbumsByWhere | ( | const std::string & | baseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter, | ||
| bool | countOnly = false ) |
| bool CMusicDatabase::GetAlbumsByWhereJSON | ( | const std::set< std::string, std::less<> > & | fields, |
| const std::string & | baseDir, | ||
| CVariant & | result, | ||
| int & | total, | ||
| const SortDescription & | sortDescription ) |
| bool CMusicDatabase::GetAlbumsByYear | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| int | year ) |
| std::string CMusicDatabase::GetAlbumsLastAdded | ( | ) | const |
| std::string CMusicDatabase::GetAlbumsLastModified | ( | ) | const |
| bool CMusicDatabase::GetAlbumsNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| int | idGenre = -1, | ||
| int | idArtist = -1, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
| bool CMusicDatabase::GetAlbumTypesNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
| std::string CDatabase::GetArtForItem | ( | int | mediaId, |
| const std::string & | mediaType, | ||
| const std::string & | artType ) |
The url of one type of art for a library item, empty if it has none.
|
overridevirtual |
Fetch art for a database item.
Reimplemented from CDatabase.
|
inline |
|
inline |
| bool CMusicDatabase::GetArtForItem | ( | int | songId, |
| int | albumId, | ||
| int | artistId, | ||
| bool | bPrimaryArtist, | ||
| std::vector< ArtForThumbLoader > & | art ) |
Fetch all related art for a database item. Fetches multiple pieces of art for a database item including that for related media types Given song id art for the related album, artist(s) and albumartist(s) will also be fetched, looking up the album and artist when ids are not provided. Given album id (and not song id) art for the related artist(s) will also be fetched, looking up the artist(s) when id are not provided.
| songId | the id in the song table, -1 when song art not being fetched |
| albumId | the id in the album table, -1 when album art not being fetched |
| artistId | the id in the artist table, -1 when artist not known |
| bPrimaryArtist | true if art from only the first song artist or album artist is to be fetched |
| art | [out] a vector, each element having media type e.g. "artist", "album" or "song", artType e.g. "thumb", "fanart", etc., prefix of "", "artist" or "albumartist" etc. giving the kind of artist relationship, and the original url of the art. |
| std::string CMusicDatabase::GetArtistById | ( | int | id | ) | const |
| int CMusicDatabase::GetArtistByName | ( | const std::string & | strArtist | ) |
| int CMusicDatabase::GetArtistCountForRole | ( | const std::string & | strRole | ) | const |
| bool CMusicDatabase::GetArtistDiscography | ( | int | idArtist, |
| CFileItemList & | items ) |
| bool CMusicDatabase::GetArtistFolderName | ( | const std::string & | strArtist, |
| const std::string & | strMusicBrainzArtistID, | ||
| std::string & | strFolder ) |
| int CMusicDatabase::GetArtistFromMBID | ( | const std::string & | strMusicBrainzArtistID, |
| std::string & | artistname ) |
| std::string CMusicDatabase::GetArtistLinksUpdated | ( | ) | const |
| bool CMusicDatabase::GetArtistsByWhere | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter, | ||
| bool | countOnly = false ) |
| bool CMusicDatabase::GetArtistsByWhereJSON | ( | const std::set< std::string, std::less<> > & | fields, |
| const std::string & | baseDir, | ||
| CVariant & | result, | ||
| int & | total, | ||
| const SortDescription & | sortDescription ) |
| std::string CMusicDatabase::GetArtistsLastAdded | ( | ) | const |
| std::string CMusicDatabase::GetArtistsLastModified | ( | ) | const |
| bool CMusicDatabase::GetArtistsNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| bool | albumArtistsOnly = false, | ||
| int | idGenre = -1, | ||
| int | idAlbum = -1, | ||
| int | idSong = -1, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
| std::vector< CScraperUrl::SUrlEntry > CMusicDatabase::GetAvailableArtForItem | ( | int | mediaId, |
| KODI::MEDIA::TYPE | 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.
| mediaId | the id in the media (artist/album) table. |
| mediaType | corresponds to the table the item resides in (artist/album). |
| artType | e.g. "thumb", "fanart", etc. |
| std::vector< std::string > CMusicDatabase::GetAvailableArtTypesForItem | ( | int | mediaId, |
| KODI::MEDIA::TYPE | mediaType ) |
Fetch the distinct types of available-but-unassigned art held in the database for a specific media item.
| mediaId | the id in the media (artist/album) table. |
| mediaType | the type of media, which corresponds to the table the item resides in (artist/album). |
|
inlineoverrideprotectedvirtual |
Implements CDatabase.
| int CMusicDatabase::GetBoxsetsCount | ( | ) | const |
| bool CMusicDatabase::GetCommonNav | ( | const std::string & | strBaseDir, |
| const std::string & | table, | ||
| const std::string & | labelField, | ||
| CFileItemList & | items, | ||
| const Filter & | filter, | ||
| bool | countOnly ) |
| int CMusicDatabase::GetCompilationAlbumsCount | ( | ) | const |
| bool CMusicDatabase::GetDiscsByWhere | ( | CMusicDbUrl & | musicUrl, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter, | ||
| bool | countOnly = false ) |
| bool CMusicDatabase::GetDiscsByWhere | ( | const std::string & | baseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter, | ||
| bool | countOnly = false ) |
| bool CMusicDatabase::GetDiscsNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| int | idAlbum, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
|
overridevirtual |
Reimplemented from CDatabase.
| std::string CMusicDatabase::GetGenreById | ( | int | id | ) | const |
| int CMusicDatabase::GetGenreByName | ( | const std::string & | strGenre | ) |
| bool CMusicDatabase::GetGenresJSON | ( | CFileItemList & | items, |
| bool | bSources = false ) |
| std::string CMusicDatabase::GetGenresLastAdded | ( | ) | const |
| bool CMusicDatabase::GetGenresNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
| std::string CMusicDatabase::GetItemById | ( | const std::string & | itemType, |
| int | id ) const |
| bool CMusicDatabase::GetItems | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter = Filter() ) |
| bool CMusicDatabase::GetItems | ( | const std::string & | strBaseDir, |
| const std::string & | itemType, | ||
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter = Filter() ) |
| int CMusicDatabase::GetLastArtist | ( | ) | const |
| std::string CMusicDatabase::GetLibraryLastCleaned | ( | ) | const |
| std::string CMusicDatabase::GetLibraryLastUpdated | ( | ) | const |
| bool CMusicDatabase::GetMatchingMusicVideoAlbum | ( | const std::string & | strAlbum, |
| const std::string & | strArtist, | ||
| int & | idAlbum, | ||
| std::string & | strReview ) |
|
inlineoverrideprotectedvirtual |
Reimplemented from CDatabase.
| bool CMusicDatabase::GetMusicLabelsNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
|
virtual |
Check if music files need all tags rescanning regardless of file being unchanged because the tag processing has changed (which may happen without db version changes) since they where last scanned.
| int CMusicDatabase::GetOrderFilter | ( | KODI::MEDIA::TYPE | type, |
| const SortDescription & | sorting, | ||
| Filter & | filter ) const |
| bool CMusicDatabase::GetPathHash | ( | const std::string & | path, |
| std::string & | hash ) |
| bool CMusicDatabase::GetPaths | ( | std::set< std::string, std::less<> > & | paths | ) |
| unsigned int CMusicDatabase::GetRandomSongIDs | ( | const Filter & | filter, |
| std::vector< std::pair< int, int > > & | songIDs ) |
Gets song IDs in random order that match the filter criteria.
| filter | the criteria to apply in the query |
| songIDs | a vector of <1, id> pairs suited to party mode use |
| bool CMusicDatabase::GetRecentlyAddedAlbums | ( | std::vector< CAlbum > & | albums, |
| unsigned int | limit = 0 ) |
| bool CMusicDatabase::GetRecentlyAddedAlbumSongs | ( | const std::string & | strBaseDir, |
| CFileItemList & | item, | ||
| unsigned int | limit = 0 ) |
| bool CMusicDatabase::GetRecentlyPlayedAlbumSongs | ( | const std::string & | strBaseDir, |
| CFileItemList & | item ) |
| std::string CMusicDatabase::GetRoleById | ( | int | id | ) | const |
| int CMusicDatabase::GetRoleByName | ( | const std::string & | strRole | ) |
| bool CMusicDatabase::GetRolesNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const Filter & | filter = Filter() ) |
| bool CMusicDatabase::GetScraper | ( | int | id, |
| ADDON::ContentType | content, | ||
| ADDON::ScraperPtr & | scraper ) |
| int CMusicDatabase::GetSinglesCount | ( | ) |
| int CMusicDatabase::GetSongByArtistAndAlbumAndTitle | ( | const std::string & | strArtist, |
| const std::string & | strAlbum, | ||
| const std::string & | strTitle ) |
| bool CMusicDatabase::GetSongByFileName | ( | const std::string & | strFileName, |
| CSong & | song, | ||
| int64_t | startOffset = 0 ) |
| bool CMusicDatabase::GetSongsByPath | ( | const std::string & | strPath, |
| std::map< std::string, std::vector< CSong > > & | songmap, | ||
| bool | bAppendToMap = false ) |
| bool CMusicDatabase::GetSongsByWhereJSON | ( | const std::set< std::string, std::less<> > & | fields, |
| const std::string & | baseDir, | ||
| CVariant & | result, | ||
| int & | total, | ||
| const SortDescription & | sortDescription ) |
| bool CMusicDatabase::GetSongsByYear | ( | const std::string & | baseDir, |
| CFileItemList & | items, | ||
| int | year ) |
| bool CMusicDatabase::GetSongsFullByWhere | ( | const std::string & | baseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| const Filter & | filter, | ||
| bool | artistData = false ) |
| std::string CMusicDatabase::GetSongsLastAdded | ( | ) | const |
| std::string CMusicDatabase::GetSongsLastModified | ( | ) | const |
| bool CMusicDatabase::GetSongsNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const SortDescription & | sortDescription, | ||
| int | idGenre, | ||
| int | idArtist, | ||
| int | idAlbum ) |
| std::string CMusicDatabase::GetSourceById | ( | int | id | ) | const |
| int CMusicDatabase::GetSourceByName | ( | const std::string & | strSource | ) |
| int CMusicDatabase::GetSourceFromPath | ( | const std::string & | strPath | ) |
| bool CMusicDatabase::GetSources | ( | CFileItemList & | items | ) |
| bool CMusicDatabase::GetSourcesNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const Filter & | filter = Filter(), | ||
| bool | countOnly = false ) |
| bool CMusicDatabase::GetTop100 | ( | const std::string & | strBaseDir, |
| CFileItemList & | items ) |
| bool CMusicDatabase::GetTop100AlbumSongs | ( | const std::string & | strBaseDir, |
| CFileItemList & | item ) |
|
inline |
| std::vector< std::string > CMusicDatabase::GetUsedImages | ( | const std::vector< std::string > & | imagesToCheck | ) | const |
Check the passed in list of images if used in this database. Used to clean the image cache.
| imagesToCheck | the image URLs to check |
| bool CMusicDatabase::GetYearsNav | ( | const std::string & | strBaseDir, |
| CFileItemList & | items, | ||
| const Filter & | filter = Filter() ) |
| void CMusicDatabase::ImportFromXML | ( | const std::string & | xmlFile, |
| CGUIDialogProgress * | progressDialog = nullptr ) |
| bool CMusicDatabase::ImportSongHistory | ( | const std::string & | xmlFile, |
| const int | total, | ||
| CGUIDialogProgress * | progressDialog = nullptr ) |
Increment the playcount of an item Increments the playcount and updates the last played date.
| item | CFileItem to increment the playcount for |
| bool CMusicDatabase::InsideScannedPath | ( | const std::string & | path | ) | const |
Checks if the given path is inside a folder that has already been scanned into the library.
| path | the path we want to check |
| bool CMusicDatabase::RemoveSource | ( | const std::string & | strName | ) |
| bool CMusicDatabase::ScraperInUse | ( | const std::string & | scraperID | ) | const |
Check whether a given scraper is in use.
| scraperID | the scraper to check for. |
| bool CMusicDatabase::Search | ( | const std::string & | search, |
| CFileItemList & | items ) |
| bool CMusicDatabase::SearchAlbumsByArtistName | ( | const std::string & | strArtist, |
| CFileItemList & | items ) |
|
overridevirtual |
Sets each piece of art for a database item, carrying on past one that fails.
Reimplemented from CDatabase.
| bool CDatabase::SetArtForItem | ( | int | mediaId, |
| const std::string & | mediaType, | ||
| const std::string & | artType, | ||
| const std::string & | url ) |
Sets art for a library item.
| mediaId | the id in the item's table. |
| mediaType | the type of the item, which corresponds to the table it resides in. |
| artType | the type of art to set, e.g. "thumb"; a type of a parent's art, such as "tvshow.poster", is not stored. |
| url | the url to the art (the original url, not a cached url). |
|
inline |
|
inline |
The art functions above, for an item whose table is a media type.
| void CMusicDatabase::SetArtistLinksUpdated | ( | ) |
| void CMusicDatabase::SetItemUpdated | ( | int | mediaId, |
| KODI::MEDIA::TYPE | mediaType ) |
| void CMusicDatabase::SetLibraryLastCleaned | ( | ) |
| void CMusicDatabase::SetLibraryLastUpdated | ( | ) |
Set minimum version number of db needed when tag data scanned from music files.
| version | the version number of db |
Set the version number of tag data.
| version | the version number of db when tags last scanned, 0 (default) means current db version |
| bool CMusicDatabase::SetPathHash | ( | const std::string & | path, |
| const std::string & | hash ) |
| bool CMusicDatabase::SetScraper | ( | int | id, |
| ADDON::ContentType | content, | ||
| const ADDON::ScraperPtr & | scraper ) |
| bool CMusicDatabase::SetScraperAll | ( | const std::string & | strBaseDir, |
| const ADDON::ScraperPtr & | scraper ) |
Update an album and all its nested entities (artists, songs etc)
| album | the album to update |
| int CMusicDatabase::UpdateAlbum | ( | int | idAlbum, |
| const std::string & | strAlbum, | ||
| const std::string & | strMusicBrainzAlbumID, | ||
| const std::string & | strReleaseGroupMBID, | ||
| const std::string & | strArtist, | ||
| const std::string & | strArtistSort, | ||
| const std::string & | strGenre, | ||
| const std::string & | strMoods, | ||
| const std::string & | strStyles, | ||
| const std::string & | strThemes, | ||
| const std::string & | strReview, | ||
| const std::string & | strImage, | ||
| const std::string & | strLabel, | ||
| const std::string & | strType, | ||
| const std::string & | strReleaseStatus, | ||
| float | fRating, | ||
| int | iUserrating, | ||
| int | iVotes, | ||
| const std::string & | strReleaseDate, | ||
| const std::string & | strOrigReleaseDate, | ||
| bool | bBoxedSet, | ||
| bool | bCompilation, | ||
| AudioType::Type | releaseType, | ||
| bool | bScrapedMBID ) |
| int CMusicDatabase::UpdateArtist | ( | int | idArtist, |
| const std::string & | strArtist, | ||
| const std::string & | strSortName, | ||
| const std::string & | strMusicBrainzArtistID, | ||
| bool | bScrapedMBID, | ||
| const std::string & | strType, | ||
| const std::string & | strGender, | ||
| const std::string & | strDisambiguation, | ||
| const std::string & | strBorn, | ||
| const std::string & | strFormed, | ||
| const std::string & | strGenres, | ||
| const std::string & | strMoods, | ||
| const std::string & | strStyles, | ||
| const std::string & | strInstruments, | ||
| const std::string & | strBiography, | ||
| const std::string & | strDied, | ||
| const std::string & | strDisbanded, | ||
| const std::string & | strYearsActive, | ||
| const std::string & | strImage ) |
| bool CMusicDatabase::UpdateArtistScrapedMBID | ( | int | idArtist, |
| const std::string & | strMusicBrainzArtistID ) |
Propagate artist sort name into the concatenated artist sort name strings held for songs and albums.
| idArtist | to propagate sort name for, -1 means all artists |
Update a song and all its nested entities (genres, artists, contributors)
| song | [in/out] the song to update, artist ids are returned in artist credits |
| bArtists | to update artist credits and contributors, default is true |
| bArtistLinks | to check and log if artist links have changed, default is true |
| int CMusicDatabase::UpdateSong | ( | int | idSong, |
| const std::string & | strTitle, | ||
| const std::string & | strMusicBrainzTrackID, | ||
| const std::string & | strPathAndFileName, | ||
| const std::string & | strComment, | ||
| const std::string & | strMood, | ||
| const std::string & | strThumb, | ||
| const std::string & | artistDisp, | ||
| const std::string & | artistSort, | ||
| const std::vector< std::string > & | genres, | ||
| int | iTrack, | ||
| int | iDuration, | ||
| const std::string & | strReleaseDate, | ||
| const std::string & | strOrigReleaseDate, | ||
| const std::string & | strDiscSubtitle, | ||
| int | iTimesPlayed, | ||
| int | iStartOffset, | ||
| int | iEndOffset, | ||
| const CDateTime & | dtLastPlayed, | ||
| float | rating, | ||
| int | userrating, | ||
| int | votes, | ||
| const ReplayGain & | replayGain, | ||
| int | iBPM, | ||
| int | iBitRate, | ||
| int | iSampleRate, | ||
| int | iChannels, | ||
| const std::string & | songVideoURL ) |
Update a song in the database.
| idSong | [in] the database ID of the song to update |
| strTitle | [in] the title of the song (required to be non-empty) |
| strMusicBrainzTrackID | [in] the MusicBrainz track ID of the song |
| strPathAndFileName | [in] the path and filename to the song |
| strComment | [in] the comment of the song |
| strMood | [in] the mood of the added song |
| strThumb | [in] the thumb of the song |
| artistDisp | [in] the artist name(s) display string |
| artistSort | [in] the artist name(s) sort string |
| genres | [in] a vector of genres to which this song belongs |
| iTrack | [in] the track number and disc number of the song |
| iDuration | [in] the duration of the song |
| strReleaseDate | [in] the release date of the song ISO8601 format |
| strOrigReleaseDate | [in] the original release date of the song ISO8601 format |
| strDiscSubtitle | [in] subtitle of a disc |
| iTimesPlayed | [in] the number of times the song has been played |
| iStartOffset | [in] the start offset of the song (when using a single audio file with a .cue) |
| iEndOffset | [in] the end offset of the song (when using a single audio file with .cue) |
| dtLastPlayed | [in] the time the song was last played |
| rating | [in] a rating for the song |
| userrating | [in] a userrating (my rating) for the song |
| votes | [in] a vote counter for the song rating |
| replayGain | [in] album and track replaygain and peak values |
| iBPM | [in] the beats per minute of a song |
| iBitRate | [in] the bitrate of the song file |
| iSampleRate | [in] the sample rate of the song file |
| iChannels | [in] the number of audio channels in the song file |
| songVideoURL | [in] url link to a video of the song |
| artistDisp |
| int CMusicDatabase::UpdateSource | ( | const std::string & | strOldName, |
| const std::string & | strName, | ||
| const std::string & | strMultipath, | ||
| const std::vector< std::string > & | vecPaths ) |
| bool CMusicDatabase::UpdateSources | ( | ) |
|
friend |
|
friend |