]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Fix duplicate afs event add.
authorAndre Noll <maan@systemlinux.org>
Thu, 1 Nov 2007 23:49:03 +0000 (00:49 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 1 Nov 2007 23:49:03 +0000 (00:49 +0100)
This bug hits if a request to update an existing audio file
is made. The old code caused an AFHI_CHANGE event and then
did "goto out;" which raises nother event (AUDIO_FILE_ADD).

Fix it by moving the event-raising code some lines up.

aft.c

diff --git a/aft.c b/aft.c
index fae883b4a4cab98202407c6bf1b82ffe3143f7e5..02953b5c4d154e0a089f1a420b0792e2a916ab46 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1609,6 +1609,7 @@ static int com_add_callback(const struct osl_object *query,
        objs[AFTCOL_AFSI].size = AFSI_SIZE;
        save_afsi(&default_afsi, &objs[AFTCOL_AFSI]);
        ret = osl_add_and_get_row(audio_file_table, objs, &aft_row);
+       afs_event(AUDIO_FILE_ADD, &msg, aft_row);
 out:
        if (ret < 0)
                para_printf(&msg, "%s\n", PARA_STRERROR(-ret));
@@ -1616,7 +1617,6 @@ out:
                return 0;
        result->data = msg.buf;
        result->size = msg.size;
-       afs_event(AUDIO_FILE_ADD, &msg, aft_row);
        return 1;
 }