Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception for "list <tag> title <something>" #27

Closed
kingosticks opened this issue Apr 16, 2020 · 0 comments
Closed

Unhandled exception for "list <tag> title <something>" #27

kingosticks opened this issue Apr 16, 2020 · 0 comments
Assignees
Labels
C-bug Category: This is a bug
Milestone

Comments

@kingosticks
Copy link
Member

We don't support the title tag in our filtering of list output. For example the command:

list artist title "something like avalanches"

does not complete properly and we get:

MpdSession-18 ERROR    2020-04-16 23:59:31,764 Unhandled exception in MpdSession (urn:uuid:9b7cefd5-7466-460c-a461-2950f2f0ea39):
Traceback (most recent call last):
  File "/home/nick/.virtualenvs/mopidy3/lib/python3.7/site-packages/pykka/_actor.py", line 193, in _actor_loop
    response = self._handle_receive(envelope.message)
  File "/home/nick/.virtualenvs/mopidy3/lib/python3.7/site-packages/pykka/_actor.py", line 307, in _handle_receive
    return self.on_receive(message)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/network.py", line 443, in on_receive
    self.on_line_received(line)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/session.py", line 32, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 69, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 77, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 69, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 90, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 69, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 106, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 69, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 139, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 69, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 152, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 69, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 164, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/dispatcher.py", line 178, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/protocol/__init__.py", line 212, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/protocol/__init__.py", line 170, in validate
    return func(*args, **kwargs)
  File "/home/nick/Dev/mopidy-dev/mopidy-mpd/mopidy_mpd/protocol/music_db.py", line 292, in list_
    return [(name, value) for value in result.get()]
  File "/home/nick/.virtualenvs/mopidy3/lib/python3.7/site-packages/pykka/_threading.py", line 45, in get
    _compat.reraise(*self._data['exc_info'])
  File "/home/nick/.virtualenvs/mopidy3/lib/python3.7/site-packages/pykka/_compat/__init__.py", line 29, in reraise
    raise value
  File "/home/nick/.virtualenvs/mopidy3/lib/python3.7/site-packages/pykka/_actor.py", line 193, in _actor_loop
    response = self._handle_receive(envelope.message)
  File "/home/nick/.virtualenvs/mopidy3/lib/python3.7/site-packages/pykka/_actor.py", line 299, in _handle_receive`
    return callee(*message.args, **message.kwargs)
  File "/home/nick/Dev/mopidy-dev/mopidy/mopidy/core/library.py", line 137, in get_distinct
    query is None or validation.check_query(query)  # TODO: normalize?
  File "/home/nick/Dev/mopidy-dev/mopidy/mopidy/internal/validation.py", line 109, in check_query
    msg="Expected query field to be one of " "{choices}, not {arg!r}",
  File "/home/nick/Dev/mopidy-dev/mopidy/mopidy/internal/validation.py", line 62, in check_choice
    msg.format(arg=arg, choices=tuple(choices))
mopidy.exceptions.ValidationError: Expected query field to be one of ('performer', 'albumartist', 'album', 'artist', 'date', 'track_name', 'genre', 'composer', 'any', 'comment', 'musicbrainz_albumid', 'track_no', 'uri'), not 'track'

This is because we are using the _LIST_MAPPING instead of _SEARCH_MAPPING to transform the filter query keys into what Mopidy Core expects ('track' -> 'track_name').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants