Merge branch 'enhance/podcast_icons' of https://github.com/jcass77/Mopidy-MusicBox-Webclient into jcass77-enhance/podcast_icons
This commit is contained in:
commit
69fa94114f
@ -147,6 +147,7 @@ v2.3.0 (UNRELEASED)
|
|||||||
(Fixes: `#191 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/191>`_).
|
(Fixes: `#191 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/191>`_).
|
||||||
- Clearing the queue should no longer trigger an album cover image lookup.
|
- Clearing the queue should no longer trigger an album cover image lookup.
|
||||||
(Fixes: `#201 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/201>`_).
|
(Fixes: `#201 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/201>`_).
|
||||||
|
- Update icons and labels for podcast, podcast-gpodder, and podcast-itunes backends.
|
||||||
|
|
||||||
v2.2.0 (2016-03-01)
|
v2.2.0 (2016-03-01)
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
@ -79,6 +79,8 @@ var uriClassList = [
|
|||||||
['file', 'fa-folder-o'],
|
['file', 'fa-folder-o'],
|
||||||
['m3u', 'fa-file-sound-o'],
|
['m3u', 'fa-file-sound-o'],
|
||||||
['podcast', 'fa-rss-square'],
|
['podcast', 'fa-rss-square'],
|
||||||
|
['podcast+file', 'fa-rss-square'],
|
||||||
|
['podcast+itunes', 'fa-apple'],
|
||||||
['dirble', 'fa-microphone'],
|
['dirble', 'fa-microphone'],
|
||||||
['tunein', 'fa-headphones'],
|
['tunein', 'fa-headphones'],
|
||||||
['soundcloud', 'fa-soundcloud'],
|
['soundcloud', 'fa-soundcloud'],
|
||||||
@ -92,12 +94,18 @@ var uriClassList = [
|
|||||||
['subsonic', 'fa-folder-open']
|
['subsonic', 'fa-folder-open']
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// TODO: It should be possible to retrieve a user-friendly name for a given Mopidy scheme dynamically by
|
||||||
|
// calling mopidy.library.browse() on the root dir:
|
||||||
|
// 1. each backend contained in the result will have a 'name' attribute that can be shown as-is in the UI.
|
||||||
|
// 2. the URI prefix of the backend result should === mopidy.getUriSchemes(), which can be used for the mapping.
|
||||||
|
// 3. only backends that cannot be 'browsed' (e.g. youtube) should have a static mapping defined here.
|
||||||
var uriHumanList = [
|
var uriHumanList = [
|
||||||
['spotify', 'Spotify'],
|
['spotify', 'Spotify'],
|
||||||
['spotifytunigo', 'Spotify browse'],
|
['spotifytunigo', 'Spotify browse'],
|
||||||
['local', 'Local files'],
|
['local', 'Local files'],
|
||||||
['m3u', 'Local playlists'],
|
['m3u', 'Local playlists'],
|
||||||
['podcast', 'Podcasts'],
|
['podcast', 'Podcasts'],
|
||||||
|
['podcast+itunes', 'iTunes Store: Podcasts'],
|
||||||
['dirble', 'Dirble'],
|
['dirble', 'Dirble'],
|
||||||
['tunein', 'TuneIn'],
|
['tunein', 'TuneIn'],
|
||||||
['soundcloud', 'SoundCloud'],
|
['soundcloud', 'SoundCloud'],
|
||||||
@ -507,7 +515,7 @@ function getMediaHuman (uri) {
|
|||||||
return uriHumanList[i][1]
|
return uriHumanList[i][1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return uri
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function isServiceUri (uri) {
|
function isServiceUri (uri) {
|
||||||
|
|||||||
@ -337,7 +337,10 @@
|
|||||||
})
|
})
|
||||||
for (var i = 0; i < schemesArray.length; i++) {
|
for (var i = 0; i < schemesArray.length; i++) {
|
||||||
backendName = getMediaHuman(schemesArray[i])
|
backendName = getMediaHuman(schemesArray[i])
|
||||||
backendName = backendName.charAt(0).toUpperCase() + backendName.slice(1)
|
if (!backendName) {
|
||||||
|
// No mapping defined, revert to just showing the scheme with first letter capitalized.
|
||||||
|
backendName = schemesArray[i].charAt(0).toUpperCase() + schemesArray[i].slice(1)
|
||||||
|
}
|
||||||
$('#selectSearchService').append(new Option(backendName, schemesArray[i]))
|
$('#selectSearchService').append(new Option(backendName, schemesArray[i]))
|
||||||
}
|
}
|
||||||
$('#selectSearchService').val(searchScheme)
|
$('#selectSearchService').val(searchScheme)
|
||||||
|
|||||||
@ -17,17 +17,22 @@ describe('Library', function () {
|
|||||||
$(document.body).append('<select id="selectSearchService"></select>')
|
$(document.body).append('<select id="selectSearchService"></select>')
|
||||||
$('#selectSearchService').selectmenu()
|
$('#selectSearchService').selectmenu()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
uriHumanList = [
|
||||||
|
['mockScheme1', 'mockUriHuman1'],
|
||||||
|
['mockScheme2', 'mockUriHuman2']
|
||||||
|
]
|
||||||
|
})
|
||||||
describe('#getSearchSchemes()', function () {
|
describe('#getSearchSchemes()', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$(selectID).empty()
|
$(selectID).empty()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should add human-readable options for backend schemes', function () {
|
it('should add human-readable options for backend schemes', function () {
|
||||||
uriHumanList = [['mockScheme2', 'mockUriHuman2']]
|
|
||||||
|
|
||||||
library.getSearchSchemes([], mopidy)
|
library.getSearchSchemes([], mopidy)
|
||||||
assert.equal($(selectID).children().length, schemesArray.length + 1)
|
assert.equal($(selectID).children().length, schemesArray.length + 1)
|
||||||
expect($(selectID).children(':eq(2)')).to.have.text('MockUriHuman2')
|
expect($(selectID).children(':eq(2)')).to.have.text('mockUriHuman2')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should get default value from cookie', function () {
|
it('should get default value from cookie', function () {
|
||||||
@ -42,9 +47,9 @@ describe('Library', function () {
|
|||||||
expect($(selectID + ' option:selected')).to.have.value('all')
|
expect($(selectID + ' option:selected')).to.have.value('all')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should capitalize first character of backend schema', function () {
|
it('should capitalize first character of backend schema if no mapping is provided', function () {
|
||||||
library.getSearchSchemes([], mopidy)
|
library.getSearchSchemes([], mopidy)
|
||||||
expect($(selectID).children(':eq(1)')).to.have.text('MockScheme1')
|
expect($(selectID).children(':eq(3)')).to.have.text('MockScheme3')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should blacklist services that should not be searched', function () {
|
it('should blacklist services that should not be searched', function () {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user