From c3ba2817d431da7382b2528d82b10b23bdb0afa6 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:59:17 +0200 Subject: [PATCH] [PVR] EPG search: Fix support for empty search phrase (only "" given). --- xbmc/pvr/epg/EpgDatabase.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xbmc/pvr/epg/EpgDatabase.cpp b/xbmc/pvr/epg/EpgDatabase.cpp index c0550f467ab65..7c17c0390993f 100644 --- a/xbmc/pvr/epg/EpgDatabase.cpp +++ b/xbmc/pvr/epg/EpgDatabase.cpp @@ -562,6 +562,8 @@ class CSearchTermConverter public: explicit CSearchTermConverter(const std::string& strSearchTerm) { Parse(strSearchTerm); } + bool HasSearchTerm() const { return !m_fragments.empty(); } + std::string ToSQL(const std::string& strFieldName) const { std::string result = "("; @@ -754,10 +756,9 @@ std::vector> CPVREpgDatabase::GetEpgTags( // search term ///////////////////////////////////////////////////////////////////////////////////////////// - if (!searchData.m_strSearchTerm.empty()) + const CSearchTermConverter conv{searchData.m_strSearchTerm}; + if (conv.HasSearchTerm()) { - const CSearchTermConverter conv(searchData.m_strSearchTerm); - // title std::string strWhere = conv.ToSQL("sTitle");