summaryrefslogtreecommitdiff
path: root/src/db/plugins
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-10-28 17:33:10 +0100
committerMax Kellermann <max@musicpd.org>2020-10-28 17:33:10 +0100
commitbb99cf37e3f48c851bea671566cd9923d771396d (patch)
treebeac1e78e7261e54e20eeceeab71a4aaa889ef23 /src/db/plugins
parent7c47fe746cf2eb45863532201339de6f230f4bff (diff)
parentdc432f3ffa9b1c8a60b9224c0ae00a40b8b819d1 (diff)
Merge tag 'v0.22.2' into master
release v0.22.2
Diffstat (limited to 'src/db/plugins')
-rw-r--r--src/db/plugins/simple/Directory.hxx8
-rw-r--r--src/db/plugins/simple/Song.cxx8
-rw-r--r--src/db/plugins/simple/Song.hxx10
3 files changed, 26 insertions, 0 deletions
diff --git a/src/db/plugins/simple/Directory.hxx b/src/db/plugins/simple/Directory.hxx
index 7062e609c..1479b578a 100644
--- a/src/db/plugins/simple/Directory.hxx
+++ b/src/db/plugins/simple/Directory.hxx
@@ -133,6 +133,14 @@ public:
}
/**
+ * Checks whether this is a "special" directory
+ * (e.g. #DEVICE_PLAYLIST) and whether the underlying plugin
+ * is available.
+ */
+ gcc_pure
+ bool IsPluginAvailable() const noexcept;
+
+ /**
* Remove this #Directory object from its parent and free it. This
* must not be called with the root Directory.
*
diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx
index 3da13b9ea..eecf00277 100644
--- a/src/db/plugins/simple/Song.cxx
+++ b/src/db/plugins/simple/Song.cxx
@@ -34,6 +34,14 @@ Song::Song(DetachedSong &&other, Directory &_parent) noexcept
{
}
+const char *
+Song::GetFilenameSuffix() const noexcept
+{
+ return target.empty()
+ ? PathTraitsUTF8::GetFilenameSuffix(filename.c_str())
+ : PathTraitsUTF8::GetPathSuffix(target.c_str());
+}
+
std::string
Song::GetURI() const noexcept
{
diff --git a/src/db/plugins/simple/Song.hxx b/src/db/plugins/simple/Song.hxx
index 04be80845..90334b031 100644
--- a/src/db/plugins/simple/Song.hxx
+++ b/src/db/plugins/simple/Song.hxx
@@ -108,6 +108,16 @@ struct Song {
Song(DetachedSong &&other, Directory &_parent) noexcept;
+ gcc_pure
+ const char *GetFilenameSuffix() const noexcept;
+
+ /**
+ * Checks whether the decoder plugin for this song is
+ * available.
+ */
+ gcc_pure
+ bool IsPluginAvailable() const noexcept;
+
/**
* allocate a new song structure with a local file name and attempt to
* load its metadata. If all decoder plugin fail to read its meta