Jenny Rom bug: fix songs with '=' in the pathname not being loaded from cache.
This commit is contained in:
@@ -55,13 +55,21 @@ void SongCacheIndex::ReadCacheIndex()
|
|||||||
void SongCacheIndex::AddCacheIndex(const CString &path, unsigned hash)
|
void SongCacheIndex::AddCacheIndex(const CString &path, unsigned hash)
|
||||||
{
|
{
|
||||||
CacheIndex.SetValueI( "Cache", "CacheVersion", FILE_CACHE_VERSION );
|
CacheIndex.SetValueI( "Cache", "CacheVersion", FILE_CACHE_VERSION );
|
||||||
CacheIndex.SetValueU( "Cache", path, hash );
|
CacheIndex.SetValueU( "Cache", MangleName(path), hash );
|
||||||
CacheIndex.WriteFile();
|
CacheIndex.WriteFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned SongCacheIndex::GetCacheHash( const CString &path ) const
|
unsigned SongCacheIndex::GetCacheHash( const CString &path ) const
|
||||||
{
|
{
|
||||||
unsigned iDirHash;
|
unsigned iDirHash;
|
||||||
CacheIndex.GetValueU( "Cache", path, iDirHash );
|
CacheIndex.GetValueU( "Cache", MangleName(path), iDirHash );
|
||||||
return iDirHash;
|
return iDirHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString SongCacheIndex::MangleName( const CString &Name )
|
||||||
|
{
|
||||||
|
/* We store paths in an INI. We can't store '='. */
|
||||||
|
CString ret = Name;
|
||||||
|
ret.Replace( "=", "");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
class SongCacheIndex {
|
class SongCacheIndex {
|
||||||
IniFile CacheIndex;
|
IniFile CacheIndex;
|
||||||
|
static CString MangleName( const CString &Name );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SongCacheIndex();
|
SongCacheIndex();
|
||||||
~SongCacheIndex();
|
~SongCacheIndex();
|
||||||
|
|||||||
Reference in New Issue
Block a user