X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=mood.c;h=b7ee99eb73799b03fdd0fff63b7ff77e940a1a82;hb=a1ba8789e586943643e38979465be3af83840540;hp=e685fd91c982fd82cd9afa69c3a06932328907a5;hpb=07010f70da6ea0ba9940116eef83abeb02fa8d5d;p=paraslash.git diff --git a/mood.c b/mood.c index e685fd91..b7ee99eb 100644 --- a/mood.c +++ b/mood.c @@ -164,6 +164,25 @@ static uint64_t int_sqrt(uint64_t x) return res; } +static int mm_no_attributes_set_parser(const char *arg, __a_unused void **ignored) +{ + if (arg && *arg) + PARA_WARNING_LOG("ignored junk at eol: %s\n", arg); + return 1; +} + +static int mm_no_attributes_set_score_function(__a_unused const char *path, + const struct afs_info *afsi, + __a_unused const struct audio_format_info *afhi, + __a_unused const void *data) +{ + if (!strcmp(path, "/home/mp3/checked/dvd_08/cd_52/Sade__Paradise.mp3")) + PARA_NOTICE_LOG("%s: %llu\n", path, afsi->attributes); + if (!afsi->attributes) + return 100; + return -100; +} + static int mm_played_rarely_score_function(__a_unused const char *path, const struct afs_info *afsi, __a_unused const struct audio_format_info *afhi, @@ -182,7 +201,7 @@ static int mm_played_rarely_score_function(__a_unused const char *path, static int mm_played_rarely_parser(const char *arg, __a_unused void **ignored) { - if (*arg) + if (arg && *arg) PARA_WARNING_LOG("ignored junk at eol: %s\n", arg); return 1; } @@ -292,6 +311,11 @@ static int compute_mood_score(const struct osl_row *aft_row, struct mood *m, } static const struct mood_method mood_methods[] = { +{ + .parser = mm_no_attributes_set_parser, + .score_function = mm_no_attributes_set_score_function, + .name = "no_attributes_set" +}, { .parser = mm_played_rarely_parser, .score_function = mm_played_rarely_score_function,