Skip to content

Commit

Permalink
[Updated] Adjust the logic for bouquet search to support regex
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarCC committed Sep 23, 2024
1 parent 7131200 commit fb6a2e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dvb/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <fstream>
#include <stdexcept>
#include <exception>
#include <regex>

/*
* Copyright (C) 2017 Marcus Metzler <[email protected]>
Expand Down Expand Up @@ -2677,7 +2678,7 @@ RESULT eDVBDB::removeBouquet(const std::string &filename)
if (entry->d_type == DT_REG)
{
std::string path = entry->d_name;
if (path.find(filename) != std::string::npos)
if (std::regex_search(path, std::regex("^" + filename + "$")))
{
std::string bouquetquery = "FROM BOUQUET \"" + path + "\" ORDER BY bouquet";
eServiceReference bouquetref(eServiceReference::idDVB, eServiceReference::flagDirectory, bouquetquery);
Expand Down

0 comments on commit fb6a2e6

Please sign in to comment.