X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=mood.c;h=8e6a7665f15e32bc5774c5539358ccaf0bcbc880;hb=8221acb64e0dc17a9fc332cb167fb3fe3fa94678;hp=e06382e85cf2831ce638b27d0e5b057f759faac2;hpb=d46a0767b58654f15f16406cf99296287bd0d534;p=paraslash.git diff --git a/mood.c b/mood.c index e06382e8..8e6a7665 100644 --- a/mood.c +++ b/mood.c @@ -896,6 +896,9 @@ static int reload_current_mood(void) int ret; char *mood_name = NULL; + ret = clear_score_table(); + if (ret < 0) + return ret; if (!current_mood) return 1; PARA_NOTICE_LOG("reloading %s\n", current_mood->name? @@ -918,12 +921,12 @@ static int reload_current_mood(void) * This function performs actions required due to the occurrence of the given * event. Possible actions include reload of the current mood and update of the * score of an audio file. + * + * \return Standard. */ int moods_event_handler(enum afs_events event, __a_unused struct para_buffer *pb, void *data) { - int ret; - if (!current_mood) return 0; switch (event) { @@ -936,10 +939,6 @@ int moods_event_handler(enum afs_events event, __a_unused struct para_buffer *pb case BLOB_ADD: if (data == moods_table || data == playlists_table) return 1; /* no reload necessary for these */ - ret = clear_score_table(); - if (ret < 0) - PARA_CRIT_LOG("clear score table returned %s\n", - para_strerror(-ret)); return reload_current_mood(); /* these also require reload of the score table */ case ATTRIBUTE_ADD: