server: Update status items on file renames.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 9 Apr 2018 19:05:56 +0000 (21:05 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 6 May 2018 08:45:39 +0000 (10:45 +0200)
The audio file table currently ignores rename events. This has the
effect that the status items, hence the display of para_gui, is not
updated when the current file has been renamed. Fix this oversight.

aft.c

diff --git a/aft.c b/aft.c
index 8969e7ac207ac935a83e4a212ee07d09e7317bc1..2f972972fbfe432a777e0fc7d3e9dd1238eacbaf 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2563,6 +2563,16 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb,
                status_item_ls_data.afsi.last_played = old_last_played;
                make_status_items();
                return 1;
                status_item_ls_data.afsi.last_played = old_last_played;
                make_status_items();
                return 1;
+       } case AUDIO_FILE_RENAME: {
+               char *path;
+               if (data != current_aft_row)
+                       return 0;
+               ret = get_audio_file_path_of_row(current_aft_row, &path);
+               if (ret < 0)
+                       return ret;
+               status_item_ls_data.path = path;
+               make_status_items();
+               return 1;
        } case AFHI_CHANGE: {
                if (data != current_aft_row)
                        return 0;
        } case AFHI_CHANGE: {
                if (data != current_aft_row)
                        return 0;