From 81518dce477f5318a9d4ca467ce667c7712916a6 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 22 Oct 2015 12:01:25 -0400 Subject: [PATCH] core/tags/artist: Move artist_get() out of the tags namespace Signed-off-by: Anna Schumaker --- core/tags/artist.cpp | 2 +- core/tags/track.cpp | 2 +- include/core/tags/artist.h | 12 ++++-------- tests/core/tags/artist.cpp | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/core/tags/artist.cpp b/core/tags/artist.cpp index c7d2d6bc..1a3ea255 100644 --- a/core/tags/artist.cpp +++ b/core/tags/artist.cpp @@ -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); } diff --git a/core/tags/track.cpp b/core/tags/track.cpp index 321a88cd..8dd10283 100644 --- a/core/tags/track.cpp +++ b/core/tags/track.cpp @@ -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); diff --git a/include/core/tags/artist.h b/include/core/tags/artist.h index cede5ac1..b66589d0 100644 --- a/include/core/tags/artist.h +++ b/include/core/tags/artist.h @@ -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 */ diff --git a/tests/core/tags/artist.cpp b/tests/core/tags/artist.cpp index a20ebc23..b2b11ad9 100644 --- a/tests/core/tags/artist.cpp +++ b/tests/core/tags/artist.cpp @@ -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);