From cc644203a0e7257975eb0344140bc4f7220a15ca Mon Sep 17 00:00:00 2001 From: Markus Jung Date: Sat, 15 Jul 2017 21:11:10 +0200 Subject: [PATCH 01/11] Recognize rtmp/-s and rtsp stream URIs as valid --- mopidy_musicbox_webclient/static/js/functionsvars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy_musicbox_webclient/static/js/functionsvars.js b/mopidy_musicbox_webclient/static/js/functionsvars.js index 21d57a7..aae009d 100644 --- a/mopidy_musicbox_webclient/static/js/functionsvars.js +++ b/mopidy_musicbox_webclient/static/js/functionsvars.js @@ -482,7 +482,7 @@ function showOffline (on) { // from http://dzone.com/snippets/validate-url-regexp function validUri (uri) { - var regexp = /^(mms|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ + var regexp = /^(http|https|mms|rtmp|rtmps|rtsp):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ return regexp.test(uri) } From 4879c3e3ce2a435069cf5139d5a8682e544b1059 Mon Sep 17 00:00:00 2001 From: John Cass Date: Sat, 7 Oct 2017 06:12:19 +0200 Subject: [PATCH 02/11] Prevent subsequent sync attempts until getTimePosition returns. (#238) Fixes #237. --- README.rst | 7 +++++++ mopidy_musicbox_webclient/static/js/synced_timer.js | 9 ++++++--- mopidy_musicbox_webclient/static/mb.appcache | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index c061c13..c53e9d8 100644 --- a/README.rst +++ b/README.rst @@ -105,6 +105,13 @@ Project resources Changelog ========= +(UNRELEASED) +------------ + +**Fixes** + +- Prevent excessive calls to the Mopidy server while buffering. (Fixes: `#237 `_). + v2.4.0 (2017-03-15) ------------------- diff --git a/mopidy_musicbox_webclient/static/js/synced_timer.js b/mopidy_musicbox_webclient/static/js/synced_timer.js index aaa6c04..8aabda8 100644 --- a/mopidy_musicbox_webclient/static/js/synced_timer.js +++ b/mopidy_musicbox_webclient/static/js/synced_timer.js @@ -106,7 +106,9 @@ // check in the timeout callback than doing another function call. clearTimeout(this._scheduleID) this._isSyncScheduled = false - this._scheduleID = setTimeout($.proxy(function () { this._isSyncScheduled = true }, this), milliseconds) + if (milliseconds >= 0) { + this._scheduleID = setTimeout($.proxy(function () { this._isSyncScheduled = true }, this), milliseconds) + } } SyncedProgressTimer.prototype._doSync = function (position, duration) { @@ -116,6 +118,8 @@ return } + this._scheduleSync(-1) // Ensure that only one sync process is active at a time. + var _this = this _this._mopidy.playback.getTimePosition().then(function (targetPosition) { if (_this.syncState === SyncedProgressTimer.SYNC_STATE.NOT_SYNCED) { @@ -179,8 +183,7 @@ SyncedProgressTimer.prototype.stop = function () { this._progressTimer.stop() - clearTimeout(this._scheduleID) - this._isSyncScheduled = false + this._scheduleSync(-1) if (this.syncState !== SyncedProgressTimer.SYNC_STATE.SYNCED && this._previousSyncPosition) { // Timer was busy trying to sync when it was stopped, fallback to displaying the last synced position on screen. this.positionNode.nodeValue = SyncedProgressTimer.format(this._previousSyncPosition) diff --git a/mopidy_musicbox_webclient/static/mb.appcache b/mopidy_musicbox_webclient/static/mb.appcache index 52a48d8..d9397c6 100644 --- a/mopidy_musicbox_webclient/static/mb.appcache +++ b/mopidy_musicbox_webclient/static/mb.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2017-02-26:v1 +# 2017-04-14:v1 NETWORK: * From bc614a5036a49cd3b1730a66053ad0f958776faa Mon Sep 17 00:00:00 2001 From: jcass Date: Sat, 7 Oct 2017 06:16:56 +0200 Subject: [PATCH 03/11] docs: Changelog entry for previously committed PR. --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index c53e9d8..8d99f1b 100644 --- a/README.rst +++ b/README.rst @@ -110,6 +110,7 @@ Changelog **Fixes** +- Detect additional stream formats (rtmp, rtmps, rtsp). - Prevent excessive calls to the Mopidy server while buffering. (Fixes: `#237 `_). v2.4.0 (2017-03-15) From 3038875533895fb50b676d586edaa9510c07eb5f Mon Sep 17 00:00:00 2001 From: jcass Date: Sat, 7 Oct 2017 09:52:31 +0200 Subject: [PATCH 04/11] Include details of currently selected page in HTML title tag. Fixes #243. --- README.rst | 1 + mopidy_musicbox_webclient/static/index.html | 2 +- mopidy_musicbox_webclient/static/js/gui.js | 17 ++++++++++++----- mopidy_musicbox_webclient/static/mb.appcache | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 8d99f1b..00b7699 100644 --- a/README.rst +++ b/README.rst @@ -112,6 +112,7 @@ Changelog - Detect additional stream formats (rtmp, rtmps, rtsp). - Prevent excessive calls to the Mopidy server while buffering. (Fixes: `#237 `_). +- Include details of currently selected page in HTML title tag. (Addresses: `#243 `_). v2.4.0 (2017-03-15) ------------------- diff --git a/mopidy_musicbox_webclient/static/index.html b/mopidy_musicbox_webclient/static/index.html index f7b1eed..715c7b0 100644 --- a/mopidy_musicbox_webclient/static/index.html +++ b/mopidy_musicbox_webclient/static/index.html @@ -36,7 +36,7 @@ - +
diff --git a/mopidy_musicbox_webclient/static/js/gui.js b/mopidy_musicbox_webclient/static/js/gui.js index ee1d242..aaafd49 100644 --- a/mopidy_musicbox_webclient/static/js/gui.js +++ b/mopidy_musicbox_webclient/static/js/gui.js @@ -338,11 +338,12 @@ function switchContent (divid, uri) { function setHeadline (site) { site = site.trim() - str = $('.mainNav').find('a[href$=' + site + ']').text() - if (str === '') { - str = site.charAt(0).toUpperCase() + site.slice(1) + headline = $('.mainNav').find('a[href$=' + site + ']').text() + if (headline === '') { + headline = site.charAt(0).toUpperCase() + site.slice(1) } - $('#contentHeadline').html('' + str + '') + $('#contentHeadline').html('' + headline + '') + return headline } // update tracklist options. @@ -371,7 +372,8 @@ function locationHashChanged () { var divid = hash[0].substr(1) var uri = hash[1] - setHeadline(divid) + headline = setHeadline(divid) + updateDocumentTitle(headline) if ($(window).width() < 880) { $('#panel').panel('close') @@ -621,3 +623,8 @@ function updatePlayIcons (uri, tlid, popupMenuIcon) { }) } } + +function updateDocumentTitle (headline) { + headline = headline || $('#contentHeadline').text() + document.title = headline + ' | ' + $(document.body).data('title') +} diff --git a/mopidy_musicbox_webclient/static/mb.appcache b/mopidy_musicbox_webclient/static/mb.appcache index d9397c6..bc10b6f 100644 --- a/mopidy_musicbox_webclient/static/mb.appcache +++ b/mopidy_musicbox_webclient/static/mb.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2017-04-14:v1 +# 2017-10-07:v1 NETWORK: * From 85f71639b0f2b91e58f2ebd4b9cb5a5ba8b5e13c Mon Sep 17 00:00:00 2001 From: John Cass Date: Sun, 6 May 2018 09:09:44 +0200 Subject: [PATCH 05/11] Don't allow browsing tracks by album if album URI is not available. Fixes #250. --- README.rst | 6 ++++-- mopidy_musicbox_webclient/static/js/functionsvars.js | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 00b7699..fadb6ff 100644 --- a/README.rst +++ b/README.rst @@ -108,11 +108,13 @@ Changelog (UNRELEASED) ------------ +- Detect additional stream formats (rtmp, rtmps, rtsp). +- Include details of currently selected page in HTML title tag. (Addresses: `#243 `_). + **Fixes** -- Detect additional stream formats (rtmp, rtmps, rtsp). - Prevent excessive calls to the Mopidy server while buffering. (Fixes: `#237 `_). -- Include details of currently selected page in HTML title tag. (Addresses: `#243 `_). +- Only allow browsing tracks by album if a URI is available for that album. (Fixes: `#250 `_). v2.4.0 (2017-03-15) ------------------- diff --git a/mopidy_musicbox_webclient/static/js/functionsvars.js b/mopidy_musicbox_webclient/static/js/functionsvars.js index aae009d..774f20e 100644 --- a/mopidy_musicbox_webclient/static/js/functionsvars.js +++ b/mopidy_musicbox_webclient/static/js/functionsvars.js @@ -306,8 +306,12 @@ function renderSongLiDivider (previousTrack, track, nextTrack, target) { // Render differently if part of an album. if (!hasSameAlbum(previousTrack, track) && hasSameAlbum(track, nextTrack)) { // Large divider with album cover. + showAlbum = '' + if (typeof track.album.uri !== 'undefined') { + showAlbum = 'onclick="return library.showAlbum(\'' + track.album.uri + '\', mopidy);' + } html += - '
  • ' + + '
  • ' + '

    ' + track.album.name + '

    ' + renderSongLiTrackArtists(track) + '

  • ' From 4fdba287ac4637e8df74519e1236876b72ee3af0 Mon Sep 17 00:00:00 2001 From: John Cass Date: Sun, 6 May 2018 09:42:48 +0200 Subject: [PATCH 06/11] Remove deprecated `--allow-unverified` pip option. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 22ff53e..ab606f9 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ deps = pytest-cov pytest-xdist responses -install_command = pip install --allow-unverified=mopidy --pre {opts} {packages} +install_command = pip install --pre {opts} {packages} commands = py.test \ --basetemp={envtmpdir} \ From 2ee949e822d34214a9db73f3409693394f2b0a3d Mon Sep 17 00:00:00 2001 From: John Cass Date: Sun, 6 May 2018 09:57:24 +0200 Subject: [PATCH 07/11] Set minimum required python version for Tornado. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec29c38..f03ef05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,10 @@ dist: trusty language: python python: - - "2.7_with_system_site_packages" + - "2.7.9" + +virtualenv: + system_site_packages: true addons: apt: @@ -22,7 +25,6 @@ env: - TOX_ENV=tidy before_install: - - "sudo sed -i '/127.0.1.1/d' /etc/hosts" # Workaround https://github.com/tornadoweb/tornado/issues/1573 - "sudo apt-get update -qq" install: From 6e59d6d2a0d8b15791158a81609ba1ebc11c6dd5 Mon Sep 17 00:00:00 2001 From: John Cass Date: Sun, 6 May 2018 10:09:27 +0200 Subject: [PATCH 08/11] Roll back python version dependency that does not support site packages. https://docs.travis-ci.com/user/languages/python/#Travis-CI-Uses-Isolated-virtualenvs --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f03ef05..ed86b4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,7 @@ dist: trusty language: python python: - - "2.7.9" - -virtualenv: - system_site_packages: true + - "2.7_with_system_site_packages" addons: apt: From 49b79c0a7e1c64a2cd7f35096a536b85f7da82db Mon Sep 17 00:00:00 2001 From: John Cass Date: Mon, 7 May 2018 04:54:07 +0200 Subject: [PATCH 09/11] Fix HTML markup. --- mopidy_musicbox_webclient/static/js/functionsvars.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mopidy_musicbox_webclient/static/js/functionsvars.js b/mopidy_musicbox_webclient/static/js/functionsvars.js index 774f20e..1990ca8 100644 --- a/mopidy_musicbox_webclient/static/js/functionsvars.js +++ b/mopidy_musicbox_webclient/static/js/functionsvars.js @@ -308,10 +308,10 @@ function renderSongLiDivider (previousTrack, track, nextTrack, target) { // Large divider with album cover. showAlbum = '' if (typeof track.album.uri !== 'undefined') { - showAlbum = 'onclick="return library.showAlbum(\'' + track.album.uri + '\', mopidy);' + showAlbum = 'onclick="return library.showAlbum(\'' + track.album.uri + '\', mopidy);"' } html += - '
  • ' + '' + '

    ' + track.album.name + '

    ' + renderSongLiTrackArtists(track) + '

  • ' From b9ace059ccb20e02d26bd6bd86021f6cad8c4a87 Mon Sep 17 00:00:00 2001 From: Nick Steel Date: Mon, 14 May 2018 17:35:42 +0100 Subject: [PATCH 10/11] Fixed flake8 import newline --- mopidy_musicbox_webclient/web.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mopidy_musicbox_webclient/web.py b/mopidy_musicbox_webclient/web.py index 72f62fd..a99c043 100644 --- a/mopidy_musicbox_webclient/web.py +++ b/mopidy_musicbox_webclient/web.py @@ -1,7 +1,6 @@ from __future__ import absolute_import, division, print_function, unicode_literals import json - import logging import socket import string From 1479de9bf7a53b56aef2c81ba53a7b0a291cecdc Mon Sep 17 00:00:00 2001 From: Nick Steel Date: Tue, 22 May 2018 00:04:42 +0100 Subject: [PATCH 11/11] Bump version v2.5.0 and changelog --- README.rst | 6 +++--- mopidy_musicbox_webclient/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index fadb6ff..55459c5 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Installation Install by running:: - pip install mopidy-musicbox-webclient + sudo pip install mopidy-musicbox-webclient Alternatively, clone the repository and run ``sudo python setup.py install`` from within the project directory. e.g. :: @@ -105,7 +105,7 @@ Project resources Changelog ========= -(UNRELEASED) +v2.5.0 (2017-05-22) ------------ - Detect additional stream formats (rtmp, rtmps, rtsp). @@ -114,7 +114,7 @@ Changelog **Fixes** - Prevent excessive calls to the Mopidy server while buffering. (Fixes: `#237 `_). -- Only allow browsing tracks by album if a URI is available for that album. (Fixes: `#250 `_). +- Only allow browsing tracks by album if a URI is available for that album. (Fixes: `#250 `_). v2.4.0 (2017-03-15) ------------------- diff --git a/mopidy_musicbox_webclient/__init__.py b/mopidy_musicbox_webclient/__init__.py index 36a3c5b..0931053 100644 --- a/mopidy_musicbox_webclient/__init__.py +++ b/mopidy_musicbox_webclient/__init__.py @@ -4,7 +4,7 @@ import os from mopidy import config, ext -__version__ = '2.4.0' +__version__ = '2.5.0' class Extension(ext.Extension):