Show more appropriate icons for files, tracks, and directories when browsing local folder structure.
This commit is contained in:
parent
c264bc58b9
commit
4675d8ebcb
@ -112,6 +112,7 @@ v2.4.0 (UNRELEASED)
|
|||||||
(Fixes: `#213 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/213>`_).
|
(Fixes: `#213 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/213>`_).
|
||||||
- Now shows correct hostname information in loader popup. (Fixes: `#209 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/209>`_).
|
- Now shows correct hostname information in loader popup. (Fixes: `#209 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/209>`_).
|
||||||
- Now shows server name/IP address and port number at the bottom of the navigation pane. (Fixes: `#67 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/67>`_).
|
- Now shows server name/IP address and port number at the bottom of the navigation pane. (Fixes: `#67 <https://github.com/pimusicbox/mopidy-musicbox-webclient/issues/67>`_).
|
||||||
|
- Use correct icons for folders, audio, and other files when browsing local files.
|
||||||
|
|
||||||
v2.3.0 (2016-05-15)
|
v2.3.0 (2016-05-15)
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
@ -77,7 +77,7 @@ var uriClassList = [
|
|||||||
['spotify', 'fa-spotify'],
|
['spotify', 'fa-spotify'],
|
||||||
['spotifytunigo', 'fa-spotify'],
|
['spotifytunigo', 'fa-spotify'],
|
||||||
['local', 'fa-file-sound-o'],
|
['local', 'fa-file-sound-o'],
|
||||||
['file', 'fa-folder-o'],
|
['file', 'fa-file-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+file', 'fa-rss-square'],
|
||||||
@ -103,7 +103,7 @@ var uriClassList = [
|
|||||||
var uriHumanList = [
|
var uriHumanList = [
|
||||||
['spotify', 'Spotify'],
|
['spotify', 'Spotify'],
|
||||||
['spotifytunigo', 'Spotify browse'],
|
['spotifytunigo', 'Spotify browse'],
|
||||||
['local', 'Local files'],
|
['local', 'Local media'],
|
||||||
['m3u', 'Local playlists'],
|
['m3u', 'Local playlists'],
|
||||||
['podcast', 'Podcasts'],
|
['podcast', 'Podcasts'],
|
||||||
['podcast+itunes', 'iTunes Store: Podcasts'],
|
['podcast+itunes', 'iTunes Store: Podcasts'],
|
||||||
@ -131,6 +131,34 @@ var searchBlacklist = [
|
|||||||
'yt'
|
'yt'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// List of known audio file extensions
|
||||||
|
// TODO: consider querying GStreamer for supported audio formats - see:https://discuss.mopidy.com/t/supported-codecs-file-formats/473
|
||||||
|
var audioExt = [
|
||||||
|
'aa', 'aax', // Audible.com
|
||||||
|
'aac', // Advanced Audio Coding format
|
||||||
|
'aiff', // Apple
|
||||||
|
'au', // Sun Microsystems
|
||||||
|
'flac', // Free Lossless Audio Codec
|
||||||
|
'gsm',
|
||||||
|
'iklax',
|
||||||
|
'ivs',
|
||||||
|
'm4a',
|
||||||
|
'm4b',
|
||||||
|
'm4p',
|
||||||
|
'mp3',
|
||||||
|
'mpc', // Musepack
|
||||||
|
'ogg', 'oga', 'mogg', // Ogg-Vorbis
|
||||||
|
'opus', // Internet Engineering Task Force (IETF)
|
||||||
|
'ra', 'rm', // RealAudio
|
||||||
|
'raw',
|
||||||
|
'tta', // True Audio
|
||||||
|
'vox',
|
||||||
|
'wav',
|
||||||
|
'wma', // Microsoft
|
||||||
|
'wv',
|
||||||
|
'webm' // HTML5 video
|
||||||
|
]
|
||||||
|
|
||||||
function scrollToTop () {
|
function scrollToTop () {
|
||||||
var divtop = 0
|
var divtop = 0
|
||||||
$('body,html').animate({
|
$('body,html').animate({
|
||||||
@ -493,6 +521,11 @@ function getScheme (uri) {
|
|||||||
return uri.split(':')[0].toLowerCase()
|
return uri.split(':')[0].toLowerCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isAudioFile (uri) {
|
||||||
|
var ext = uri.split('.').pop().toLowerCase()
|
||||||
|
return $.inArray(ext, audioExt) !== -1
|
||||||
|
}
|
||||||
|
|
||||||
function isStreamUri (uri) {
|
function isStreamUri (uri) {
|
||||||
var a = validUri(uri)
|
var a = validUri(uri)
|
||||||
var b = radioExtensionsList.indexOf(getScheme(uri)) >= 0
|
var b = radioExtensionsList.indexOf(getScheme(uri)) >= 0
|
||||||
@ -501,6 +534,9 @@ function isStreamUri (uri) {
|
|||||||
|
|
||||||
function getMediaClass (uri) {
|
function getMediaClass (uri) {
|
||||||
var scheme = getScheme(uri)
|
var scheme = getScheme(uri)
|
||||||
|
if (scheme === 'file' && isAudioFile(uri)) {
|
||||||
|
return 'fa fa-file-sound-o'
|
||||||
|
}
|
||||||
for (var i = 0; i < uriClassList.length; i++) {
|
for (var i = 0; i < uriClassList.length; i++) {
|
||||||
if (scheme === uriClassList[i][0]) {
|
if (scheme === uriClassList[i][0]) {
|
||||||
return 'fa ' + uriClassList[i][1]
|
return 'fa ' + uriClassList[i][1]
|
||||||
|
|||||||
@ -106,7 +106,7 @@ function processBrowseDir (resultArr) {
|
|||||||
index++
|
index++
|
||||||
} else {
|
} else {
|
||||||
var iconClass = ''
|
var iconClass = ''
|
||||||
if (browseStack.length > 0) {
|
if (browseStack.length > 0 && resultArr[i].type === 'directory') {
|
||||||
iconClass = 'fa fa-folder-o'
|
iconClass = 'fa fa-folder-o'
|
||||||
} else {
|
} else {
|
||||||
iconClass = getMediaClass(resultArr[i].uri)
|
iconClass = getMediaClass(resultArr[i].uri)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
CACHE MANIFEST
|
CACHE MANIFEST
|
||||||
|
|
||||||
# 2016-12-11:v1
|
# 2017-01-06:v1
|
||||||
|
|
||||||
NETWORK:
|
NETWORK:
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user