Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Apr 15, 2024
2 parents dc008a2 + 8afffd6 commit 8a3a188
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 33 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ https://github.com/jcorporation/myMPD/

***

## myMPD 14.1.2 (2024-04-15)

This is a small bugfix release.

### Changelog

- Fix: Output enabled state is bool type #1254
- Fix: Add missing sort parameters to home icon for search #1257
- Fix: Set default stream port if stream uri is defined #1255

***

## myMPD 14.1.1 (2023-04-03)

This is a small bugfix release.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cmake_policy(SET CMP0003 NEW)
# myMPD is written in C
# supported compilers: gcc, clang
project(mympd
VERSION 14.1.1
VERSION 14.1.2
LANGUAGES C
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/man/mympd-config.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Manpage for mympd-config.
.\" Contact <[email protected]> to correct errors or typos.
.TH man 1 "03 Apr 2024" "14.1.1" "mympd-config man page"
.TH man 1 "15 Apr 2024" "14.1.2" "mympd-config man page"

.SH NAME
mympd-config \- mympd configuration tool
Expand Down
2 changes: 1 addition & 1 deletion contrib/man/mympd-script.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Manpage for mympd-script.
.\" Contact <[email protected]> to correct errors or typos.
.TH man 1 "03 Apr 2024" "14.1.1" "mympd-script man page"
.TH man 1 "15 Apr 2024" "14.1.2" "mympd-script man page"

.SH NAME
mympd-script \- mympd command line tool to execute scripts
Expand Down
2 changes: 1 addition & 1 deletion contrib/man/mympd.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Manpage for mympd.
.\" Contact <[email protected]> to correct errors or typos.
.TH man 1 "03 Apr 2024" "14.1.1" "mympd man page"
.TH man 1 "15 Apr 2024" "14.1.2" "mympd man page"

.SH NAME
myMPD \- standalone and mobile friendly web mpd client
Expand Down
2 changes: 1 addition & 1 deletion contrib/packaging/alpine/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Maintainer: Juergen Mang <[email protected]>
#
pkgname=mympd
pkgver=14.1.1
pkgver=14.1.2
pkgrel=0
pkgdesc="myMPD is a standalone and mobile friendly web-based MPD client."
url="https://jcorporation.github.io/myMPD/"
Expand Down
2 changes: 1 addition & 1 deletion contrib/packaging/arch/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Juergen Mang <[email protected]>

pkgname=mympd
pkgver=14.1.1
pkgver=14.1.2
pkgrel=1
pkgdesc="A standalone and mobile friendly web-based MPD client."
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
Expand Down
4 changes: 2 additions & 2 deletions contrib/packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mympd (14.1.1-1) unstable; urgency=medium
mympd (14.1.2-1) unstable; urgency=medium

* Release from master

-- Juergen Mang <[email protected]> Wed, 03 Apr 2024 19:04:24 +0200
-- Juergen Mang <[email protected]> Mon, 15 Apr 2024 20:04:47 +0200
2 changes: 1 addition & 1 deletion contrib/packaging/freebsd/multimedia/mympd/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORTNAME= myMPD
DISTVERSIONPREFIX= v
DISTVERSION= 14.1.1
DISTVERSION= 14.1.2
CATEGORIES= multimedia

MAINTAINER= [email protected]
Expand Down
2 changes: 1 addition & 1 deletion contrib/packaging/openwrt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME := mympd
PKG_VERSION := 14.1.1
PKG_VERSION := 14.1.2
PKG_RELEASE := 1

PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
Expand Down
4 changes: 2 additions & 2 deletions contrib/packaging/rpm/mympd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# (c) 2018-2024 Juergen Mang <[email protected]>

Name: mympd
Version: 14.1.1
Version: 14.1.2
Release: 0
License: GPL-3.0-or-later
Group: Productivity/Multimedia/Sound/Players
Expand Down Expand Up @@ -69,5 +69,5 @@ fi
%license LICENSE.md

%changelog
* Wed Apr 03 2024 Juergen Mang <[email protected]> 14.1.1-0
* Mon Apr 15 2024 Juergen Mang <[email protected]> 14.1.2-0
- Version from master
2 changes: 1 addition & 1 deletion docs/_includes/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.1.1
14.1.2
8 changes: 4 additions & 4 deletions htdocs/js/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1034,10 +1034,10 @@ const APImethods = {
"example": 0,
"desc": "MPD output id"
},
"state": {
"type": APItypes.uint,
"example": 0,
"desc": "0 = disable, 1 = enable"
"enabled": {
"type": APItypes.bool,
"example": true,
"desc": "Enabled state"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion htdocs/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function addSongToHome(uri, type, name) {
*/
//eslint-disable-next-line no-unused-vars
function addSearchToHome() {
_addHomeIcon('replaceQueue', tn('Current search'), 'saved_search', '', ['search', app.current.search]);
_addHomeIcon('replaceQueue', tn('Current search'), 'saved_search', '', ['search', app.current.search, app.current.sort.tag, app.current.sort.desc]);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions htdocs/js/modalOutputAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function parseOutputAttributes(obj) {
setDataId('modalOutputAttributes', 'outputId', obj.result.id);
const tbody = elGetById('modalOutputAttributesList');
elClear(tbody);
for (const n of ['name', 'state', 'plugin']) {
if (n === 'state') {
obj.result[n] = obj.result[n] === 1
for (const n of ['name', 'enabled', 'plugin']) {
if (n === 'enabled') {
obj.result[n] = obj.result[n] === true
? tn('Enabled')
: tn('Disabled');
}
Expand Down
7 changes: 7 additions & 0 deletions htdocs/js/modalSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@ function saveSettingsApply(obj) {
function savePartitionSettings(closeModal) {
const settingsParams = {};
if (formToJson('modalSettings', settingsParams, settingsPartitionFields) === true) {
if (settingsParams.streamUri !== '' &&
settingsParams.mpdStreamPort === 0)
{
// use default stream port if stream uri is defined
console.log('reseting stream port');
settingsParams.mpdStreamPort = defaults["PARTITION_MPD_STREAM_PORT"];
}
if (closeModal === true) {
sendAPI('MYMPD_API_PARTITION_SAVE', settingsParams, savePartitionSettingsClose, true);
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/js/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function initOutputs() {
event.preventDefault();
sendAPI("MYMPD_API_PLAYER_OUTPUT_TOGGLE", {
"outputId": Number(getData(target, 'output-id')),
"state": (target.classList.contains('active') ? 0 : 1)
"enabled": (target.classList.contains('active') ? false : true)
}, null, false);
toggleBtn(target, undefined);
}
Expand Down Expand Up @@ -73,7 +73,7 @@ function parseOutputs(obj) {
]);
setData(btn, 'output-name', obj.result.data[i].name);
setData(btn, 'output-id', obj.result.data[i].id);
if (obj.result.data[i].state === true) {
if (obj.result.data[i].enabled === true) {
btn.classList.add('active');
}
outputList.appendChild(btn);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/js/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const myMPDversion = '14.1.1';
const myMPDbuild = 'a69cd30e2bdbec6ed1c539e81d203ae7d81004d3';
const myMPDversion = '14.1.2';
const myMPDbuild = 'fa5df6f5d6ba8b2f161bccc8638571e07b705f21';
4 changes: 2 additions & 2 deletions src/mympd_api/mympd_api_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,9 @@ void mympd_api_handler(struct t_mympd_state *mympd_state, struct t_partition_sta
break;
case MYMPD_API_PLAYER_OUTPUT_TOGGLE:
if (json_get_uint(request->data, "$.params.outputId", 0, MPD_OUTPUT_ID_MAX, &uint_buf1, &parse_error) == true &&
json_get_uint(request->data, "$.params.state", 0, 1, &uint_buf2, &parse_error) == true)
json_get_bool(request->data, "$.params.enabled", &bool_buf1, &parse_error) == true)
{
rc = mympd_api_output_toggle(partition_state, uint_buf1, uint_buf2, &error);
rc = mympd_api_output_toggle(partition_state, uint_buf1, bool_buf1, &error);
response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_play_id", &rc);
}
break;
Expand Down
10 changes: 5 additions & 5 deletions src/mympd_api/outputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
* Toggles the enabled state of a mpd output
* @param partition_state pointer to partition state
* @param output_id mpd output id
* @param state the state, 1 = enabled, 0 = disabled
* @param enabled the enabled state
* @param error already allocated sds string to append the error message
* @return true on success, else false
*/
bool mympd_api_output_toggle(struct t_partition_state *partition_state, unsigned output_id, unsigned state, sds *error) {
if (state == 1) {
bool mympd_api_output_toggle(struct t_partition_state *partition_state, unsigned output_id, bool enabled, sds *error) {
if (enabled == true) {
mpd_run_enable_output(partition_state->conn, output_id);
return mympd_check_error_and_recover(partition_state, error, "mpd_run_enable_output");
}
Expand All @@ -49,7 +49,7 @@ sds mympd_api_output_get(struct t_partition_state *partition_state, sds buffer,
if (strcmp(mpd_output_name, output_name) == 0) {
buffer = tojson_uint(buffer, "id", mpd_output_get_id(output), true);
buffer = tojson_char(buffer, "name", mpd_output_name, true);
buffer = tojson_bool(buffer, "state", mpd_output_get_enabled(output), true);
buffer = tojson_bool(buffer, "enabled", mpd_output_get_enabled(output), true);
buffer = tojson_char(buffer, "plugin", mpd_output_get_plugin(output), true);
buffer = sdscat(buffer, "\"attributes\":{");
const struct mpd_pair *attributes = mpd_output_first_attribute(output);
Expand Down Expand Up @@ -98,7 +98,7 @@ sds mympd_api_output_list(struct t_partition_state *partition_state, sds buffer,
buffer = sdscatlen(buffer, "{", 1);
buffer = tojson_uint(buffer, "id", mpd_output_get_id(output), true);
buffer = tojson_char(buffer, "name", mpd_output_get_name(output), true);
buffer = tojson_bool(buffer, "state", mpd_output_get_enabled(output), true);
buffer = tojson_bool(buffer, "enabled", mpd_output_get_enabled(output), true);
buffer = tojson_char(buffer, "plugin", mpd_output_get_plugin(output), false);
buffer = sdscatlen(buffer, "}", 1);
mpd_output_free(output);
Expand Down
2 changes: 1 addition & 1 deletion src/mympd_api/outputs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "src/lib/mympd_state.h"

bool mympd_api_output_toggle(struct t_partition_state *partition_state, unsigned output_id, unsigned state, sds *error);
bool mympd_api_output_toggle(struct t_partition_state *partition_state, unsigned output_id, bool enabled, sds *error);
sds mympd_api_output_get(struct t_partition_state *partition_state, sds buffer, unsigned request_id, sds output_name);
sds mympd_api_output_list(struct t_partition_state *partition_state, sds buffer, unsigned request_id);
bool mympd_api_output_attributes_set(struct t_partition_state *partition_state,
Expand Down

0 comments on commit 8a3a188

Please sign in to comment.