diff --git a/README.rst b/README.rst index 27e49c9..d39cf57 100644 --- a/README.rst +++ b/README.rst @@ -131,6 +131,7 @@ v2.4.0 (UNRELEASED) (Fixes: `#73 `_, `#93 `_). - Playlists will now list tracks even if they are no longer available in the library. (Fixes: `#226 `_). - Fixed an issue on Safari where the first page to load would be too wide to fit on the screen. +- Refreshing album or artist info pages no longer raises an exception. (Fixes: `#230 `_). v2.3.0 (2016-05-15) ------------------- diff --git a/mopidy_musicbox_webclient/static/index.html b/mopidy_musicbox_webclient/static/index.html index 2928022..f7b1eed 100644 --- a/mopidy_musicbox_webclient/static/index.html +++ b/mopidy_musicbox_webclient/static/index.html @@ -140,10 +140,10 @@ Add All to Bottom of Queue
  • - Show Album + Show Album
  • - Show Artist + Show Artist
  • @@ -170,10 +170,10 @@ Remove from Queue
  • - Show Album + Show Album
  • - Show Artist + Show Artist
  • diff --git a/mopidy_musicbox_webclient/static/js/functionsvars.js b/mopidy_musicbox_webclient/static/js/functionsvars.js index b976340..24b467b 100644 --- a/mopidy_musicbox_webclient/static/js/functionsvars.js +++ b/mopidy_musicbox_webclient/static/js/functionsvars.js @@ -305,7 +305,7 @@ function renderSongLiDivider (previousTrack, track, nextTrack, target) { if (!hasSameAlbum(previousTrack, track) && hasSameAlbum(track, nextTrack)) { // Large divider with album cover. html += - '
  • ' + + '
  • ' + '' + '

    ' + track.album.name + '

    ' + renderSongLiTrackArtists(track) + '

  • ' diff --git a/mopidy_musicbox_webclient/static/js/gui.js b/mopidy_musicbox_webclient/static/js/gui.js index 71cc0e2..ee1d242 100644 --- a/mopidy_musicbox_webclient/static/js/gui.js +++ b/mopidy_musicbox_webclient/static/js/gui.js @@ -84,7 +84,7 @@ function setSongInfo (data) { if (data.track.artists) { for (var j = 0; j < data.track.artists.length; j++) { - artistshtml += '' + data.track.artists[j].name + '' + artistshtml += '' + data.track.artists[j].name + '' artiststext += data.track.artists[j].name if (j !== data.track.artists.length - 1) { artistshtml += ', ' @@ -94,7 +94,7 @@ function setSongInfo (data) { arttmp = artistshtml } if (data.track.album && data.track.album.name) { - $('#modalalbum').html('' + data.track.album.name + '') + $('#modalalbum').html('' + data.track.album.name + '') } else { $('#modalalbum').html('') } @@ -138,9 +138,9 @@ function popupTracks (e, listuri, trackuri, tlid) { $('.popupArtistsDiv').hide() if (popupData[trackuri].artists) { if (popupData[trackuri].artists.length === 1 && popupData[trackuri].artists[0].uri) { - child = 'Show Artist' + child = 'Show Artist' $('.popupArtistName').html(popupData[trackuri].artists[0].name) - $('.popupArtistHref').attr('onclick', 'library.showArtist("' + popupData[trackuri].artists[0].uri + '");') + $('.popupArtistHref').attr('onclick', 'library.showArtist(\'' + popupData[trackuri].artists[0].uri + '\', mopidy);') $('.popupArtistsDiv').hide() $('.popupArtistsLi').show() } else { @@ -148,7 +148,7 @@ function popupTracks (e, listuri, trackuri, tlid) { for (var j = 0; j < popupData[trackuri].artists.length; j++) { if (popupData[trackuri].artists[j].uri) { isValidArtistURI = true - child += '
  • ' + popupData[trackuri].artists[j].name + '
  • ' + child += '
  • ' + popupData[trackuri].artists[j].name + '
  • ' } } if (isValidArtistURI) { @@ -192,7 +192,7 @@ function popupTracks (e, listuri, trackuri, tlid) { function showAlbumPopup (popupId) { uri = $(popupId).data('track') - library.showAlbum(popupData[uri].album.uri) + library.showAlbum(popupData[uri].album.uri, mopidy) } /** ******************** @@ -401,12 +401,20 @@ function locationHashChanged () { break case 'artists': if (uri !== '') { - library.showArtist(uri) + if (mopidy) { + library.showArtist(uri, mopidy) + } else { + showOffline(true) // Page refreshed - wait for mopidy object to be initialized. + } } break case 'albums': if (uri !== '') { - library.showAlbum(uri) + if (mopidy) { + library.showAlbum(uri, mopidy) + } else { + showOffline(true) // Page refreshed - wait for mopidy object to be initialized. + } } break default: // Default footer diff --git a/mopidy_musicbox_webclient/static/js/library.js b/mopidy_musicbox_webclient/static/js/library.js index 6a90367..9ca8d92 100644 --- a/mopidy_musicbox_webclient/static/js/library.js +++ b/mopidy_musicbox_webclient/static/js/library.js @@ -131,7 +131,7 @@ // Artist results var child = '' - var template = '
  • {name}
  • ' + var template = '
  • {name}
  • ' var tokens for (i = 0; i < results.artists.length; i++) { @@ -155,7 +155,7 @@ // Album results child = '' - template = '
  • ' + template = '
  • ' template += '
    {albumName}
    ' template += '

    {artistName}

    ' template += '
  • ' @@ -269,7 +269,7 @@ return false }, - showArtist: function (nwuri) { + showArtist: function (nwuri, mopidy) { $('#popupQueue').popup('close') $('#popupTracks').popup('close') $('#controlsmodal').popup('close') @@ -288,7 +288,7 @@ return false }, - showAlbum: function (uri) { + showAlbum: function (uri, mopidy) { $('#popupQueue').popup('close') $('#popupTracks').popup('close') $('#controlsmodal').popup('close') diff --git a/mopidy_musicbox_webclient/static/mb.appcache b/mopidy_musicbox_webclient/static/mb.appcache index 3c6f198..52a48d8 100644 --- a/mopidy_musicbox_webclient/static/mb.appcache +++ b/mopidy_musicbox_webclient/static/mb.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2017-02-24:v1 +# 2017-02-26:v1 NETWORK: *