Skip to content

Commit

Permalink
The deprecated var_ entries are remove from mympd_env, use the su…
Browse files Browse the repository at this point in the history
…btable `var`.
  • Loading branch information
jcorporation committed Nov 19, 2024
1 parent 9859bfb commit ff87f4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ https://github.com/jcorporation/myMPD/

This is a small maintenance release.

### Scripting

- The deprecated `var_` entries are remove from `mympd_env`, use the subtable `var`.

### API changes

- MYMPD_API_STICKER_NAMES: respect type parameter
Expand Down
14 changes: 2 additions & 12 deletions src/scripts/scripts_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,20 +310,10 @@ static void populate_lua_global_vars(struct t_scripts_state *scripts_state,
populate_lua_table_field_p(script_arg->lua_vm, "cachedir_thumbs", cachedir);
FREE_SDS(cachedir);
populate_lua_table_field_p(script_arg->lua_vm, "workdir", script_arg->config->workdir);
// User defined variables - deprecated will be remove in 19.0.0
struct t_list_node *current = scripts_state->var_list.head;
sds key = sdsempty();
while (current != NULL) {
key = sdscatfmt(key, "var_%S", current->key);
populate_lua_table_field_p(script_arg->lua_vm, key, current->value_p);
sdsclear(key);
current = current->next;
}
FREE_SDS(key);
// User defined variables - new interface since 18.0.0
// User defined variables
lua_pushstring(script_arg->lua_vm, "var");
lua_newtable(script_arg->lua_vm);
current = scripts_state->var_list.head;
struct t_list_node *current = scripts_state->var_list.head;
while (current != NULL) {
populate_lua_table_field_p(script_arg->lua_vm, current->key, current->value_p);
current = current->next;
Expand Down

0 comments on commit ff87f4c

Please sign in to comment.