Giter VIP home page Giter VIP logo

mopidy-beets's Introduction

Mopidy

Mopidy is an extensible music server written in Python.

Mopidy plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. You edit the playlist from any phone, tablet, or computer using a variety of MPD and web clients.

Stream music from the cloud

Vanilla Mopidy only plays music from files and radio streams. Through extensions, Mopidy can play music from cloud services like Spotify, SoundCloud, and Google Play Music. With Mopidy's extension support, backends for new music sources can be easily added.

Mopidy is just a server

Mopidy is a Python application that runs in a terminal or in the background on Linux computers or Macs that have network connectivity and audio output. Out of the box, Mopidy is an HTTP server. If you install the Mopidy-MPD extension, it becomes an MPD server too. Many additional frontends for controlling Mopidy are available as extensions.

Pick your favorite client

You and the people around you can all connect their favorite MPD or web client to the Mopidy server to search for music and manage the playlist together. With a browser or MPD client, which is available for all popular operating systems, you can control the music from any phone, tablet, or computer.

Mopidy on Raspberry Pi

The Raspberry Pi is a popular device to run Mopidy on, either using Raspbian, Ubuntu, or Arch Linux. Pimoroni recommends Mopidy for use with their Pirate Audio audio gear for Raspberry Pi. Mopidy is also a significant building block in the Pi Musicbox integrated audio jukebox system for Raspberry Pi.

Mopidy is hackable

Mopidy's extension support and Python, JSON-RPC, and JavaScript APIs make Mopidy a perfect base for your projects. In one hack, a Raspberry Pi was embedded in an old cassette player. The buttons and volume control are wired up with GPIO on the Raspberry Pi, and are used to control playback through a custom Mopidy extension. The cassettes have NFC tags used to select playlists from Spotify.

Getting started

To get started with Mopidy, begin by reading the installation docs.

Contributing

Begin by reading the contributing section of our documentation. If you are a developer, please also read Development environment and/or Extension development. We welcome all kinds of help with bug fixing, testing, documentation, and supporting other users.

Project resources

Latest PyPI version CI build status Read the Docs build status Test coverage Chat on Zulip

mopidy-beets's People

Contributors

claman avatar edwardbetts avatar jodal avatar mgoltzsche avatar mkraemer avatar sumpfralle avatar vrs01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mopidy-beets's Issues

Resume doesn't work

When I pause and resume, via mpd/ncmpcpp, nothing happens. It's not a seeking issue, I have the nginx working before beets web and it works fine when i go to specific part of a song.

beets backend json/utf8 errors

I have been having multiple errors when attempting to use mopidy to browse my beets library. I'm not sure what is causing the json error, but I've even added the nginx proxy in case that may have something to do with it. I don't use %asciify names when using beets as I have a large collection of japanese and russian albums that really need UTF-8. I only meniton that in case it sheds light on the issue.

json error

INFO     Beets - invalid sorting field ignore: albumartist
ERROR    BeetsBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/usr/lib/python2.7/site-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/site-packages/mopidy_beets/library.py", line 61, in browse
    ['track+'])
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 49, in _memoized
    return self.func(*args)
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 93, in get_tracks_by
    exact_text, sort_fields)
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 162, in _get_objects_by_attribute
    items = self._get(query_url)['results']
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 259, in _get
    return req.json()
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 858, in json
    self.content.decode(encoding), **kwargs
  File "/usr/lib/python2.7/site-packages/simplejson/__init__.py", line 516, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/site-packages/simplejson/decoder.py", line 374, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python2.7/site-packages/simplejson/decoder.py", line 404, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value or ']': line 1 column 13 (char 12)

UTF-8

ERROR    BeetsBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/usr/lib/python2.7/site-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/site-packages/mopidy_beets/library.py", line 72, in browse
    return browser.get_directory(item_id)
  File "/usr/lib/python2.7/site-packages/mopidy_beets/browsers/albums.py", line 20, in get_directory
    self.sort_fields)
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 49, in _memoized
    return self.func(*args)
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 99, in get_albums_by
    exact_text, sort_fields)
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 149, in _get_objects_by_attribute
    value = quote_and_encode(attribute[1])
  File "/usr/lib/python2.7/site-packages/mopidy_beets/client.py", line 135, in quote_and_encode
    text = text.replace(':', r'\:')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Support searching non-album tracks

Currently, when I search for a singleton track (not part of an album) within my beets library via mopidy-beets, I don't get any result.

Problem

When I enter "Bertrand" into the mopidy search (knowing that I have a matching singleton track within the library), mopidy-beets logs:

ERROR    2023-12-05 23:18:36,143 [1:BeetsBackend-3 (_actor_loop)] mopidy_beets.client
  Beets - Request http://127.0.0.1:8337/album/None, failed with status code 404
WARNING  2023-12-05 23:18:36,143 [1:Core-12 (_actor_loop)] mopidy.core.library
  BeetsBackend does not implement library.search() with "exact" support. Please upgrade it.
ERROR    2023-12-05 23:18:36,155 [1:BeetsBackend-3 (_actor_loop)] mopidy_beets.client
  Beets - Request http://127.0.0.1:8337/album/None, failed with status code 404
WARNING  2023-12-05 23:18:36,155 [1:Core-12 (_actor_loop)] mopidy.core.library
  BeetsBackend does not implement library.search() with "exact" support. Please upgrade it.

Correspondingly, beets logs:

127.0.0.1 - - [05/Dec/2023 23:18:36] "GET /item/query/artist:Bertrand HTTP/1.1" 200 -
127.0.0.1 - - [05/Dec/2023 23:18:36] "GET /album/None HTTP/1.1" 404 -
127.0.0.1 - - [05/Dec/2023 23:18:36] "GET /item/query/Bertrand HTTP/1.1" 200 -
127.0.0.1 - - [05/Dec/2023 23:18:36] "GET /album/None HTTP/1.1" 404 -

Looking into the beets query result JSON shows that the album_id is null, indeed:

$ curl -s http://localhost:8337/item/query/Bertrand
{"results":[{"id": 1, "album_id": null, "title": "\u00c7a plane pour moi", ...

Apparently, mopidy-beets submits the search query to beets correctly, reads the result containing the matching track but then tries to query the containing album although the track is not associated with an album.

Proposed solution

Let mopidy-beets also add singleton tracks (that are not associated with an album) to the search result, not trying to resolve None albums.

Environment

I am using

  • beets 1.6.0
  • mopidy 3.4.2
  • mopidy-beets 4.0.1

Multiple Beets libraries connected to one Mopidy instance

I have several people in an office, each with a Beets library. We have a Raspberry Pi running Mopidy that we'd like to use to play music from all of these libraries. I'd like to be able to specify multiple host/port combinations so that I can load each of these libraries.

Seek doesn't work

Unfortunately it just goes quiet.

ERROR    Could not perform seek on resource. Debug message: gstsouphttpsrc.c(874): gst_soup_http_src_got_headers_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin10/GstSoupHTTPSrc:source:
Server does not accept Range HTTP header, URL: http://pr0:8337/item/35570/file

This is another way in which mopidy doesn't treat beets originating music as a 'first class citizen', including being unable to display things as albums or as artists in web clients like Musicbox or the default client.

Are these things related and is it too ambitious for beets music to be perfectly integrated with local music?

Artist detail view is broken

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.

Missing v3.0.0 tag

Hi,

I maintain archlinux package and it is based on released archive from github.
As for v3.0.0 the tag is missing so the archive does.

Incorrect search results

The search results are a little strange.

Using the mpd frontend,
'search artist "Can"'
returns all tracks with 'can' in them - either the artist name, album name, or track name. This might just be a limitation of beets I think but can you confirm this?

Using the Mopidy HTTP frontend however, I get unusual results -
mopidy.library.search({artist: 'Can'}, ['beets:'])
returns an object with a uri property of 'beets:search-C', which contains every artist beginning with 'A', 'B', or 'C'.

Mopidy 0.14.2 (Ubuntu ppa), and the latest beets and mopidy-beets installed from pip (yesterday).

Search doesn't work

I installed mopidy and tried to connect to a running beets website. Every time I try to search using ncmpcpp or start sonata (I guess sonata tries to search at startup), I'm getting an exception:

ERROR    Request http://localhost:8337/item/, failed with status code 400
ERROR    Unhandled exception in MpdSession (urn:uuid:64d95e14-fd02-440d-97be-2a3fc1c8f4d9):
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/lib64/python2.7/site-packages/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 104, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 133, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 146, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 158, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 167, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 178, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 140, in validate
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/protocol/music_db.py", line 271, in list_
    return _list_artist(context, query)
  File "/usr/lib64/python2.7/site-packages/mopidy/mpd/protocol/music_db.py", line 288, in _list_artist
    results = context.core.library.find_exact(**query).get()
  File "/usr/lib/python2.7/site-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib64/python2.7/site-packages/mopidy/core/library.py", line 118, in find_exact
    return [result for result in pykka.get_all(futures) if result]
  File "/usr/lib/python2.7/site-packages/pykka/future.py", line 330, in get_all
    return [future.get(timeout=timeout) for future in futures]
  File "/usr/lib/python2.7/site-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib64/python2.7/site-packages/mopidy_beets/library.py", line 18, in find_exact
    return self.search(query=query, uris=uris)
  File "/usr/lib64/python2.7/site-packages/mopidy_beets/library.py", line 29, in search
    tracks=self.remote.get_tracks())
  File "/usr/lib64/python2.7/site-packages/mopidy_beets/client.py", line 39, in _memoized
    value = self.func(*args)
  File "/usr/lib64/python2.7/site-packages/mopidy_beets/client.py", line 64, in get_tracks
    track_ids = self._get('/item/').get('item_ids')
AttributeError: 'bool' object has no attribute 'get'

This is the log for sonata, searching with ncmpcpp just changes tu URL.

Looking at the beets log, nothing happened there:

$ beet web
 * Running on http://localhost:8337/

When I enter the requested URL (http://localhost:8337/item/) in my browser, I get a valid response and the beet-log shows the request.

Slashes in genre-names breaks AlbumsCategoryBrowser

Hello!

I use a naming convention in my beets library where I combine related genres together for a more sane browsing experience. For example, I've combined industrial and noisy stuff to 'Industrial/Experimental/Noise', and EBM and techno-y things to 'Techno/EBM/Electro'. Unfortunately, my convention seems to break what AlbumsCategoryBrowser expects as genres, and I'm not seeing any albums for those items in 'Albums By Genre' when I browse.

I looked around the source code to see if I could improve on the functionality, but I soon realized the programming is too advanced for me to keep track of how the information is flowing.. So before I go ahead and touch all the genres of my library and break the generic Albums view in terms of the chronological ordering, I was wondering if it would be easy to fix AlbumsCategoryBrowser to escape slashes so that the items would show up even with the current naming convention?

Looking forward for any insights!

Use 'year' instead of/as well as 'date' for metadata?

I'm running the latest beets, and when I do a query through mopidy-beets none of the tracks have date information, even though I've tagged them using beets. I investigated and found that mopidy-beets is looking for a 'date' field in the JSON data. My version of beets doesn't return a 'date' field but it does return a 'year' field. (Perhaps this is due to me having the beets option 'original_date' set to 'yes'?)

Changing mopidy-beets to use the 'year' field to fill in the 'date' field in the track information resolved the issue for me.

Use beets python API instead of web API?

Recently, beets developers started documenting their python API. IMHO the web plugin is a bit clumsy (there are plans to improve it though) but maybe it makes sense to use the python API instead? This should also allow simplifications of the code base, e.g. the code in client.py could basically be removed then. Furthermore, it doesn't require users to start a separate services (beets web) to interface with beets from mopidy.

Not working with current relases

The mopidy-beets plugin is not working for me. I am using the latest version of mopidy (0.17.0) and latest version of beets (1.3.2) which one is working fine with its own web interface and also Tomahawk media player.

When I try to search something I get the following traceback:

ERROR    Unhandled exception in MpdSession (urn:uuid:87ef5bc1-de71-4f68-830d-6aeb0b3169bf):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/share/mopidy/mopidy/utils/network.py", line 354, in on_receive
    self.on_line_received(line)
  File "/usr/share/mopidy/mopidy/frontends/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 106, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 135, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 148, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 160, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/share/mopidy/mopidy/frontends/mpd/dispatcher.py", line 168, in _call_handler
    return handler(self.context, **kwargs)
  File "/usr/share/mopidy/mopidy/frontends/mpd/protocol/music_db.py", line 327, in list_
    return _list_artist(context, query)
  File "/usr/share/mopidy/mopidy/frontends/mpd/protocol/music_db.py", line 344, in _list_artist
    results = context.core.library.find_exact(**query).get()
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/share/mopidy/mopidy/core/library.py", line 75, in find_exact
    return [result for result in pykka.get_all(futures) if result]
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 330, in get_all
    return [future.get(timeout=timeout) for future in futures]
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/share/mopidy/mopidy_beets/library.py", line 18, in find_exact
    return self.search(query=query, uris=uris)
  File "/usr/share/mopidy/mopidy_beets/library.py", line 29, in search
    tracks=self.remote.get_tracks())
  File "/usr/share/mopidy/mopidy_beets/client.py", line 39, in _memoized
    value = self.func(*args)
  File "/usr/share/mopidy/mopidy_beets/client.py", line 64, in get_tracks
    track_ids = self._get('/item/').get('item_ids')
AttributeError: 'bool' object has no attribute 'get'

On beets I can only see requests made to "GET /item/query/ HTTP/1.1" which results in an error 404.

No album results in browse or search

I'm unsure if this is a beets or a mopidy-beets issue so I start here to report this.
I tested with mopidy-mobile, iris and
python = 3.7.3 for mopidy
python = 3.8.2 for beets
mopidy = 3.0.2
beets = 1.4.9
Mopidy-Beets installed with pip

For testing I have one album in the beets library which I can successfully search for in beets cli and in beets web.

The issue:
If I browse the beets library with mopidy-mobile or iris by "Albums by Artist" I get the album artist but no album. I get no errors or warnings in mopidy.
beets logs:

beets          | 172.16.253.1 - - [26/Aug/2020 13:24:30] "GET /album/query/albumartist:Zola%20Jesus/albumartist::%5EZola%5C%20Jesus%24/original_year%2B/year%2B/album%2B HTTP/1.1" 308 -
beets          | 172.16.253.1 - - [26/Aug/2020 13:24:30] "GET /album/query/albumartist:Zola%20Jesus%2Calbumartist::%5EZola%5C%20Jesus%24%2Coriginal_year+%2Cyear+%2Calbum+ HTTP/1.1" 200 -

If I browse "Albums by Genre" in mopidy-mobile I get the genre but no album.
The logs:

mopidy         | INFO     2020-08-26 11:34:15,605 [1:BeetsBackend-16] mopidy_beets.client                                                                      
mopidy         |   Beets - invalid sorting field ignore: albumartist
beets          | 172.16.253.1 - - [26/Aug/2020 13:34:15] "GET /album/query/genre:J-Pop/genre::%5EJ%5C-Pop%24/original_year%2B/year%2B/album%2B HTTP/1.1" 308 - 
beets          | 172.16.253.1 - - [26/Aug/2020 13:34:15] "GET /album/query/genre:J-Pop%2Cgenre::%5EJ%5C-Pop%24%2Coriginal_year+%2Cyear+%2Calbum+ HTTP/1.1" 200 -

Browsing beets "Albums by Year" mopidy logs:

mopidy         |   BeetsBackend backend caused an exception.                                                                                                    
mopidy         | Traceback (most recent call last):                                                                                                             
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/core/library.py", line 17, in _backend_error_handling                                    
mopidy         |     yield                                                                                                                                      
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/core/library.py", line 114, in _browse                                                   
mopidy         |     result = backend.library.browse(uri).get()                                                                                                 
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/pykka/_threading.py", line 45, in get                                                           
mopidy         |     _compat.reraise(*self._data['exc_info'])                                                                                                   
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/pykka/_compat/__init__.py", line 29, in reraise                                                 
mopidy         |     raise value                                                                                                                                
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/pykka/_actor.py", line 193, in _actor_loop                                                      
mopidy         |     response = self._handle_receive(envelope.message)                                                                                          
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/pykka/_actor.py", line 299, in _handle_receive                                                  
mopidy         |     return callee(*message.args, **message.kwargs)                                                                                             
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy_beets/library.py", line 81, in browse                                                    
mopidy         |     return browser.get_toplevel()                                                                                                              
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy_beets/browsers/albums.py", line 19, in get_toplevel                                      
mopidy         |     for key in keys                                                                                                                            
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy_beets/browsers/albums.py", line 19, in <listcomp>                                        
mopidy         |     for key in keys                                                                                                                            
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/models/__init__.py", line 78, in directory                                               
mopidy         |     return cls(**kwargs)                                                                                                                       
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/models/immutable.py", line 159, in __call__                                              
mopidy         |     instance = super().__call__(*args, **kwargs)                                                                                               
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/models/immutable.py", line 35, in __init__                                               
mopidy         |     self._set_field(key, value)                                                                                                                
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/models/immutable.py", line 188, in _set_field                                            
mopidy         |     object.__setattr__(self, name, value)                                                                                                      
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/models/fields.py", line 50, in __set__                                                   
mopidy         |     value = self.validate(value)                                                                                                               
mopidy         |   File "/usr/local/lib/python3.7/dist-packages/mopidy/models/fields.py", line 35, in validate                                                  
mopidy         |     f"Expected {self._name} to be a {self._type}, not {value!r}"                                                                               
mopidy         | TypeError: Expected name to be a <class 'str'>, not 2014

If I do a beets search for the artist in mopidy-mobile or iris I get:

beets          | 172.16.253.1 - - [26/Aug/2020 13:45:16] "GET /item/query/zola HTTP/1.1" 200 -                                                                                                                                                 
beets          | [2020-08-26 13:45:16,426] ERROR in app: Exception on /album/1 [GET]                                                                                                                                                           
beets          | Traceback (most recent call last):                                                                                                                                                                                            
beets          |   File "/usr/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app                                                                                                                                                
beets          |     ctx.push()                                                                                                                                                                                                                
beets          |   File "/usr/lib/python3.8/site-packages/flask/ctx.py", line 396, in push                                                                                                                                                     
beets          |     self.match_request()
beets          |   File "/usr/lib/python3.8/site-packages/flask/ctx.py", line 350, in match_request
beets          |     result = self.url_adapter.match(return_rule=True)
beets          |   File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 1873, in match
beets          |     rv = rule.match(path, method)
beets          |   File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 902, in match
beets          |     new_path = "|".join(self.build(result, False))
beets          |   File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 1040, in build
beets          |     return self._build(**values)
beets          |   File "<werkzeug routing>", line 1, in <builder:'/album/<idlist:ids>'>
beets          |   File "/usr/lib/python3.8/site-packages/beetsplug/web/__init__.py", line 172, in to_url
beets          |     return ','.join(value)
beets          | TypeError: sequence item 0: expected str instance, int found
beets          | 172.16.253.1 - - [26/Aug/2020 13:45:16] "GET /album/1 HTTP/1.1" 500 -
mopidy         | ERROR    2020-08-26 11:45:16,433 [1:BeetsBackend-16] mopidy_beets.client
mopidy         |   Beets - Request http://172.16.253.1:8337/album/1, failed with status code 500
mopidy         | WARNING  2020-08-26 11:45:16,435 [1:Core-20] mopidy.core.library
mopidy         |   BeetsBackend does not implement library.search() with "exact" support. Please upgrade it.
beets          | 172.16.253.1 - - [26/Aug/2020 13:45:16] "GET /item/query/album:zola HTTP/1.1" 200 -
beets          | 172.16.253.1 - - [26/Aug/2020 13:45:16] "GET /item/query/artist:zola HTTP/1.1" 200 -
beets          | [2020-08-26 13:45:16,592] ERROR in app: Exception on /album/1 [GET]
beets          | Traceback (most recent call last):
beets          |   File "/usr/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
beets          |     ctx.push()
beets          |   File "/usr/lib/python3.8/site-packages/flask/ctx.py", line 396, in push
beets          |     self.match_request()
beets          |   File "/usr/lib/python3.8/site-packages/flask/ctx.py", line 350, in match_request
beets          |     result = self.url_adapter.match(return_rule=True)
beets          |   File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 1873, in match
beets          |     rv = rule.match(path, method)
beets          |   File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 902, in match
beets          |     new_path = "|".join(self.build(result, False))
beets          |   File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 1040, in build
beets          |     return self._build(**values)
beets          |   File "<werkzeug routing>", line 1, in <builder:'/album/<idlist:ids>'>
beets          |   File "/usr/lib/python3.8/site-packages/beetsplug/web/__init__.py", line 172, in to_url
beets          |     return ','.join(value)
beets          | TypeError: sequence item 0: expected str instance, int found
beets          | 172.16.253.1 - - [26/Aug/2020 13:45:16] "GET /album/1 HTTP/1.1" 500 -
mopidy         | ERROR    2020-08-26 11:45:16,600 [1:BeetsBackend-16] mopidy_beets.client
mopidy         |   Beets - Request http://172.16.253.1:8337/album/1, failed with status code 500
mopidy         | WARNING  2020-08-26 11:45:16,601 [1:Core-20] mopidy.core.library
mopidy         |   BeetsBackend does not implement library.search() with "exact" support. Please upgrade it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.