1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-14 21:11:56 +02:00

* Added convenient new Album::get method.

This commit is contained in:
Christian Muehlhaeuser 2011-08-10 03:46:30 +02:00
parent 27480f8cdb
commit ef2514e95c
3 changed files with 13 additions and 0 deletions

View File

@ -27,6 +27,17 @@
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::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist )
{

View File

@ -37,6 +37,7 @@ class DLLEXPORT Album : public QObject, public PlaylistInterface
Q_OBJECT
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 );
Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );

View File

@ -81,6 +81,7 @@ private:
static Database* s_instance;
friend class Tomahawk::Artist;
friend class Tomahawk::Album;
};
#endif // DATABASE_H