Skip to content

Commit

Permalink
Fix: Emmit correct trigger event for INTERNAL_API_TRIGGER_EVENT_EMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Dec 15, 2024
1 parent b557c29 commit 7aec221
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This is a small bug fix release.

### Changelog

Fix: Lua wrapper for `mympd.api`
- Fix: Lua wrapper for `mympd.api`
- Fix: Emmit correct trigger event for INTERNAL_API_TRIGGER_EVENT_EMIT

***

Expand Down
2 changes: 1 addition & 1 deletion src/mympd_api/mympd_api_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ void mympd_api_handler(struct t_mympd_state *mympd_state, struct t_partition_sta
case INTERNAL_API_TRIGGER_EVENT_EMIT:
if (json_get_int_max(request->data, "$.params.event", &int_buf1, &parse_error) == true) {
if (mympd_api_event_name(int_buf1) != NULL) {
mympd_api_trigger_execute(&mympd_state->trigger_list, TRIGGER_MYMPD_DISCONNECTED, partition_state->name, NULL);
mympd_api_trigger_execute(&mympd_state->trigger_list, int_buf1, partition_state->name, NULL);
}
response->data = jsonrpc_respond_ok(response->data, INTERNAL_API_TRIGGER_EVENT_EMIT, request->id, JSONRPC_FACILITY_TRIGGER);
}
Expand Down

0 comments on commit 7aec221

Please sign in to comment.