Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into enhance/75_add_t…
Browse files Browse the repository at this point in the history
…rack_uri_to_queue

# Conflicts:
#	README.rst
#	mopidy_musicbox_webclient/static/mb.appcache
  • Loading branch information
jcass77 committed Jan 6, 2017
2 parents 45dd2d6 + f3a45d0 commit 7892218
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ v2.4.0 (UNRELEASED)
(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 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.
- Reset 'Now Playing' info when the last track in the tracklist is deleted. Fixes an issue where info of the last song played would be displayed even after the queue had been cleared.

v2.3.0 (2016-05-15)
Expand Down
40 changes: 38 additions & 2 deletions mopidy_musicbox_webclient/static/js/functionsvars.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var uriClassList = [
['spotify', 'fa-spotify'],
['spotifytunigo', 'fa-spotify'],
['local', 'fa-file-sound-o'],
['file', 'fa-folder-o'],
['file', 'fa-file-o'],
['m3u', 'fa-file-sound-o'],
['podcast', 'fa-rss-square'],
['podcast+file', 'fa-rss-square'],
Expand All @@ -103,7 +103,7 @@ var uriClassList = [
var uriHumanList = [
['spotify', 'Spotify'],
['spotifytunigo', 'Spotify browse'],
['local', 'Local files'],
['local', 'Local media'],
['m3u', 'Local playlists'],
['podcast', 'Podcasts'],
['podcast+itunes', 'iTunes Store: Podcasts'],
Expand Down Expand Up @@ -131,6 +131,34 @@ var searchBlacklist = [
'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 () {
var divtop = 0
$('body,html').animate({
Expand Down Expand Up @@ -493,6 +521,11 @@ function getScheme (uri) {
return uri.split(':')[0].toLowerCase()
}

function isAudioFile (uri) {
var ext = uri.split('.').pop().toLowerCase()
return $.inArray(ext, audioExt) !== -1
}

function isStreamUri (uri) {
var a = validUri(uri)
var b = radioExtensionsList.indexOf(getScheme(uri)) >= 0
Expand All @@ -501,6 +534,9 @@ function isStreamUri (uri) {

function getMediaClass (uri) {
var scheme = getScheme(uri)
if (scheme === 'file' && isAudioFile(uri)) {
return 'fa fa-file-sound-o'
}
for (var i = 0; i < uriClassList.length; i++) {
if (scheme === uriClassList[i][0]) {
return 'fa ' + uriClassList[i][1]
Expand Down
2 changes: 1 addition & 1 deletion mopidy_musicbox_webclient/static/js/process_ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function processBrowseDir (resultArr) {
index++
} else {
var iconClass = ''
if (browseStack.length > 0) {
if (browseStack.length > 0 && resultArr[i].type === 'directory') {
iconClass = 'fa fa-folder-o'
} else {
iconClass = getMediaClass(resultArr[i].uri)
Expand Down

0 comments on commit 7892218

Please sign in to comment.