mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 22:56:42 +02:00
* Added convenient new Album::get method.
This commit is contained in:
@@ -27,6 +27,17 @@
|
|||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
|
|
||||||
|
album_ptr
|
||||||
|
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
|
||||||
|
{
|
||||||
|
int albid = Database::instance()->impl()->albumId( artist->id(), name, autoCreate );
|
||||||
|
if ( albid < 1 )
|
||||||
|
return album_ptr();
|
||||||
|
|
||||||
|
return Album::get( albid, name, artist );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
album_ptr
|
album_ptr
|
||||||
Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist )
|
Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist )
|
||||||
{
|
{
|
||||||
|
@@ -37,6 +37,7 @@ class DLLEXPORT Album : public QObject, public PlaylistInterface
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static album_ptr get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate = false );
|
||||||
static album_ptr get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
static album_ptr get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
||||||
|
|
||||||
Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
||||||
|
@@ -81,6 +81,7 @@ private:
|
|||||||
static Database* s_instance;
|
static Database* s_instance;
|
||||||
|
|
||||||
friend class Tomahawk::Artist;
|
friend class Tomahawk::Artist;
|
||||||
|
friend class Tomahawk::Album;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATABASE_H
|
#endif // DATABASE_H
|
||||||
|
Reference in New Issue
Block a user