Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# Configuration directory used by Visual Studio Code
.vscode

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

Expand Down
20 changes: 15 additions & 5 deletions app/plugins/music_service/mpd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ var parser = require('cue-parser');
var mm = require('musicmetadata');
var os = require('os');
var execSync = require('child_process').execSync;
var timSort = require('timsort');
var ignoreupdate = false;
//tracknumbers variable below adds track numbers to titles if set to true. Set to false for normal behavour.
var tracknumbers = false;
//compilation array below adds different strings used to describe albumartist in compilations or 'multiple artist' albums
var compilation = ['Various','various','Various Artists','various artists','VA','va'];
//atistsort variable below will list artists by albumartist if set to true or artist if set to false
//artistsort variable below will list artists by albumartist if set to true or artist if set to false
var artistsort = true;
var dsd_autovolume = false;
var singleBrowse = false;
Expand Down Expand Up @@ -2992,11 +2993,20 @@ ControllerMpd.prototype.listAlbums = function (ui) {
uri: 'albums://' + encodeURIComponent(artistName) + '/'+ encodeURIComponent(albumName),
//Get correct album art from path- only download if not existent
albumart: self.getAlbumArt({artist: artistName, album: albumName}, self.getParentFolder('/mnt/' + path),'dot-circle-o')
};
};
response.navigation.lists[0].items.push(album);
}
}
}
}
}
}
// Sort albums by album artist, because the order produced by mpd is dependent on the
// filesystem from which the albums were read, i.e. if audio files are stored in the
// folders 'A' and 'B', then all albums in 'A' come before those in 'B'.
// Within 'A' and 'B' albums are typically sorted by album artist. Its partially
// sorted nature makes the albums array a good candidate for Timsort.
// https://en.wikipedia.org/wiki/Timsort
timSort.sort(response.navigation.lists[0].items, function (a, b) {
return a.artist.localeCompare(b.artist);
});
//Save response in albumList cache for future use
memoryCache.set("cacheAlbumList", response);
if(ui) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
"shelljs": "^0.7.8",
"socket.io": "^1.7.1",
"socket.io-client": "^1.7.4",
"sort-on": "^2.0.0",
"spotify-web-api-node": "^2.4.0",
"string": "^3.3.3",
"tail": "^1.2.2",
"telnet": "0.0.1",
"timsort": "^0.3.0",
"underscore": "^1.8.3",
"unirest": "^0.5.1",
"v-conf": "^1.4.0",
Expand Down