1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

Allow plugins to enforce reloading of the resolver, to invalidate old results

This commit is contained in:
Dominik Schmidt
2014-12-11 01:04:54 +01:00
parent 3b2ac21dbf
commit df4abb1ef1
2 changed files with 16 additions and 0 deletions

View File

@@ -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<QString, QString>& headers,
std::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback )

View File

@@ -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 );