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:
parent
27480f8cdb
commit
ef2514e95c
@ -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 )
|
||||
{
|
||||
|
@ -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 );
|
||||
|
@ -81,6 +81,7 @@ private:
|
||||
static Database* s_instance;
|
||||
|
||||
friend class Tomahawk::Artist;
|
||||
friend class Tomahawk::Album;
|
||||
};
|
||||
|
||||
#endif // DATABASE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user