Skip to content

Commit

Permalink
Fix delete query by hash and hash+dir
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Feb 10, 2018
1 parent 7c70b82 commit 9b0eeca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SongCacheIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void SongCacheIndex::DeleteSongFromDBByCondition(string& condition)
}
void SongCacheIndex::DeleteSongFromDB(Song* songPtr)
{
string cond = "dir = " + songPtr->GetSongDir() + " AND hash = " + to_string(GetHashForDirectory(songPtr->GetSongDir()));
string cond = "dir = \"" + songPtr->GetSongDir() + "\" AND hash = \"" + to_string(GetHashForDirectory(songPtr->GetSongDir()))+ "\"";
DeleteSongFromDBByCondition(cond);
}
void SongCacheIndex::DeleteSongFromDBByDir(string dir)
Expand All @@ -681,7 +681,7 @@ void SongCacheIndex::DeleteSongFromDBByDir(string dir)
}
void SongCacheIndex::DeleteSongFromDBByDirHash(unsigned int hash)
{
string cond = "hash=" + to_string(hash);
string cond = "hash=\"" + to_string(hash)+"\"";
DeleteSongFromDBByCondition(cond);
}
void SongCacheIndex::ReadFromDisk()
Expand Down

0 comments on commit 9b0eeca

Please sign in to comment.