]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Force status item update on mood/playlist changes.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 30 Jul 2017 00:25:26 +0000 (02:25 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 12 Aug 2017 18:18:13 +0000 (20:18 +0200)
This patch increments the mmd event counter whenever a new playlist
or mood is loaded. This instructs the stat command handlers to resend
the list of status items to all connected stat clients.

afs.c

diff --git a/afs.c b/afs.c
index b92cf0f2c61fa943e95e6096510ad3fe5ec9ea07..ef05a473e85a022568a785ecc8da140d2b19d1dc 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -497,10 +497,12 @@ static int activate_mood_or_playlist(const char *arg, int *num_admissible)
                        strncpy(mmd->afs_mode_string, arg,
                                sizeof(mmd->afs_mode_string));
                        mmd->afs_mode_string[sizeof(mmd->afs_mode_string) - 1] = '\0';
                        strncpy(mmd->afs_mode_string, arg,
                                sizeof(mmd->afs_mode_string));
                        mmd->afs_mode_string[sizeof(mmd->afs_mode_string) - 1] = '\0';
+                       mmd->events++;
                        mutex_unlock(mmd_mutex);
                } else {
                        mutex_lock(mmd_mutex);
                        strcpy(mmd->afs_mode_string, "dummy");
                        mutex_unlock(mmd_mutex);
                } else {
                        mutex_lock(mmd_mutex);
                        strcpy(mmd->afs_mode_string, "dummy");
+                       mmd->events++;
                        mutex_unlock(mmd_mutex);
                        current_mop = NULL;
                }
                        mutex_unlock(mmd_mutex);
                        current_mop = NULL;
                }