core/tags/album: Move album_get() out of the tags namespace

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-09-24 11:09:59 -04:00
parent e6bdf65606
commit 1f5668bd72
4 changed files with 8 additions and 12 deletions

View File

@ -74,7 +74,7 @@ struct album *tags :: get_album(const std::string &name, unsigned int year)
return db_find(&album_db, make_key(name, year).c_str());
}
struct album *tags ::get_album(const unsigned int index)
struct album *album_get(const unsigned int index)
{
return db_at(&album_db, index);
}

View File

@ -122,7 +122,7 @@ void Track :: read(file &file)
_library = tags :: get_library(library_id);
_artist = tags :: get_artist(artist_id);
_album = tags :: get_album(album_id);
_album = album_get(album_id);
_genre = tags :: get_genre(genre_id);
filter :: add(name(), index());

View File

@ -79,14 +79,10 @@ namespace tags
*/
struct album *get_album(const std::string &, unsigned int);
/**
* Called to look up an Album tag by tag index.
*
* @param index The index of the Album tag.
* @return A matching Album tag or NULL.
*/
struct album *get_album(const unsigned int);
} /* Namespace: tags */
/* Called to get an album tag with a specific index. */
struct album *album_get(const unsigned int);
#endif /* OCARINA_CORE_TAGS_ALBUM_H */

View File

@ -71,8 +71,8 @@ static void test_album_db()
test_verify_hyrule(album);
test_equal(tags :: get_album("Hyrule Symphony", 1998), album);
test_equal(tags :: get_album(0), album);
test_equal(tags :: get_album(1), (struct album *)NULL);
test_equal(album_get(0), album);
test_equal(album_get(1), (struct album *)NULL);
db_init(&album_db, "album.db", false);
db_load(&album_db);