X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=score.c;h=b53d60b38b582b6989f65fc290e894647e53f1f7;hb=7fc9a44cb0205121b7ece3a3cecd66e712a31981;hp=2cfadf86fd2835b47ba244cc53a12935cc0c9806;hpb=f6f50d03a09d6bc423324206d274336e9905bbb4;p=paraslash.git diff --git a/score.c b/score.c index 2cfadf86..b53d60b3 100644 --- a/score.c +++ b/score.c @@ -7,6 +7,7 @@ /** \file score.c Scoring functions to determine the audio file streaming order. */ #include "para.h" #include "error.h" +#include "afh.h" #include "afs.h" #include "list.h" #include "string.h" @@ -77,7 +78,6 @@ static struct osl_column_description score_cols[] = { }; static struct osl_table_description score_table_desc = { - .dir = DATABASE_DIR, .name = "score", .num_columns = NUM_SCORE_COLUMNS, .flags = 0, @@ -198,7 +198,7 @@ int score_update(const struct osl_row *aft_row, long percent) obj.size = sizeof(long); obj.data = para_malloc(obj.size); *(long *)obj.data = new_score; - PARA_NOTICE_LOG("new score: %ld, position: %u/%u\n", new_score, + PARA_DEBUG_LOG("new score: %ld, position: %u/%u\n", new_score, new_pos, n); return osl_update_object(score_table, row, SCORECOL_SCORE, &obj); } @@ -348,13 +348,15 @@ void score_shutdown(enum osl_close_flags flags) * Init the scoring subsystem. * * \param ti Gets filled in by the function. + * \param db The database directory. * * \return The return value of the underlying call to osl_open_table(). * * \sa score_shutdown(). */ -int score_init(struct table_info *ti) +int score_init(struct table_info *ti, const char *db) { + score_table_desc.dir = db; ti->desc = &score_table_desc; ti->flags = TBLFLAG_SKIP_CREATE; int ret = osl_open_table(ti->desc, &ti->table);