git push origin developMerge branch 'jcass77-fix/226_playlist_lookup_failure' into develop
This commit is contained in:
commit
bb2073b404
@ -129,6 +129,7 @@ v2.4.0 (UNRELEASED)
|
||||
- Show all available track information in the 'Show Track Info...' popup. (Fixes: `#227 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/227>`_).
|
||||
- The last scroll position is now always saved when navigating between pages or browsing the library.
|
||||
(Fixes: `#73 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/73>`_, `#93 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/93>`_).
|
||||
- Playlists will now list tracks even if they are no longer available in the library. (Fixes: `#226 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/226>`_).
|
||||
|
||||
v2.3.0 (2016-05-15)
|
||||
-------------------
|
||||
|
||||
@ -479,9 +479,9 @@ function showOffline (on) {
|
||||
}
|
||||
|
||||
// from http://dzone.com/snippets/validate-url-regexp
|
||||
function validUri (str) {
|
||||
function validUri (uri) {
|
||||
var regexp = /^(mms|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
|
||||
return regexp.test(str)
|
||||
return regexp.test(uri)
|
||||
}
|
||||
|
||||
function validServiceUri (str) {
|
||||
@ -494,7 +494,7 @@ function getScheme (uri) {
|
||||
|
||||
function isPlayable (track) {
|
||||
if (typeof track.type === 'undefined' || track.type === 'track') {
|
||||
if (getScheme(track.uri) === 'file') {
|
||||
if (track.uri && getScheme(track.uri) === 'file') {
|
||||
var ext = track.uri.split('.').pop().toLowerCase()
|
||||
if ($.inArray(ext, audioExt) === -1) {
|
||||
// Files must have the correct extension
|
||||
|
||||
@ -192,9 +192,11 @@ function processPlaylistItems (resultDict) {
|
||||
return mopidy.library.lookup({'uris': trackUris}).then(function (tracks) {
|
||||
// Transform from dict to list and cache result
|
||||
var newplaylisturi = resultDict.uri
|
||||
var track
|
||||
playlists[newplaylisturi] = {'uri': newplaylisturi, 'tracks': []}
|
||||
for (i = 0; i < trackUris.length; i++) {
|
||||
playlists[newplaylisturi].tracks.push(tracks[trackUris[i]][0])
|
||||
track = tracks[trackUris[i]][0] || resultDict.items[i] // Fall back to using track Ref if lookup failed.
|
||||
playlists[newplaylisturi].tracks.push(track)
|
||||
}
|
||||
showLoading(false)
|
||||
return playlists[newplaylisturi].tracks
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
CACHE MANIFEST
|
||||
|
||||
# 2017-02-16:v1
|
||||
# 2017-02-16:v2
|
||||
|
||||
NETWORK:
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user