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

I decided to set this as a void pointer to keep other layers from using
the playlist without our knowledge.  The only user of this variable
should be the playlist code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-05-06 10:18:28 -04:00 committed by Anna Schumaker
parent cfeca9ae4b
commit 6e02f75262
3 changed files with 11 additions and 7 deletions

View File

@ -14,6 +14,7 @@ static struct library *__library_alloc(gchar *path, bool enabled)
library->li_size = 0;
library->li_enabled = enabled;
library->li_path = path;
library->li_playlist = NULL;
return library;
}

View File

@ -17,8 +17,9 @@
struct library {
unsigned int li_size; /* This library's track count. */
bool li_enabled;/* True if this library is enabled. */
bool li_enabled; /* True if this library is enabled. */
gchar *li_path; /* This library's root path. */
void *li_playlist; /* This library's associated playlist. */
struct db_entry li_dbe;
};

View File

@ -9,6 +9,7 @@ static void test_verify_zelda(struct library *library)
const struct db_ops *library_ops = test_library_ops();
test_equal(library->li_enabled, (bool)true);
test_equal(library->li_size, 0);
test_equal(library->li_playlist, NULL);
test_equal(library_ops->dbe_key(&library->li_dbe), "/home/Zelda/Music");
}
@ -17,6 +18,7 @@ static void test_verify_link(struct library *library)
const struct db_ops *library_ops = test_library_ops();
test_equal(library->li_enabled, (bool)false);
test_equal(library->li_size, 0);
test_equal(library->li_playlist, NULL);
test_equal(library_ops->dbe_key(&library->li_dbe), "/home/Link/Music");
}