mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-07 08:18:54 +01:00
Fix SortCriteria and refactor SetSorting
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using Jellyfin.Data.Enums;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class SortCriteria
|
||||
{
|
||||
public SortCriteria(string value)
|
||||
public SortCriteria(string sortOrder)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sortOrder) && Enum.TryParse<SortOrder>(sortOrder, true, out var sortOrderValue))
|
||||
{
|
||||
SortOrder = sortOrderValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
SortOrder = SortOrder.Ascending;
|
||||
}
|
||||
}
|
||||
|
||||
public SortOrder SortOrder => SortOrder.Ascending;
|
||||
public SortOrder SortOrder { get; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user