diff options
author | CrystalP <crystalp@kodi.tv> | 2024-04-18 09:59:15 -0400 |
---|---|---|
committer | CrystalP <crystalp@kodi.tv> | 2024-07-07 14:10:57 -0400 |
commit | 91bec7604e04db52437cd7fc9853f6bf37dce4a5 (patch) | |
tree | bfdcb0c1cc8b0fe0852ad7e51b7b9ebd37030196 | |
parent | 35a5f956576b9316c61c9119f1e2119299e2597a (diff) |
[videodb] Remove redundant deletion of stream details when setting movie details
SetStreamDetailsForFileId clears existing details unconditionnally, then adds the new ones.
Added doxygen.
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 9 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.h | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 432135b41c..4d09ed4553 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -2623,16 +2623,9 @@ int CVideoDatabase::SetDetailsForMovie(CVideoInfoTag& details, if (idMovie < 0) idMovie = GetMovieId(filePath); - if (idMovie > -1) - { - const int idFile{GetDbId(PrepareSQL("SELECT idFile FROM movie WHERE idMovie=%i", idMovie))}; - DeleteStreamDetails(idFile); - } - else + if (idMovie == -1) { // only add a new movie if we don't already have a valid idMovie - // (DeleteMovie is called with bKeepId == true so the movie won't - // be removed from the movie table) idMovie = AddNewMovie(details); if (idMovie < 0) { diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 59d7dc5f9e..d5db8f459b 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -591,6 +591,11 @@ public: const std::map<std::string, std::string>& artwork, int idMVideo = -1); int SetStreamDetailsForFile(const CStreamDetails& details, const std::string& strFileNameAndPath); + /*! + * \brief Clear any existing stream details and add the new provided details to a file. + * \param[in] details New stream details + * \param[in] idFile Identifier of the file + */ void SetStreamDetailsForFileId(const CStreamDetails& details, int idFile); bool SetSingleValue(VideoDbContentType type, int dbId, int dbField, const std::string& strValue); |