Update DeleteMovie to remove links to writers (Fixes 14940)
authorChris Gilbert <chris@dokein.co.uk>
Mon, 17 Feb 2014 21:11:02 +0000 (21:11 +0000)
committerChris Gilbert <chris@dokein.co.uk>
Mon, 17 Feb 2014 22:44:21 +0000 (22:44 +0000)
DeleteMovie needs updating to remove entries in writerlinkmovie, otherwise any updates to the list of writers for a movie may not be correctly reflected, as new entries will be append and old entries are not removed.

xbmc/video/VideoDatabase.cpp

index 003fc5f..2db5c2d 100644 (file)
@@ -2865,6 +2865,9 @@ void CVideoDatabase::DeleteMovie(const CStdString& strFilenameAndPath, bool bKee
     strSQL=PrepareSQL("delete from countrylinkmovie where idMovie=%i", idMovie);
     m_pDS->exec(strSQL.c_str());
 
+    strSQL=PrepareSQL("delete from writerlinkmovie where idMovie=%i", idMovie);
+    m_pDS->exec(strSQL.c_str());
+
     DeleteStreamDetails(GetFileId(strFilenameAndPath));
 
     // keep the movie table entry, linking to tv shows, and bookmarks