mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-24 00:20:57 +01:00
dlna server fixes
This commit is contained in:
@@ -6,13 +6,18 @@ namespace MediaBrowser.Model.Configuration
|
||||
public bool EnablePlayTo { get; set; }
|
||||
public bool EnableServer { get; set; }
|
||||
public bool EnableDebugLogging { get; set; }
|
||||
public bool BlastAliveMessages { get; set; }
|
||||
public int ClientDiscoveryIntervalSeconds { get; set; }
|
||||
public int BlastAliveMessageIntervalSeconds { get; set; }
|
||||
public string DefaultUserId { get; set; }
|
||||
|
||||
public DlnaOptions()
|
||||
{
|
||||
EnablePlayTo = true;
|
||||
EnableServer = true;
|
||||
BlastAliveMessages = true;
|
||||
ClientDiscoveryIntervalSeconds = 60;
|
||||
BlastAliveMessageIntervalSeconds = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public string SupportedMediaTypes { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls the content of the X_DLNADOC element in the urn:schemas-dlna-org:device-1-0 namespace.
|
||||
/// </summary>
|
||||
|
||||
26
MediaBrowser.Model/Dlna/Filter.cs
Normal file
26
MediaBrowser.Model/Dlna/Filter.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class Filter
|
||||
{
|
||||
private readonly List<string> _fields;
|
||||
private readonly bool _all;
|
||||
|
||||
public Filter(string filter)
|
||||
{
|
||||
_all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
_fields = (filter ?? string.Empty)
|
||||
.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public bool Contains(string field)
|
||||
{
|
||||
return _all || _fields.Contains(field, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
MediaBrowser.Model/Dlna/SearchCriteria.cs
Normal file
49
MediaBrowser.Model/Dlna/SearchCriteria.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class SearchCriteria
|
||||
{
|
||||
public SearchType SearchType { get; set; }
|
||||
|
||||
public SearchCriteria(string search)
|
||||
{
|
||||
if (string.IsNullOrEmpty(search))
|
||||
{
|
||||
throw new ArgumentNullException("search");
|
||||
}
|
||||
|
||||
SearchType = SearchType.Unknown;
|
||||
|
||||
if (search.IndexOf("upnp:class", StringComparison.OrdinalIgnoreCase) != -1 &&
|
||||
search.IndexOf("derivedfrom", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
if (search.IndexOf("object.item.audioItem", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
SearchType = SearchType.Audio;
|
||||
}
|
||||
else if (search.IndexOf("object.item.imageItem", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
SearchType = SearchType.Image;
|
||||
}
|
||||
else if (search.IndexOf("object.item.videoItem", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
SearchType = SearchType.Video;
|
||||
}
|
||||
else if (search.IndexOf("object.container.playlistContainer", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
SearchType = SearchType.Playlist;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum SearchType
|
||||
{
|
||||
Unknown = 0,
|
||||
Audio = 1,
|
||||
Image = 2,
|
||||
Video = 3,
|
||||
Playlist = 4
|
||||
}
|
||||
}
|
||||
11
MediaBrowser.Model/Dlna/SortCriteria.cs
Normal file
11
MediaBrowser.Model/Dlna/SortCriteria.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class SortCriteria
|
||||
{
|
||||
public SortCriteria(string value)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,9 +73,12 @@
|
||||
<Compile Include="Dlna\DeviceProfileInfo.cs" />
|
||||
<Compile Include="Dlna\DirectPlayProfile.cs" />
|
||||
<Compile Include="Dlna\DlnaMaps.cs" />
|
||||
<Compile Include="Dlna\Filter.cs" />
|
||||
<Compile Include="Dlna\MediaFormatProfile.cs" />
|
||||
<Compile Include="Dlna\MediaFormatProfileResolver.cs" />
|
||||
<Compile Include="Dlna\ResponseProfile.cs" />
|
||||
<Compile Include="Dlna\SearchCriteria.cs" />
|
||||
<Compile Include="Dlna\SortCriteria.cs" />
|
||||
<Compile Include="Dlna\StreamBuilder.cs" />
|
||||
<Compile Include="Dlna\StreamInfo.cs" />
|
||||
<Compile Include="Dlna\TranscodingProfile.cs" />
|
||||
|
||||
Reference in New Issue
Block a user