2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2018-08-02 13:54:36 +02:00
|
|
|
|
|
|
|
#include "BaseSongFilter.hxx"
|
2018-11-02 19:15:08 +01:00
|
|
|
#include "Escape.hxx"
|
2018-08-02 13:54:36 +02:00
|
|
|
#include "LightSong.hxx"
|
2019-08-09 15:54:13 +02:00
|
|
|
#include "util/UriRelative.hxx"
|
2018-08-02 13:54:36 +02:00
|
|
|
|
|
|
|
std::string
|
|
|
|
BaseSongFilter::ToExpression() const noexcept
|
|
|
|
{
|
2018-11-02 19:15:08 +01:00
|
|
|
return "(base \"" + EscapeFilterString(value) + "\")";
|
2018-08-02 13:54:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BaseSongFilter::Match(const LightSong &song) const noexcept
|
|
|
|
{
|
|
|
|
return uri_is_child_or_same(value.c_str(), song.GetURI().c_str());
|
|
|
|
}
|