core/tags/artist: Move artist_get() out of the tags namespace

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-10-22 12:01:25 -04:00
parent 2c5c0aa7e0
commit 81518dce47
4 changed files with 8 additions and 12 deletions

View File

@ -26,7 +26,7 @@ struct artist *tags :: get_artist(const std::string &name)
return db_find(&artist_db, name.c_str());
}
struct artist *tags :: get_artist(const unsigned int index)
struct artist *artist_get(const unsigned int index)
{
return db_at(&artist_db, index);
}

View File

@ -121,7 +121,7 @@ void Track :: read(file &file)
g_free(path);
_library = tags :: get_library(library_id);
_artist = tags :: get_artist(artist_id);
_artist = artist_get(artist_id);
_album = album_get(album_id);
_genre = tags :: get_genre(genre_id);

View File

@ -37,14 +37,10 @@ namespace tags
*/
struct artist *get_artist(const std::string &);
/**
* Called to look up an Artist tag by tag index.
*
* @param index The index of the Artist tag.
* @return A matching Artist tag or NULL.
*/
struct artist *get_artist(const unsigned int);
} /* Namespace: tags */
/* Called to get an artist tag with a specific index. */
struct artist *artist_get(const unsigned int);
#endif /* OCARINA_CORE_TAGS_ARTIST_H */

View File

@ -72,8 +72,8 @@ static void test_artist_db()
test_verify_koji(artist);
test_equal(tags :: get_artist("Koji Kondo"), artist);
test_equal(tags :: get_artist(0), artist);
test_equal(tags :: get_artist(1), (struct artist *)NULL);
test_equal(artist_get(0), artist);
test_equal(artist_get(1), (struct artist *)NULL);
db_init(&artist_db, "artist.db", false);
db_load(&artist_db);