Open codyfish opened 4 years ago
Yeah this seems to be an entirely new issue. So far most issues have been not finding files needed for album arts, whereas this seems to be a problem with mpd.MpdClient.
Could you try album add and song add as well?
How are you normally searching for songs in your database.?
If you use mpc, does mpc list artist "(artist =~ '(?i)muse.*$')"
work?
Edit: https://github.com/beetbox/beets/pull/3215 seems to be similar.
Could your try mpc list 'albumartist' "(artist =~ '(?i)eminem.*$')"
as well?
Hi, yes, I can have a look at it. but not today. I keep you posted.
No problem, thanks for your contribution!
This may help:
mpc version
mpd version: 0.21.4
mpd -V
Music Player Daemon 0.21.5 (0.21.5)
lsb_release -a
No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster
===
mpc list artist "(artist =~ '(?i)muse.*$')"
arguments must be pairs of search types and queries The the output is the list of all the artists.
mpc list 'albumartist' "(artist =~ '(?i)eminem.*$')
arguments must be pairs of search types and queries The the output is the list of all the artists.
mpc search artist eminem
Works by displaying all song from Eminem. (not that it is case insensitive)
mpc search '(( artist =~ 'Eminem' ))'
arguments must be pairs of search types and queries mpd error: too few arguments for "search" No result
mpc search '((artist == "Muse"))'
arguments must be pairs of search types and queries mpd error: too few arguments for "search"
I have the same issue, I'll try and see if I can fix it
Sorry for my late answer.
Do you use mpd with perl support. The queries right now are using perl regexes to filter songs case insensitive.
https://www.musicpd.org/doc/html/protocol.html#filters
Reimplementing this could take some time. If you want to, I would be happy if you tried/helped of course
I have mpd version 0.21.22 It shows a lot more plugins and information than yours does, however none of it seems to refer to perl regexes.
Trying to add-song
or add-album
results in the following exception (this is on Arch):
com.github.codyfish.ulauncher-mpd | 2020-04-12 19:53:26,379 | DEBUG | mpd.base: _write_command() | Calling MPD play('96',) Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/ulauncher/api/client/Client.py", line 54, in on_message self.extension.trigger_event(event) File "/usr/lib/python3.8/site-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event action = listener.on_event(event, self) File "~/.local/share/ulauncher/extensions/com.github.codyfish.ulauncher-mpd/main.py", line 47, in on_event self.__mpd_controller.execute(command) File "~/.local/share/ulauncher/extensions/com.github.codyfish.ulauncher-mpd/MpdController.py", line 97, in execute if not self.ensure_connection(): File "/usr/lib/python3.8/site-packages/mpd/base.py", line 381, in mpd_command return wrapper(self, name, args, callback) File "/usr/lib/python3.8/site-packages/mpd/base.py", line 473, in _execute return retval() File "/usr/lib/python3.8/site-packages/mpd/base.py", line 368, in command_callback res = function(self, self._read_lines()) File "/usr/lib/python3.8/site-packages/mpd/base.py", line 311, in _parse_nothing for line in lines: File "/usr/lib/python3.8/site-packages/mpd/base.py", line 538, in _read_lines line = self._read_line() File "/usr/lib/python3.8/site-packages/mpd/base.py", line 527, in _read_line raise CommandError(error) mpd.base.CommandError: [2@0] {play} Bad song index
I always seem to run into this call: Calling MPD play('96',)
I am moving this to a new issue as it doesn't seen to have anything todo with the perl regexes. I am on arch as well so the version shouldn't be the problem. Do song-insert and album-insert work?
Hello @codyfish , any updates on this ? Do you need anything from me ?
So, as I've mentioned above, the issue seems to be that there are different mpd (and probably mpc) versions out there. Those who are compiled with perl support should work fine with this extension (note that bretello's issue could be solved, he is on the same distro as I am). I haven't found a nice alternative to using regex for fuzzy finding, and that's a feature I personally use a lot. At the moment, I sadly do not have enough time to install a different mpd version on a vm, for example, and fix this issue. Maybe I'll have enough during summer.
What you could do:
artist_results = client.list('artist', "(artist =~ '(?i){}.*$')".format(args))
with artist_results=client.list("artist","artist",args)
. This would not be case insensitive and would not work for filenames.@ragusa87, a few days ago, there has been an update from python-mpd2 to version 1.1.0. It broke some of my code (which should be fixed now). I highly doubt that this changes anything for you though.
@codyfish Hello, I switched from mpd
to mopidy
(v3.0.2) with Mopidy-MPD plugin (v3.0.0). The protocol implementation is totally custom (and oldish). It may be a way to start without having to install mpd on a VM.
Sorry but I have no time neither to fix the issue. It's not a big deal for me anyway, the rest is working quite smoothly.
Regarding python-mpd2, the update is still not available to me. Let's wait and see.
pip3 install -U --user python-mpd2
> Requirement already up-to-date: python-mpd2 in ./.local/lib/python3.8/site-packages (1.0.0)
Have a nice day,
Surprisingly, I do actually have some time at the moment.
Does mpc list artist
work for you? If so, I could implement my own regex feature for that list.
Hi, no it doesn't. I type "mpd artist-add" and press enter I got an entry with "loading..." I type "mpd artist-add muse" I got an entry with "loading..." and an exception in the console.
Maybe it should be handled in a different issue ?
Originally posted by @ragusa87 in https://github.com/codyfish/ulauncher-mpd/issues/2#issuecomment-611037814