mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +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 );
|
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 );
|
Tomahawk::result_ptr result = Tomahawk::Result::get( url );
|
||||||
if ( result->isValid() )
|
if ( cached )
|
||||||
{
|
{
|
||||||
qDebug() << "Result already cached:" << result->toString();
|
qDebug() << "Result already cached:" << result->toString();
|
||||||
res << result;
|
res << result;
|
||||||
@@ -281,8 +282,9 @@ DatabaseCommand_Resolve::fullTextResolve( DatabaseImpl* lib )
|
|||||||
url = QString( "servent://%1\t%2" ).arg( s->userName() ).arg( url );
|
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 );
|
Tomahawk::result_ptr result = Tomahawk::Result::get( url );
|
||||||
if ( result->isValid() )
|
if ( cached )
|
||||||
{
|
{
|
||||||
qDebug() << "Result already cached:" << result->toString();
|
qDebug() << "Result already cached:" << result->toString();
|
||||||
res << result;
|
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 )
|
Result::Result( const QString& url )
|
||||||
: QObject()
|
: QObject()
|
||||||
, m_url( url )
|
, m_url( url )
|
||||||
@@ -86,13 +94,6 @@ Result::deleteLater()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
Result::isValid() const
|
|
||||||
{
|
|
||||||
return !m_rid.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
artist_ptr
|
artist_ptr
|
||||||
Result::artist() const
|
Result::artist() const
|
||||||
{
|
{
|
||||||
|
@@ -56,9 +56,9 @@ friend class ::DatabaseCommand_LoadFile;
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static Tomahawk::result_ptr get( const QString& url );
|
static Tomahawk::result_ptr get( const QString& url );
|
||||||
|
static bool isCached( const QString& url );
|
||||||
virtual ~Result();
|
virtual ~Result();
|
||||||
|
|
||||||
bool isValid() const;
|
|
||||||
QVariant toVariant() const;
|
QVariant toVariant() const;
|
||||||
QString toString() const;
|
QString toString() const;
|
||||||
Tomahawk::query_ptr toQuery();
|
Tomahawk::query_ptr toQuery();
|
||||||
|
Reference in New Issue
Block a user