]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'maint'
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 29 Aug 2015 10:54:58 +0000 (12:54 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 29 Aug 2015 10:54:58 +0000 (12:54 +0200)
* maint:
  mood: Clear the score table on attribute changes.

mood.c

diff --git a/mood.c b/mood.c
index 8d171bde93170dd110ffe4d1b480dc313a8c61de..94deff4684c5a335d38f5b843e22a4cee7dbc880 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -870,6 +870,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?
@@ -898,8 +901,6 @@ static int reload_current_mood(void)
 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) {
@@ -912,10 +913,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: