Skip to content

Commit

Permalink
Merge pull request #5587 from mkortstiege/invalidate
Browse files Browse the repository at this point in the history
Invalidate path hash on remove so the infoscanner can pick it up again
  • Loading branch information
MartijnKaijser committed Nov 2, 2014
2 parents da9a79e + 8eeafa7 commit a693300
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions xbmc/video/VideoDatabase.cpp
Expand Up @@ -3193,14 +3193,13 @@ void CVideoDatabase::DeleteMovie(int idMovie, bool bKeepId /* = false */)
// the ancilliary tables are still purged
if (!bKeepId)
{
strSQL=PrepareSQL("delete from movie where idMovie=%i", idMovie);
m_pDS->exec(strSQL.c_str());

// TODO: Why are we invalidating paths here?
int idFile = GetDbId(PrepareSQL("SELECT idFile FROM movie WHERE idMovie=%i", idMovie));
std::string path = GetSingleValue(PrepareSQL("SELECT strPath FROM path JOIN files ON files.idPath=path.idPath WHERE files.idFile=%i", idFile));
if (!path.empty())
InvalidatePathHash(path);

strSQL=PrepareSQL("delete from movie where idMovie=%i", idMovie);
m_pDS->exec(strSQL.c_str());
}

//TODO: move this below CommitTransaction() once UPnP doesn't rely on this anymore
Expand Down Expand Up @@ -3403,14 +3402,13 @@ void CVideoDatabase::DeleteMusicVideo(int idMVideo, bool bKeepId /* = false */)
// the ancilliary tables are still purged
if (!bKeepId)
{
strSQL=PrepareSQL("delete from musicvideo where idMVideo=%i", idMVideo);
m_pDS->exec(strSQL.c_str());

// TODO: Why are we invalidating paths here?
int idFile = GetDbId(PrepareSQL("SELECT idFile FROM musicvideo WHERE idMVideo=%i", idMVideo));
std::string path = GetSingleValue(PrepareSQL("SELECT strPath FROM path JOIN files ON files.idPath=path.idPath WHERE files.idFile=%i", idFile));
if (!path.empty())
InvalidatePathHash(path);

strSQL=PrepareSQL("delete from musicvideo where idMVideo=%i", idMVideo);
m_pDS->exec(strSQL.c_str());
}

//TODO: move this below CommitTransaction() once UPnP doesn't rely on this anymore
Expand Down

0 comments on commit a693300

Please sign in to comment.