diff options
author | Jonathan Marshall <jmarshall@xbmc.org> | 2014-01-11 08:10:05 +1300 |
---|---|---|
committer | Jonathan Marshall <jmarshall@xbmc.org> | 2014-01-11 08:12:51 +1300 |
commit | 18eef75317c1ce24bf8cb003ad057ad57c38789a (patch) | |
tree | e77254a2572759f8e10f763583c192ada389a907 | |
parent | 3751d143f20aa8d9d8f527d4044f86c35a31dc43 (diff) |
[musicdb] use LIKE rather than equals when adding artists+albums so the compare is case-insensitive. Fixes #14834
-rw-r--r-- | xbmc/music/MusicDatabase.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index 2d9ecfaa3d..dc8d9f9568 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -759,7 +759,7 @@ int CMusicDatabase::AddAlbum(const CStdString& strAlbum, const CStdString& strMu strSQL = PrepareSQL("SELECT * FROM album WHERE strMusicBrainzAlbumID = '%s'", strMusicBrainzAlbumID.c_str()); else - strSQL = PrepareSQL("SELECT * FROM album WHERE strArtists = '%s' AND strAlbum like '%s' and strMusicBrainzAlbumID IS NULL", + strSQL = PrepareSQL("SELECT * FROM album WHERE strArtists LIKE '%s' AND strAlbum LIKE '%s' AND strMusicBrainzAlbumID IS NULL", strArtist.c_str(), strAlbum.c_str()); m_pDS->query(strSQL.c_str()); @@ -1083,7 +1083,7 @@ int CMusicDatabase::AddArtist(const CStdString& strArtist, const CStdString& str // 1.b) No match on MusicBrainz ID. Look for a previously added artist with no MusicBrainz ID // and update that if it exists. - strSQL = PrepareSQL("SELECT * FROM artist WHERE strArtist = '%s' AND strMusicBrainzArtistID IS NULL", strArtist.c_str()); + strSQL = PrepareSQL("SELECT * FROM artist WHERE strArtist LIKE '%s' AND strMusicBrainzArtistID IS NULL", strArtist.c_str()); m_pDS->query(strSQL.c_str()); if (m_pDS->num_rows() > 0) { @@ -1104,7 +1104,7 @@ int CMusicDatabase::AddArtist(const CStdString& strArtist, const CStdString& str } else { - strSQL = PrepareSQL("SELECT * FROM artist WHERE strArtist = '%s'", + strSQL = PrepareSQL("SELECT * FROM artist WHERE strArtist LIKE '%s'", strArtist.c_str()); m_pDS->query(strSQL.c_str()); |