Giter Site home page Giter Site logo

asbjornolling / mopidyapi Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 3.0 105 KB

A Python 3.6+ Mopidy client library, that uses HTTP and Websockets to talk to its JSON RPC API.

License: GNU General Public License v3.0

Makefile 0.72% Python 98.37% Smarty 0.90%

mopidyapi's People

Contributors

asbjornolling avatar dependabot[bot] avatar runejuhl avatar sphh avatar

Stargazers

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

Watchers

 avatar  avatar

mopidyapi's Issues

flask_object not created if = None in MopidyWSClient

If not using flask, the self.flask_object of MopidyWSClient is never initialized and make the library crash at line 86 of MopidyWSClient.
Quick fix is to initilize it in the constructor with

self.flask_object = flask_object

before

if flask_object is not None:

ModpidyAPI().library.get_images

There is an error with the get_image of the Library Controller. (Python 3.6.3)
The following code:

m = MopidyAPI()
track = m.playback.get_current_track()
m.library.get_images([track.uri])

Get this error:

2019-05-20 19:35:49.845 | ERROR | mopidyapi.httpclient:rpc_call:84 - An error has been caught in function 'rpc_call', process 'MainProcess' (18154), thread 'MainThread' (1996312576):
Traceback (most recent call last):

File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/mopidyapi/controllers/library.py", line 159, in get_images
return self.client.rpc_call('core.library.get_images', *args, **kwargs)
| | | | -> {}
| | | -> (['spotify:track:1mgWnqeUOurHJIyorDtuqF'],)
| | -> <bound method MopidyAPI.rpc_call of <mopidyapi.httpclient.MopidyAPI object at 0x76c6e4f0>>
| -> <mopidyapi.httpclient.MopidyAPI object at 0x76c6e4f0>
-> <mopidyapi.controllers.library.LibraryController object at 0x76c6e5f0>

File "/usr/local/lib/python3.6/site-packages/mopidyapi/httpclient.py", line 84, in rpc_call
return deserialize_mopidy(r['result'])
| -> {'jsonrpc': '2.0', 'id': 0, 'result': {'spotify:track:1mgWnqeUOurHJIyorDtuqF': [{'width': 640, 'model': 'Image', 'uri': 'htt...
-> <function deserialize_mopidy at 0x76003738>
File "/usr/local/lib/python3.6/site-packages/mopidyapi/parsedata.py", line 44, in deserialize_mopidy
raise ValueError(f"Uncaught type: {type(data)}")
-> <class 'ValueError'>

ValueError: Uncaught type: <class 'dict'>

Publish new PyPi Release

First of all, thank you a lot for creating this module. It makes interfacing with mopidy from python code so much easier.

Since the release of version 1.0.1 in April, this project improved quite a bit. The thing I'm most interested in is the automatic reconnect on network loss. I restart mopidy quite often, and mopidyapi does not always keep the connection.
Would it be possible to publish a new PyPi package containing these changes?

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.