From 620c237201dcd680254b7b1df235000cba4796e2 Mon Sep 17 00:00:00 2001 From: Olympia Date: Fri, 22 May 2020 17:20:49 +0200 Subject: Check original title during movie search --- xbmc/video/VideoDatabase.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index c852aa0aa4..eeb43a7529 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -8509,9 +8509,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()) -- cgit v1.2.3