While I'm at it, remove leading and trailing slashes to make the cache files look like "Songs_foo" instead of "_Songs_foo_".
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
#include <set>
|
||||
#include <float.h>
|
||||
|
||||
const int FILE_CACHE_VERSION = 146; // increment this to invalidate cache
|
||||
const int FILE_CACHE_VERSION = 147; // increment this to invalidate cache
|
||||
|
||||
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;
|
||||
|
||||
|
||||
@@ -33,7 +33,12 @@ RString SongCacheIndex::GetCacheFilePath( const RString &sGroup, const RString &
|
||||
{
|
||||
/* Don't use GetHashForFile, since we don't want to spend time
|
||||
* checking the file size and date. */
|
||||
RString s = sPath;
|
||||
RString s;
|
||||
|
||||
if( sPath.size() > 2 && sPath[0] == '/' && sPath[sPath.size()-1] == '/' )
|
||||
s.assign( sPath, 1, sPath.size() - 2 );
|
||||
else
|
||||
s = sPath;
|
||||
/* Change slashes and invalid utf-8 characters to _.
|
||||
* http://en.wikipedia.org/wiki/UTF-8
|
||||
* Mac OS X doesn't support precomposed unicode characters in files names and
|
||||
|
||||
Reference in New Issue
Block a user