2014-11-08 13:43:23 -05:00
|
|
|
/**
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#include <core/tags/artist.h>
|
|
|
|
|
2014-11-16 10:08:12 -05:00
|
|
|
|
2015-10-22 11:28:45 -04:00
|
|
|
static database<struct artist> artist_db;
|
2014-11-16 10:08:12 -05:00
|
|
|
|
|
|
|
|
2015-10-22 11:28:45 -04:00
|
|
|
artist :: artist() : GenericTag() {}
|
2014-11-08 13:43:23 -05:00
|
|
|
|
2015-10-22 11:28:45 -04:00
|
|
|
artist :: artist(const std::string &name)
|
2014-11-08 20:08:42 -05:00
|
|
|
: GenericTag(name)
|
2014-11-08 13:43:23 -05:00
|
|
|
{
|
|
|
|
}
|
2014-11-16 10:08:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
void tags :: init_artist_db()
|
|
|
|
{
|
2015-09-21 09:02:13 -04:00
|
|
|
db_init(&artist_db, "artist.db", true);
|
2015-09-17 08:12:25 -04:00
|
|
|
db_load(&artist_db);
|
2014-11-16 10:08:12 -05:00
|
|
|
}
|
|
|
|
|
2015-10-22 12:05:28 -04:00
|
|
|
struct artist *artist_find(const std::string &name)
|
2014-11-16 10:08:12 -05:00
|
|
|
{
|
2015-10-20 10:10:26 -04:00
|
|
|
return db_find(&artist_db, name.c_str());
|
2014-11-16 10:08:12 -05:00
|
|
|
}
|
|
|
|
|
2015-10-22 12:01:25 -04:00
|
|
|
struct artist *artist_get(const unsigned int index)
|
2014-11-16 10:08:12 -05:00
|
|
|
{
|
2015-10-20 08:19:47 -04:00
|
|
|
return db_at(&artist_db, index);
|
2014-11-16 10:08:12 -05:00
|
|
|
}
|