aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Blake <oak99sky@yahoo.co.uk>2020-10-05 14:34:02 +0100
committerGitHub <noreply@github.com>2020-10-05 14:34:02 +0100
commit67fae47f3940e998a2f065c95d7858749cd3e225 (patch)
treed1c891894157ca2bb2b76f671dce7757c43795c5
parent32f8b0600345026af4d5c134cdf2e34edfdfd5e7 (diff)
parent620c237201dcd680254b7b1df235000cba4796e2 (diff)
Merge pull request #18460 from olympia/SearchInOriginaltitle
Check original title during movie search
-rw-r--r--xbmc/video/VideoDatabase.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index b3ae9348e3..41e25b08c7 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -8564,9 +8564,17 @@ void CVideoDatabase::GetMoviesByName(const std::string& strSearch, CFileItemList
return;
if (m_profileManager.GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE && !g_passwordManager.bMasterUser)
- strSQL = PrepareSQL("SELECT movie.idMovie, movie.c%02d, path.strPath, movie.idSet FROM movie INNER JOIN files ON files.idFile=movie.idFile INNER JOIN path ON path.idPath=files.idPath WHERE movie.c%02d LIKE '%%%s%%'", VIDEODB_ID_TITLE, VIDEODB_ID_TITLE, strSearch.c_str());
+ strSQL = PrepareSQL("SELECT movie.idMovie, movie.c%02d, path.strPath, movie.idSet FROM movie "
+ "INNER JOIN files ON files.idFile=movie.idFile INNER JOIN path ON "
+ "path.idPath=files.idPath "
+ "WHERE movie.c%02d LIKE '%%%s%%' OR movie.c%02d LIKE '%%%s%%'",
+ VIDEODB_ID_TITLE, VIDEODB_ID_TITLE, strSearch.c_str(),
+ VIDEODB_ID_ORIGINALTITLE, strSearch.c_str());
else
- strSQL = PrepareSQL("select movie.idMovie,movie.c%02d, movie.idSet from movie where movie.c%02d like '%%%s%%'",VIDEODB_ID_TITLE,VIDEODB_ID_TITLE,strSearch.c_str());
+ strSQL = PrepareSQL("SELECT movie.idMovie,movie.c%02d, movie.idSet FROM movie WHERE "
+ "movie.c%02d like '%%%s%%' OR movie.c%02d LIKE '%%%s%%'",
+ VIDEODB_ID_TITLE, VIDEODB_ID_TITLE, strSearch.c_str(),
+ VIDEODB_ID_ORIGINALTITLE, strSearch.c_str());
m_pDS->query( strSQL );
while (!m_pDS->eof())