Skip to content

Commit

Permalink
[PVR] EPG search: Fix support for empty search phrase (only "" given).
Browse files Browse the repository at this point in the history
  • Loading branch information
ksooo committed Sep 17, 2024
1 parent 11b6b24 commit c3ba281
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xbmc/pvr/epg/EpgDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "(";
Expand Down Expand Up @@ -754,10 +756,9 @@ std::vector<std::shared_ptr<CPVREpgInfoTag>> 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");

Expand Down

0 comments on commit c3ba281

Please sign in to comment.