diff --git a/src/libtomahawk/resolvers/JSResolverHelper.cpp b/src/libtomahawk/resolvers/JSResolverHelper.cpp index 9700eb440..3f7e02b3d 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.cpp +++ b/src/libtomahawk/resolvers/JSResolverHelper.cpp @@ -906,6 +906,14 @@ JSResolverHelper::deleteFuzzyIndex() } +void +JSResolverHelper::readdResolver() +{ + Pipeline::instance()->removeResolver( m_resolver ); + Pipeline::instance()->addResolver( m_resolver ); +} + + void JSResolverHelper::returnStreamUrl( const QString& streamUrl, const QMap& headers, std::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback ) diff --git a/src/libtomahawk/resolvers/JSResolverHelper.h b/src/libtomahawk/resolvers/JSResolverHelper.h index 072210dc5..1dec71510 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.h +++ b/src/libtomahawk/resolvers/JSResolverHelper.h @@ -115,12 +115,20 @@ public: Q_INVOKABLE QVariantList resolveFromFuzzyIndex( const QString& artist, const QString& album, const QString& tracks ); Q_INVOKABLE void deleteFuzzyIndex(); + /** + * This is horrible, we can use it to invalidate resolver results when the config changes + * TODO: register the resolver through registerPlugin and remove it through standard methods + */ + Q_INVOKABLE void readdResolver(); + + /** * INTERNAL USE ONLY! */ void customIODeviceFactory( const Tomahawk::result_ptr&, const QString& url, std::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback ); // async + public slots: QByteArray readRaw( const QString& fileName ); QString readBase64( const QString& fileName );