aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/video/VideoDatabase.cpp9
-rw-r--r--xbmc/video/VideoDatabase.h5
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);