aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-26 17:44:25 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-26 17:44:25 +0100
commit178edb20259f90b1c59f40728aaf8073f097f1f5 (patch)
tree52d5a7f9b5ebce2e4ff11dbeb682c6014320cbcd /server
parent124648d7fcfc3c9a91fe702cbc40c317429c05bd (diff)
downloadPeerTube-178edb20259f90b1c59f40728aaf8073f097f1f5.tar.gz
PeerTube-178edb20259f90b1c59f40728aaf8073f097f1f5.tar.zst
PeerTube-178edb20259f90b1c59f40728aaf8073f097f1f5.zip
Server: correctly sort tags by name asc
Diffstat (limited to 'server')
-rw-r--r--server/models/video.js4
1 files changed, 2 insertions, 2 deletions
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) {
320 offset: start, 320 offset: start,
321 limit: count, 321 limit: count,
322 distinct: true, // For the count, a video can have many tags 322 distinct: true, // For the count, a video can have many tags
323 order: [ modelUtils.getSort(sort) ], 323 order: [ modelUtils.getSort(sort), [ this.sequelize.models.Tag, 'name', 'ASC' ] ],
324 include: [ 324 include: [
325 { 325 {
326 model: this.sequelize.models.Author, 326 model: this.sequelize.models.Author,
@@ -440,7 +440,7 @@ function searchAndPopulateAuthorAndPodAndTags (value, field, start, count, sort,
440 offset: start, 440 offset: start,
441 limit: count, 441 limit: count,
442 distinct: true, // For the count, a video can have many tags 442 distinct: true, // For the count, a video can have many tags
443 order: [ modelUtils.getSort(sort) ] 443 order: [ modelUtils.getSort(sort), [ this.sequelize.models.Tag, 'name', 'ASC' ] ]
444 } 444 }
445 445
446 // Make an exact search with the magnet 446 // Make an exact search with the magnet