summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Morgan <smorgan@mythtv.org>2011-01-21 11:06:29 (GMT)
committer Stuart Morgan <smorgan@mythtv.org>2011-01-21 11:06:29 (GMT)
commitcfdd72e88d39c1d371fcc272ed5756bbb782b142 (patch)
tree64760a22587f851c351bb51f65e7a86a4423b40b
parent98335e9e1a2fc32c866ce72fbc8c5f9a20b912d5 (diff)
Do not lower case when comparing paths, these are case sensitive comparisons and can result in broken paths being used.
-rw-r--r--mythplugins/mythmusic/mythmusic/filescanner.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/mythplugins/mythmusic/mythmusic/filescanner.cpp b/mythplugins/mythmusic/mythmusic/filescanner.cpp
index 291a5a0..f956d25 100644
--- a/mythplugins/mythmusic/mythmusic/filescanner.cpp
+++ b/mythplugins/mythmusic/mythmusic/filescanner.cpp
@@ -22,7 +22,7 @@ FileScanner::FileScanner ()
MSqlQuery query(MSqlQuery::InitCon());
// Cache the directory ids from the database
- query.prepare("SELECT directory_id, LOWER(path) FROM music_directories");
+ query.prepare("SELECT directory_id, path FROM music_directories");
if (query.exec())
{
while(query.next())
@@ -109,12 +109,12 @@ void FileScanner::BuildFileList(QString &directory, MusicLoadedMap &music_files,
QString dir(filename);
dir.remove(0, m_startdir.length());
- newparentid = m_directoryid[dir.toLower()];
+ newparentid = m_directoryid[dir];
if (newparentid == 0)
{
int id = GetDirectoryId(dir, parentid);
- m_directoryid[dir.toLower()] = id;
+ m_directoryid[dir] = id;
if (id > 0)
{
@@ -252,7 +252,7 @@ void FileScanner::AddFileToDB(const QString &filename)
query.prepare("INSERT INTO music_albumart SET filename = :FILE, "
"directory_id = :DIRID, imagetype = :TYPE;");
query.bindValue(":FILE", name);
- query.bindValue(":DIRID", m_directoryid[directory.toLower()]);
+ query.bindValue(":DIRID", m_directoryid[directory]);
query.bindValue(":TYPE", AlbumArtImages::guessImageType(name));
if (!query.exec() || query.numRowsAffected() <= 0)
@@ -273,7 +273,7 @@ void FileScanner::AddFileToDB(const QString &filename)
QString album_cache_string;
// Set values from cache
- int did = m_directoryid[directory.toLower()];
+ int did = m_directoryid[directory];
if (did > 0)
data->setDirectoryId(did);
@@ -444,7 +444,7 @@ void FileScanner::RemoveFileFromDB (const QString &filename)
query.prepare("DELETE FROM music_albumart WHERE filename= :FILE AND "
"directory_id= :DIRID;");
query.bindValue(":FILE", sqlfilename);
- query.bindValue(":DIRID", m_directoryid[directory.toLower()]);
+ query.bindValue(":DIRID", m_directoryid[directory]);
if (!query.exec() || query.numRowsAffected() <= 0)
{
@@ -489,7 +489,7 @@ void FileScanner::UpdateFileInDB(const QString &filename)
QString album_cache_string;
// Set values from cache
- int did = m_directoryid[directory.toLower()];
+ int did = m_directoryid[directory];
if (did > 0)
disk_meta->setDirectoryId(did);