summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-06-23 20:46:50 +0200
committerMax Kellermann <max@musicpd.org>2021-06-23 20:49:30 +0200
commit5019bdcd5298541a191d9824b8e5c8aff9fdbca1 (patch)
tree048e18fa90d03c6808ddec13ee6942eef7b60ebd
parent8be0bcbdb9acbfd093ddc0cd907daa217cc99d11 (diff)
TagAny: invoke ScanGenericTags() on remote files
This fixes reading ID3 tags on remote files with the commands "readcomments" and "readpicture". Closes https://github.com/MusicPlayerDaemon/MPD/issues/1180
-rw-r--r--NEWS2
-rw-r--r--src/TagAny.cxx8
2 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f86f7d631..ef1a70797 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
ver 0.22.9 (not yet released)
* database
- simple: load all .mpdignore files of all parent directories
+* tags
+ - fix "readcomments" and "readpicture" on remote files with ID3 tags
* decoder
- ffmpeg: support the tags "sort_album", "album-sort", "artist-sort"
- ffmpeg: fix build failure with FFmpeg 3.4
diff --git a/src/TagAny.cxx b/src/TagAny.cxx
index faa237b4c..6f875846e 100644
--- a/src/TagAny.cxx
+++ b/src/TagAny.cxx
@@ -25,6 +25,7 @@
#include "client/Client.hxx"
#include "protocol/Ack.hxx"
#include "fs/AllocatedPath.hxx"
+#include "input/InputStream.hxx"
#include "util/Compiler.h"
#include "util/UriExtract.hxx"
#include "LocateUri.hxx"
@@ -32,8 +33,13 @@
static void
TagScanStream(const char *uri, TagHandler &handler)
{
- if (!tag_stream_scan(uri, handler))
+ Mutex mutex;
+
+ auto is = InputStream::OpenReady(uri, mutex);
+ if (!tag_stream_scan(*is, handler))
throw ProtocolError(ACK_ERROR_NO_EXIST, "Failed to load file");
+
+ ScanGenericTags(*is, handler);
}
static void