core/tags/artist: Add a pointer to store a playlist

Similar to the library tag, this is a void pointer that should only be
used by the playlist layer.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-05-15 09:40:28 -04:00 committed by Anna Schumaker
parent 938bbc92f2
commit e41f554b2e
3 changed files with 8 additions and 4 deletions

View File

@ -12,8 +12,9 @@ static struct artist *__artist_alloc(gchar *name)
struct artist *artist = g_malloc(sizeof(struct artist));
dbe_init(&artist->ar_dbe, artist);
artist->ar_name = name;
artist->ar_lower = string_lowercase(name);
artist->ar_name = name;
artist->ar_lower = string_lowercase(name);
artist->ar_playlist = NULL;
return artist;
}

View File

@ -16,8 +16,9 @@
#include <core/database.h>
struct artist {
gchar *ar_name; /* This artist's name. */
gchar *ar_lower; /* This artist's name (lowercased). */
gchar *ar_name; /* This artist's name. */
gchar *ar_lower; /* This artist's name (lowercased). */
void *ar_playlist; /* This artist's associated playlist. */
struct db_entry ar_dbe;
};

View File

@ -9,6 +9,7 @@ static void test_verify_empty(struct artist *artist)
const struct db_ops *artist_ops = test_artist_ops();
test_equal(artist->ar_name, "");
test_equal(artist->ar_lower, "");
test_equal(artist->ar_playlist, NULL);
test_equal(artist_ops->dbe_key(&artist->ar_dbe), "");
}
@ -17,6 +18,7 @@ static void test_verify_koji(struct artist *artist)
const struct db_ops *artist_ops = test_artist_ops();
test_equal(artist->ar_name, "Koji Kondo");
test_equal(artist->ar_lower, "koji kondo");
test_equal(artist->ar_playlist, NULL);
test_equal(artist_ops->dbe_key(&artist->ar_dbe), "Koji Kondo");
}