From 18cfcc34ab9a7091770866750ca733ee88970ca4 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 17 Nov 2024 13:35:44 +0100 Subject: [PATCH 1/3] Upd: set version to 18.2.2 --- CHANGELOG.md | 8 ++++++++ CMakeLists.txt | 2 +- contrib/man/mympd-config.1 | 2 +- contrib/man/mympd-script.1 | 2 +- contrib/man/mympd.1 | 2 +- contrib/packaging/alpine/APKBUILD | 2 +- contrib/packaging/arch/PKGBUILD | 2 +- contrib/packaging/debian/changelog | 4 ++-- contrib/packaging/freebsd/multimedia/mympd/Makefile | 2 +- .../mympd/{mympd-18.2.1.ebuild => mympd-18.2.2.ebuild} | 0 contrib/packaging/openwrt/Makefile | 2 +- contrib/packaging/rpm/mympd.spec | 4 ++-- docs/_includes/version | 2 +- htdocs/js/version.js | 4 ++-- 14 files changed, 23 insertions(+), 15 deletions(-) rename contrib/packaging/gentoo/media-sound/mympd/{mympd-18.2.1.ebuild => mympd-18.2.2.ebuild} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index feeacc183..7b61d9a88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ https://github.com/jcorporation/myMPD/ *** +## myMPD v18.2.2 (not yet released) + +This is a small bug fix release. + +### Changelog + +*** + ## myMPD v18.2.1 (2024-11-15) This is a small bug fix release. diff --git a/CMakeLists.txt b/CMakeLists.txt index cb4e64e4e..39e136323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_policy(SET CMP0003 NEW) # myMPD is written in C # supported compilers: gcc, clang project(mympd - VERSION 18.2.1 + VERSION 18.2.2 LANGUAGES C ) diff --git a/contrib/man/mympd-config.1 b/contrib/man/mympd-config.1 index 99735e508..517b4fd09 100644 --- a/contrib/man/mympd-config.1 +++ b/contrib/man/mympd-config.1 @@ -1,6 +1,6 @@ .\" Manpage for mympd-config. .\" Contact to correct errors or typos. -.TH man 1 "15 Nov 2024" "18.2.1" "mympd-config man page" +.TH man 1 "17 Nov 2024" "18.2.2" "mympd-config man page" .SH NAME mympd-config \- mympd configuration tool diff --git a/contrib/man/mympd-script.1 b/contrib/man/mympd-script.1 index 20c95b1e0..63a3b32cf 100644 --- a/contrib/man/mympd-script.1 +++ b/contrib/man/mympd-script.1 @@ -1,6 +1,6 @@ .\" Manpage for mympd-script. .\" Contact to correct errors or typos. -.TH man 1 "15 Nov 2024" "18.2.1" "mympd-script man page" +.TH man 1 "17 Nov 2024" "18.2.2" "mympd-script man page" .SH NAME mympd-script \- mympd command line tool to execute scripts diff --git a/contrib/man/mympd.1 b/contrib/man/mympd.1 index 9270ef782..75c3292c1 100644 --- a/contrib/man/mympd.1 +++ b/contrib/man/mympd.1 @@ -1,6 +1,6 @@ .\" Manpage for mympd. .\" Contact to correct errors or typos. -.TH man 1 "15 Nov 2024" "18.2.1" "mympd man page" +.TH man 1 "17 Nov 2024" "18.2.2" "mympd man page" .SH NAME myMPD \- standalone and mobile friendly web mpd client diff --git a/contrib/packaging/alpine/APKBUILD b/contrib/packaging/alpine/APKBUILD index d5069417e..59be517fd 100644 --- a/contrib/packaging/alpine/APKBUILD +++ b/contrib/packaging/alpine/APKBUILD @@ -6,7 +6,7 @@ # Maintainer: Juergen Mang # pkgname=mympd -pkgver=18.2.1 +pkgver=18.2.2 pkgrel=0 pkgdesc="myMPD is a standalone and mobile friendly web-based MPD client." url="https://jcorporation.github.io/myMPD/" diff --git a/contrib/packaging/arch/PKGBUILD b/contrib/packaging/arch/PKGBUILD index d8f0926a1..ab96c82cd 100644 --- a/contrib/packaging/arch/PKGBUILD +++ b/contrib/packaging/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Juergen Mang pkgname=mympd -pkgver=18.2.1 +pkgver=18.2.2 pkgrel=1 pkgdesc="A standalone and mobile friendly web-based MPD client." arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64') diff --git a/contrib/packaging/debian/changelog b/contrib/packaging/debian/changelog index 551eeba66..790750967 100644 --- a/contrib/packaging/debian/changelog +++ b/contrib/packaging/debian/changelog @@ -1,5 +1,5 @@ -mympd (18.2.1-1) unstable; urgency=medium +mympd (18.2.2-1) unstable; urgency=medium * Release from master - -- Juergen Mang Fri, 15 Nov 2024 17:11:31 +0100 + -- Juergen Mang Sun, 17 Nov 2024 13:11:51 +0100 diff --git a/contrib/packaging/freebsd/multimedia/mympd/Makefile b/contrib/packaging/freebsd/multimedia/mympd/Makefile index c394b1804..bcb06bb49 100644 --- a/contrib/packaging/freebsd/multimedia/mympd/Makefile +++ b/contrib/packaging/freebsd/multimedia/mympd/Makefile @@ -1,6 +1,6 @@ PORTNAME= myMPD DISTVERSIONPREFIX= v -DISTVERSION= 18.2.1 +DISTVERSION= 18.2.2 CATEGORIES= multimedia MAINTAINER= robert.david@posteo.net diff --git a/contrib/packaging/gentoo/media-sound/mympd/mympd-18.2.1.ebuild b/contrib/packaging/gentoo/media-sound/mympd/mympd-18.2.2.ebuild similarity index 100% rename from contrib/packaging/gentoo/media-sound/mympd/mympd-18.2.1.ebuild rename to contrib/packaging/gentoo/media-sound/mympd/mympd-18.2.2.ebuild diff --git a/contrib/packaging/openwrt/Makefile b/contrib/packaging/openwrt/Makefile index 8ef9cc5fc..0d668351a 100644 --- a/contrib/packaging/openwrt/Makefile +++ b/contrib/packaging/openwrt/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME := mympd -PKG_VERSION := 18.2.1 +PKG_VERSION := 18.2.2 PKG_RELEASE := 1 PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/contrib/packaging/rpm/mympd.spec b/contrib/packaging/rpm/mympd.spec index 4d01eefc3..d14876f43 100644 --- a/contrib/packaging/rpm/mympd.spec +++ b/contrib/packaging/rpm/mympd.spec @@ -4,7 +4,7 @@ # (c) 2018-2024 Juergen Mang Name: mympd -Version: 18.2.1 +Version: 18.2.2 Release: 0 License: GPL-3.0-or-later Group: Productivity/Multimedia/Sound/Players @@ -65,5 +65,5 @@ fi %license LICENSE.md %changelog -* Fri Nov 15 2024 Juergen Mang 18.2.1-0 +* Sun Nov 17 2024 Juergen Mang 18.2.2-0 - Version from master diff --git a/docs/_includes/version b/docs/_includes/version index 745b49065..e1dc037df 100644 --- a/docs/_includes/version +++ b/docs/_includes/version @@ -1 +1 @@ -18.2.1 \ No newline at end of file +18.2.2 \ No newline at end of file diff --git a/htdocs/js/version.js b/htdocs/js/version.js index 9252aaac3..dc0df5a8e 100644 --- a/htdocs/js/version.js +++ b/htdocs/js/version.js @@ -1,2 +1,2 @@ -const myMPDversion = '18.2.1'; -const myMPDbuild = 'eaf3c073529785b2b2315df909d8ccbc20fe1082'; +const myMPDversion = '18.2.2'; +const myMPDbuild = 'ff8927ef20d7de936c947930d450f92cb2f821e9'; From 332a13f1e8b9648105fe5c284c26cab78d294db1 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 17 Nov 2024 13:36:13 +0100 Subject: [PATCH 2/3] Fix: Parse hh:mm:ss timestamps #1370 --- CHANGELOG.md | 2 ++ htdocs/js/utility.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b61d9a88..27e283222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is a small bug fix release. ### Changelog +- Fix: Parse hh:mm:ss timestamps #1370 + *** ## myMPD v18.2.1 (2024-11-15) diff --git a/htdocs/js/utility.js b/htdocs/js/utility.js index d39dd11fd..dba27bc18 100644 --- a/htdocs/js/utility.js +++ b/htdocs/js/utility.js @@ -521,15 +521,15 @@ function getMyMPDuri(proto) { /** * Parses a string to seconds - * @param {string} value [hh:]mm:ss value to parse + * @param {string} value [hh:][mm:]ss value to parse * @returns {number} value in seconds */ function parseToSeconds(value) { let match = value.match(/(\d+):(\d+):(\d+)/); if (match) { return Number(match[1]) * 60 * 60 + - Number(match[1]) * 60 + - Number(match[2]); + Number(match[2]) * 60 + + Number(match[3]); } match = value.match(/(\d+):(\d+)/); if (match) { From 8999bfcbddf928857cbec2ff6f52bdf21c738f91 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 17 Nov 2024 13:23:27 +0100 Subject: [PATCH 3/3] Fix: Pause streams with known duration #1371 --- CHANGELOG.md | 1 + htdocs/js/clickActions.js | 5 +---- src/mympd_api/mympd_api_handler.c | 32 ++++++++++++++++++------------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e283222..128ee67f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This is a small bug fix release. ### Changelog - Fix: Parse hh:mm:ss timestamps #1370 +- Fix: Pause streams with known duration #1371 *** diff --git a/htdocs/js/clickActions.js b/htdocs/js/clickActions.js index beec91d38..0c181c8d4 100644 --- a/htdocs/js/clickActions.js +++ b/htdocs/js/clickActions.js @@ -270,10 +270,7 @@ function seekRelative(offset) { function clickPlay() { switch(currentState.state) { case 'play': - if (settings.webuiSettings.footerPlaybackControls === 'stop' || - isStreamUri(currentSongObj.uri) === true) - { - //always stop streams + if (settings.webuiSettings.footerPlaybackControls === 'stop') { sendAPI("MYMPD_API_PLAYER_STOP", {}, null, false); } else { diff --git a/src/mympd_api/mympd_api_handler.c b/src/mympd_api/mympd_api_handler.c index 5ce138763..5e5a8c409 100644 --- a/src/mympd_api/mympd_api_handler.c +++ b/src/mympd_api/mympd_api_handler.c @@ -739,9 +739,26 @@ void mympd_api_handler(struct t_mympd_state *mympd_state, struct t_partition_sta mpd_run_clearerror(partition_state->conn); response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_clearerror", &rc); break; + case MYMPD_API_PLAYER_PLAY: + if (mympd_api_status_clear_error(partition_state, &response->data, request->cmd_id, request->id) == false) { + break; + } + mpd_run_play(partition_state->conn); + response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_play", &rc); + break; case MYMPD_API_PLAYER_PAUSE: - mpd_run_pause(partition_state->conn, true); - response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_pause", &rc); + case MYMPD_API_PLAYER_STOP: + if (request->cmd_id == MYMPD_API_PLAYER_STOP || + partition_state->song_duration <= 0) + { + // do not pause streams with unknown duration + mpd_run_stop(partition_state->conn); + response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_stop", &rc); + } + else { + mpd_run_pause(partition_state->conn, true); + response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_pause", &rc); + } break; case MYMPD_API_PLAYER_RESUME: if (mympd_api_status_clear_error(partition_state, &response->data, request->cmd_id, request->id) == false) { @@ -758,17 +775,6 @@ void mympd_api_handler(struct t_mympd_state *mympd_state, struct t_partition_sta mpd_run_next(partition_state->conn); response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_next", &rc); break; - case MYMPD_API_PLAYER_PLAY: - if (mympd_api_status_clear_error(partition_state, &response->data, request->cmd_id, request->id) == false) { - break; - } - mpd_run_play(partition_state->conn); - response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_play", &rc); - break; - case MYMPD_API_PLAYER_STOP: - mpd_run_stop(partition_state->conn); - response->data = mympd_respond_with_error_or_ok(partition_state, response->data, request->cmd_id, request->id, "mpd_run_stop", &rc); - break; case MYMPD_API_PLAYER_PLAY_SONG: if (json_get_uint_max(request->data, "$.params.songId", &uint_buf1, &parse_error) == true) { mpd_run_play_id(partition_state->conn, uint_buf1);