Giter VIP home page Giter VIP logo

Comments (6)

ismailof avatar ismailof commented on August 24, 2024

You don't need to directly invoke server_request. All of the methods allowed by the interface are already mimic in pyhon code. For example, asuming the client object is named mopidy you can just call:
mopidy.playback.next() or mopidy.playback.previous(). This is the preferred way since there is a little more code in between to assure the requests and responses are handled right.

from mopidy-json-client.

LucioSantinelli avatar LucioSantinelli commented on August 24, 2024

I understand better now how this project works!
I got another question, why get_time_position, get_current_tlid() and get_state() return always None?
Thanks a lot

from mopidy-json-client.

LucioSantinelli avatar LucioSantinelli commented on August 24, 2024

It appears like even tracklist get-methods returns always None.
Any suggestion?

from mopidy-json-client.

ismailof avatar ismailof commented on August 24, 2024

Yes, I think I know what it's going on.

Every call has a parameter timeout, which can be passed on the function. It tells how many seconds to wait for a server response. The default value is now 0, so the function does not wait for the response and returns None.

I will make a small change to the code to set the default value (if you don't specify any) to 20 seconds, so the calls work as it is. In the meantime, ¿could you set a timeout value on the calls to check that it works? Eg: get_current_tlid(timeout=20).

Another option is to use the parameter on_result=callback_function, and the answer will be passed to the callback when it's ready. This is recommended specially for time-consuming calls but not required.

Thanks for the feedback.

from mopidy-json-client.

ismailof avatar ismailof commented on August 24, 2024

Fixed on version 0.5.14

from mopidy-json-client.

LucioSantinelli avatar LucioSantinelli commented on August 24, 2024

I tried to call all get-methods with timeout=20 and all works fine.
Thanks a lot.

from mopidy-json-client.

Related Issues (20)

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.