core/tags/artist: Move artist_find() out of the tags namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
81518dce47
commit
52886c926e
|
@ -97,7 +97,7 @@ static void tag_track(Library *library, const std::string &filepath)
|
|||
|
||||
track = tags :: add_track(
|
||||
album_find(tag->album().stripWhiteSpace().to8Bit(true), tag->year()),
|
||||
tags :: get_artist(tag->artist().stripWhiteSpace().to8Bit(true)),
|
||||
artist_find(tag->artist().stripWhiteSpace().to8Bit(true)),
|
||||
tags :: get_genre(tag->genre().stripWhiteSpace().to8Bit(true)),
|
||||
library, filepath,
|
||||
tag->title().stripWhiteSpace().to8Bit(true),
|
||||
|
|
|
@ -21,7 +21,7 @@ void tags :: init_artist_db()
|
|||
db_load(&artist_db);
|
||||
}
|
||||
|
||||
struct artist *tags :: get_artist(const std::string &name)
|
||||
struct artist *artist_find(const std::string &name)
|
||||
{
|
||||
return db_find(&artist_db, name.c_str());
|
||||
}
|
||||
|
|
|
@ -27,19 +27,12 @@ namespace tags
|
|||
/** Called to read the artist_db from disk. */
|
||||
void init_artist_db();
|
||||
|
||||
/**
|
||||
* Called to look up an Artist tag by name. If no existing
|
||||
* tag is found a new one will be created and returned to
|
||||
* the caller.
|
||||
*
|
||||
* @param name The name of the artist.
|
||||
* @return A matching Artist tag.
|
||||
*/
|
||||
struct artist *get_artist(const std::string &);
|
||||
|
||||
} /* Namespace: tags */
|
||||
|
||||
|
||||
/* Called to find an artist tag by name. */
|
||||
struct artist *artist_find(const std::string &);
|
||||
|
||||
/* Called to get an artist tag with a specific index. */
|
||||
struct artist *artist_get(const unsigned int);
|
||||
|
||||
|
|
|
@ -67,11 +67,11 @@ static void test_artist_db()
|
|||
struct artist *artist;
|
||||
|
||||
tags :: init_artist_db();
|
||||
artist = tags :: get_artist("Koji Kondo");
|
||||
artist = artist_find("Koji Kondo");
|
||||
|
||||
test_verify_koji(artist);
|
||||
|
||||
test_equal(tags :: get_artist("Koji Kondo"), artist);
|
||||
test_equal(artist_find("Koji Kondo"), artist);
|
||||
test_equal(artist_get(0), artist);
|
||||
test_equal(artist_get(1), (struct artist *)NULL);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ static void test_track_tag_constructor()
|
|||
filter_init();
|
||||
tags :: init();
|
||||
album = album_find("Hyrule Symphony", 1998);
|
||||
artist = tags :: get_artist("Koji Kondo");
|
||||
artist = artist_find("Koji Kondo");
|
||||
genre = tags :: get_genre("Video Game Music");
|
||||
library = tags :: get_library(MUSIC_DIR);
|
||||
|
||||
|
|
Loading…
Reference in New Issue