mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
committed by
Leo Franchi
parent
95f1162b6e
commit
ace18dfa1f
@@ -143,8 +143,9 @@ DatabaseCommand_Resolve::resolve( DatabaseImpl* lib )
|
||||
url = QString( "servent://%1\t%2" ).arg( s->userName() ).arg( url );
|
||||
}
|
||||
|
||||
bool cached = Tomahawk::Result::isCached( url );
|
||||
Tomahawk::result_ptr result = Tomahawk::Result::get( url );
|
||||
if ( result->isValid() )
|
||||
if ( cached )
|
||||
{
|
||||
qDebug() << "Result already cached:" << result->toString();
|
||||
res << result;
|
||||
@@ -281,8 +282,9 @@ DatabaseCommand_Resolve::fullTextResolve( DatabaseImpl* lib )
|
||||
url = QString( "servent://%1\t%2" ).arg( s->userName() ).arg( url );
|
||||
}
|
||||
|
||||
bool cached = Tomahawk::Result::isCached( url );
|
||||
Tomahawk::result_ptr result = Tomahawk::Result::get( url );
|
||||
if ( result->isValid() )
|
||||
if ( cached )
|
||||
{
|
||||
qDebug() << "Result already cached:" << result->toString();
|
||||
res << result;
|
||||
|
@@ -50,6 +50,14 @@ Result::get( const QString& url )
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Result::isCached( const QString& url )
|
||||
{
|
||||
QMutexLocker lock( &s_mutex );
|
||||
return ( s_results.contains( url ) );
|
||||
}
|
||||
|
||||
|
||||
Result::Result( const QString& url )
|
||||
: QObject()
|
||||
, m_url( url )
|
||||
@@ -86,13 +94,6 @@ Result::deleteLater()
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Result::isValid() const
|
||||
{
|
||||
return !m_rid.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
artist_ptr
|
||||
Result::artist() const
|
||||
{
|
||||
|
@@ -56,9 +56,9 @@ friend class ::DatabaseCommand_LoadFile;
|
||||
|
||||
public:
|
||||
static Tomahawk::result_ptr get( const QString& url );
|
||||
static bool isCached( const QString& url );
|
||||
virtual ~Result();
|
||||
|
||||
bool isValid() const;
|
||||
QVariant toVariant() const;
|
||||
QString toString() const;
|
||||
Tomahawk::query_ptr toQuery();
|
||||
|
Reference in New Issue
Block a user