Skip to content

Commit

Permalink
cache smartplaylists using a unique cachename so that they can be cle…
Browse files Browse the repository at this point in the history
…ared on either music or video scan. Closes xbmc#12686
  • Loading branch information
Jonathan Marshall committed Feb 23, 2012
1 parent e6dbf16 commit 4e1458d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xbmc/FileItem.cpp
Expand Up @@ -2361,6 +2361,8 @@ CStdString CFileItemList::GetDiscCacheFile(int windowID) const
cacheFile.Format("special://temp/mdb-%08x.fi", (unsigned __int32)crc);
else if (IsVideoDb())
cacheFile.Format("special://temp/vdb-%08x.fi", (unsigned __int32)crc);
else if (IsSmartPlayList())
cacheFile.Format("special://temp/sp-%08x.fi", (unsigned __int32)crc);
else if (windowID)
cacheFile.Format("special://temp/%i-%08x.fi", windowID, (unsigned __int32)crc);
else
Expand Down
2 changes: 2 additions & 0 deletions xbmc/Util.cpp
Expand Up @@ -1638,11 +1638,13 @@ CStdString CUtil::VideoPlaylistsLocation()
void CUtil::DeleteMusicDatabaseDirectoryCache()
{
CUtil::DeleteDirectoryCache("mdb-");
CUtil::DeleteDirectoryCache("sp-"); // overkill as it will delete video smartplaylists, but as we can't differentiate based on URL...
}

void CUtil::DeleteVideoDatabaseDirectoryCache()
{
CUtil::DeleteDirectoryCache("vdb-");
CUtil::DeleteDirectoryCache("sp-"); // overkill as it will delete music smartplaylists, but as we can't differentiate based on URL...
}

void CUtil::DeleteDirectoryCache(const CStdString &prefix)
Expand Down

0 comments on commit 4e1458d

Please sign in to comment.