Giter Site home page Giter Site logo

Comments (7)

jodal avatar jodal commented on June 8, 2024

Mopidy-Local-SQLite is just a library extension to Mopidy-Local itself, thus Mopidy-Local must also be activated for Mopidy-Local-SQLite to work.

from mopidy-local-sqlite.

jodal avatar jodal commented on June 8, 2024

That said, Mopidy-Local-SQLite could try to handle this nicer, e.g. by checking in Extension.validate_environment() that the Mopidy-Local config is present. If the Mopidy-Local extension is disabled, the matching config won't be available, IIRC.

from mopidy-local-sqlite.

woutervanwijk avatar woutervanwijk commented on June 8, 2024

I know, but if I disable one extension, another one that is installed shouldn't crash mopidy, imho. It should just do nothing. Or mopidy should check if an extension depends on another and disable the child-extension if the parent is disabled?

from mopidy-local-sqlite.

jodal avatar jodal commented on June 8, 2024

Agree. Mopidy doesn't know anything about the extension relations, so it must be the child extension that checks in Extensions.validate_environment() if the parent extension is available, and if not, raise the proper exception so it is disabled too.

from mopidy-local-sqlite.

tkem avatar tkem commented on June 8, 2024

Agreed. Maybe that's something that should also go into the Mopidy docs, in the "Extension Development" section?

from mopidy-local-sqlite.

jodal avatar jodal commented on June 8, 2024

Hum, you don't have access to the config at the time of Extension.validate_environment(), so one needs to fail the extension at a later point. For a regular frontend, I'd simply raise FrontendError from the frontend's __init__(). For a local library, it should be possible to do something similar.

from mopidy-local-sqlite.

tkem avatar tkem commented on June 8, 2024

AFIACS, what this whole issue really boils down is that an exception in a Web application's factory method will go unhandled, and will prevent Mopidy's Web server from being started. IMHO, exceptions from the factory methods registered via http:app should be caught in HttpServer._get_app_request_handlers(), and the corresponding Web app should be disabled without affecting other Web applications. However, I'll provide a workaround for this special case in Mopidy-Local-SQLite, ASAP.

from mopidy-local-sqlite.

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.