mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-02 14:56:31 +01:00
sync fixes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Session;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -11,17 +10,25 @@ namespace MediaBrowser.Model.Dlna
|
||||
public static List<StreamInfo> SortMediaSources(List<StreamInfo> streams)
|
||||
{
|
||||
return streams.OrderBy(i =>
|
||||
{
|
||||
// Nothing beats direct playing a file
|
||||
if (i.PlayMethod == PlayMethod.DirectPlay && i.MediaSource.Protocol == MediaProtocol.File)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
}).ThenBy(i =>
|
||||
{
|
||||
switch (i.PlayMethod)
|
||||
{
|
||||
// Let's assume direct streaming a file is just as desirable as direct playing a remote url
|
||||
case PlayMethod.DirectStream:
|
||||
case PlayMethod.DirectPlay:
|
||||
return 0;
|
||||
case PlayMethod.DirectStream:
|
||||
return 1;
|
||||
case PlayMethod.Transcode:
|
||||
return 2;
|
||||
default:
|
||||
throw new ArgumentException("Unrecognized PlayMethod");
|
||||
return 2;
|
||||
}
|
||||
|
||||
}).ThenBy(i =>
|
||||
|
||||
Reference in New Issue
Block a user