From 85f71639b0f2b91e58f2ebd4b9cb5a5ba8b5e13c Mon Sep 17 00:00:00 2001 From: John Cass Date: Sun, 6 May 2018 09:09:44 +0200 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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) + '

  • '