Querying multiple MPD instances at once and displaying results in a common user interface view #2029
-
Hello MPD community, I am working on creating an MPD client that can connect to two MPD servers (on different machines) at once. The different servers are expected to contain different, but similar music directories. E.g. a remote machine could have an older copy of the same music database as the current machine execept that all songs have been resampled to a different sample rate. The client is intended to allow working with this setup by visually indicating (e.g. with colors) when a song is not available on all clients, but in general it is expected to show all songs that are available on at least one client. I am currently thinking about how to implement a list of all songs across all of the servers sorted by a common criterion e.g. lexicographically by artist. For an individual MPD instance, this is easy to do using For multiple servers, it is more complicated, though: I cannot just assume that the same I currently consider two solutions
Is there any alternative to these options for my use case? Which solution would seem more sensible from an MPD point of view? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
General rule: at any given time, you should only query the part of the MPD database that is needed. If you have a million songs, it never makes sense to query all the tags from a million songs - you can't display them anyway.
Do |
Beta Was this translation helpful? Give feedback.
General rule: at any given time, you should only query the part of the MPD database that is needed. If you have a million songs, it never makes sense to query all the tags from a million songs - you can't display them anyway.
If you do display many songs, query only the tags that you will use for that display; use the
tagtypes
command to tell MPD to omit tag values from the response that your client will never show.If you don't actually want to display a list of songs, but a list of artists, don't use the
find
command but insteadlist artist
. Let the server aggregate the result for you.