diff --git a/.travis.yml b/.travis.yml index ec29c38..ed86b4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,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: diff --git a/README.rst b/README.rst index c061c13..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,6 +105,17 @@ Project resources Changelog ========= +v2.5.0 (2017-05-22) +------------ + +- Detect additional stream formats (rtmp, rtmps, rtsp). +- Include details of currently selected page in HTML title tag. (Addresses: `#243 `_). + +**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 `_). + 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): 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/functionsvars.js b/mopidy_musicbox_webclient/static/js/functionsvars.js index 21d57a7..1990ca8 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) + '

  • ' @@ -482,7 +486,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) } 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/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..bc10b6f 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-10-07:v1 NETWORK: * 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 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} \