Adds ability to configure sort order for DLNA videos (#3645)

This commit is contained in:
CJ
2023-05-02 20:33:32 -07:00
committed by GitHub
parent 55e0d5c82f
commit d6b4d16ff4
11 changed files with 83 additions and 5 deletions

View File

@@ -444,10 +444,15 @@ func (me *contentDirectoryService) getVideos(sceneFilter *models.SceneFilterType
var objs []interface{}
if err := txn.WithReadTxn(context.TODO(), me.txnManager, func(ctx context.Context) error {
sort := "title"
sort := me.VideoSortOrder
direction := models.SortDirectionEnumDesc
if sort == "title" {
direction = models.SortDirectionEnumAsc
}
findFilter := &models.FindFilterType{
PerPage: &pageSize,
Sort: &sort,
PerPage: &pageSize,
Sort: &sort,
Direction: &direction,
}
scenes, total, err := scene.QueryWithCount(ctx, me.repository.SceneFinder, sceneFilter, findFilter)