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) {