mirror of
https://github.com/thumbsup/thumbsup
synced 2024-11-05 12:01:04 +00:00
Fix sorting of albums & media
This commit is contained in:
parent
3dd51841ff
commit
6d162bd110
@ -34,8 +34,8 @@ function Album(opts) {
|
||||
|
||||
Album.prototype.finalize = function(options) {
|
||||
options = _.defaults(options, {
|
||||
sortAlbumsBy: 'date',
|
||||
sortMediaBy: 'date'
|
||||
sortAlbums: 'date',
|
||||
sortMedia: 'date'
|
||||
});
|
||||
// is this the top-level album?
|
||||
this.home = this.depth === 0;
|
||||
@ -86,8 +86,8 @@ Album.prototype.calculateSummary = function() {
|
||||
};
|
||||
|
||||
Album.prototype.sort = function(options) {
|
||||
this.files = _.sortBy(this.files, SORT_MEDIA_BY[options.sortMediaBy]);
|
||||
this.albums = _.sortBy(this.albums, SORT_ALBUMS_BY[options.sortAlbumsBy]);
|
||||
this.files = _.sortBy(this.files, SORT_MEDIA_BY[options.sortMedia]);
|
||||
this.albums = _.sortBy(this.albums, SORT_ALBUMS_BY[options.sortAlbums]);
|
||||
this.albums.forEach(function(nested) {
|
||||
nested.sort(options);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user