From: Chocobozzz Date: Mon, 26 Dec 2016 16:44:25 +0000 (+0100) Subject: Server: correctly sort tags by name asc X-Git-Tag: v0.0.1-alpha~574^2~32 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=178edb20259f90b1c59f40728aaf8073f097f1f5;p=oweals%2Fpeertube.git Server: correctly sort tags by name asc --- diff --git a/server/models/video.js b/server/models/video.js index af05a861f..04478c8d7 100644 --- a/server/models/video.js +++ b/server/models/video.js @@ -320,7 +320,7 @@ function listForApi (start, count, sort, callback) { offset: start, limit: count, distinct: true, // For the count, a video can have many tags - order: [ modelUtils.getSort(sort) ], + order: [ modelUtils.getSort(sort), [ this.sequelize.models.Tag, 'name', 'ASC' ] ], include: [ { model: this.sequelize.models.Author, @@ -440,7 +440,7 @@ function searchAndPopulateAuthorAndPodAndTags (value, field, start, count, sort, offset: start, limit: count, distinct: true, // For the count, a video can have many tags - order: [ modelUtils.getSort(sort) ] + order: [ modelUtils.getSort(sort), [ this.sequelize.models.Tag, 'name', 'ASC' ] ] } // Make an exact search with the magnet