command/file: cache the last "albumart" file

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1156
This commit is contained in:
Max Kellermann
2021-05-18 16:41:48 +02:00
parent e1e41708af
commit dbb18a401b
4 changed files with 21 additions and 4 deletions

View File

@@ -23,6 +23,7 @@
#include "Message.hxx"
#include "command/CommandResult.hxx"
#include "command/CommandListBuilder.hxx"
#include "input/LastInputStream.hxx"
#include "tag/Mask.hxx"
#include "event/FullyBufferedSocket.hxx"
#include "event/TimerEvent.hxx"
@@ -90,6 +91,13 @@ public:
*/
size_t binary_limit = 8192;
/**
* This caches the last "albumart" InputStream instance, to
* avoid repeating the search for each chunk requested by this
* client.
*/
LastInputStream last_album_art;
private:
static constexpr size_t MAX_SUBSCRIPTIONS = 16;