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

Artist detail view is broken #42

Open
mgoltzsche opened this issue Dec 23, 2023 · 0 comments · May be fixed by #43
Open

Artist detail view is broken #42

mgoltzsche opened this issue Dec 23, 2023 · 0 comments · May be fixed by #43

Comments

@mgoltzsche
Copy link
Contributor

Trying to access the artist detail view fails with the following error in case of some artists:

ERROR    2023-12-23 04:09:39,971 [1:Core-12 (_actor_loop)] mopidy.core.library
  BeetsBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/mopidy/core/library.py", line 17, in _backend_error_handling
    yield
  File "/usr/local/lib/python3.12/site-packages/mopidy/core/library.py", line 230, in lookup
    result = future.get()
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pykka/_threading.py", line 68, in get
    raise exc_value
  File "/usr/local/lib/python3.12/site-packages/pykka/_actor.py", line 238, in _actor_loop_running
    response = self._handle_receive(envelope.message)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pykka/_actor.py", line 349, in _handle_receive
    return callee(*message.args, **message.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/mopidy_beets/library.py", line 169, in lookup
    tracks.sort(key=lambda t: (t.date, t.disc_no, t.track_no))
TypeError: '<' not supported between instances of 'int' and 'NoneType'

It looks like this happens when some tracks are missing some of the date, disc and track values that are supposed to be used as sort keys.

mgoltzsche added a commit to mgoltzsche/mopidy-beets that referenced this issue Dec 26, 2023
...by falling back to using `0` when a sort key is `None`.
This makes the artist detail view also show up when one of the artist's tracks is missing a field that is used for sorting.

Closes mopidy#42
mgoltzsche added a commit to mgoltzsche/mopidy-beets that referenced this issue Dec 26, 2023
...by falling back to using `0` when a sort key is `None`.
This makes the artist detail view also show up when one of the artist's tracks is missing a field that is used for sorting.

Closes mopidy#42
@mgoltzsche mgoltzsche linked a pull request Dec 26, 2023 that will close this issue
mgoltzsche added a commit to mgoltzsche/mopidy-beets that referenced this issue Jan 11, 2024
...by falling back to using `0` when a sort key is `None`.
This makes the artist detail view also show up when one of the artist's tracks is missing a field that is used for sorting.

Closes mopidy#42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant