core/tags: Switch over to db_load_idle()
Load all tag databases with the new load function. Implements #15: Load track database through an idle task Implements #16: Load library database through an idle task Implements #17: Load genre database through an idle task Implements #18: Load artist database through an idle task Implements #19: Load album database through an idle task Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
223a1e47c1
commit
9a209d098b
|
@ -79,7 +79,7 @@ static const struct db_ops album_ops = {
|
|||
void album_db_init()
|
||||
{
|
||||
db_init(&album_db, "album.db", true, &album_ops);
|
||||
db_load(&album_db);
|
||||
db_load_idle(&album_db);
|
||||
}
|
||||
|
||||
void album_db_deinit()
|
||||
|
|
|
@ -59,7 +59,7 @@ static const struct db_ops artist_ops = {
|
|||
void artist_db_init()
|
||||
{
|
||||
db_init(&artist_db, "artist.db", true, &artist_ops);
|
||||
db_load(&artist_db);
|
||||
db_load_idle(&artist_db);
|
||||
}
|
||||
|
||||
void artist_db_deinit()
|
||||
|
|
|
@ -58,7 +58,7 @@ static const struct db_ops genre_ops = {
|
|||
void genre_db_init()
|
||||
{
|
||||
db_init(&genre_db, "genre.db", true, &genre_ops);
|
||||
db_load(&genre_db);
|
||||
db_load_idle(&genre_db);
|
||||
}
|
||||
|
||||
void genre_db_deinit()
|
||||
|
|
|
@ -62,7 +62,7 @@ static const struct db_ops library_ops = {
|
|||
void library_db_init()
|
||||
{
|
||||
db_init(&library_db, "library.db", true, &library_ops);
|
||||
db_load(&library_db);
|
||||
db_load_idle(&library_db);
|
||||
}
|
||||
|
||||
void library_db_deinit()
|
||||
|
|
|
@ -167,7 +167,7 @@ static const struct db_ops track_ops = {
|
|||
void track_db_init()
|
||||
{
|
||||
db_init(&track_db, "track.db", false, &track_ops);
|
||||
db_load(&track_db);
|
||||
db_load_idle(&track_db);
|
||||
}
|
||||
|
||||
void track_db_deinit()
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* Copyright 2014 (c) Anna Schumaker.
|
||||
*/
|
||||
#include <core/filter.h>
|
||||
#include <core/idle.h>
|
||||
#include <core/string.h>
|
||||
#include <core/tags/tags.h>
|
||||
#include <core/tags/track.h>
|
||||
|
@ -74,6 +75,8 @@ static void test_track()
|
|||
filter_init();
|
||||
tags_init();
|
||||
file_init(&f, "track_tag", 0);
|
||||
while (idle_run_task()) {}
|
||||
|
||||
date = string_tm2str(now);
|
||||
library = library_find("tests/Music");
|
||||
|
||||
|
|
Loading…
Reference in New Issue