mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-15 20:20:25 +01:00
update active recordings
This commit is contained in:
@@ -10,7 +10,6 @@ using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.TV;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
@@ -129,9 +128,20 @@ namespace Emby.Dlna.ContentDirectory
|
||||
}
|
||||
}
|
||||
|
||||
// No configuration so it's going to be pretty arbitrary
|
||||
return _userManager.Users.FirstOrDefault(i => i.Policy.IsAdministrator) ??
|
||||
_userManager.Users.First();
|
||||
foreach (var user in _userManager.Users)
|
||||
{
|
||||
if (user.Policy.IsAdministrator)
|
||||
{
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var user in _userManager.Users)
|
||||
{
|
||||
return user;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Emby.Dlna.Didl
|
||||
{
|
||||
public class Filter
|
||||
{
|
||||
private readonly List<string> _fields;
|
||||
private readonly string[] _fields;
|
||||
private readonly bool _all;
|
||||
|
||||
public Filter()
|
||||
@@ -20,9 +19,7 @@ namespace Emby.Dlna.Didl
|
||||
{
|
||||
_all = StringHelper.EqualsIgnoreCase(filter, "*");
|
||||
|
||||
var list = (filter ?? string.Empty).Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
|
||||
_fields = list;
|
||||
_fields = (filter ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
|
||||
public bool Contains(string field)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ using MediaBrowser.Model.System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
@@ -49,7 +48,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
get
|
||||
{
|
||||
var lastDateKnownActivity = new[] { _creationTime, _device.DateLastActivity }.Max();
|
||||
var lastDateKnownActivity = _creationTime > _device.DateLastActivity ? _creationTime : _device.DateLastActivity;
|
||||
|
||||
if (DateTime.UtcNow >= lastDateKnownActivity.AddSeconds(120))
|
||||
{
|
||||
@@ -565,7 +564,7 @@ namespace Emby.Dlna.PlayTo
|
||||
streamInfo.TargetVideoCodecTag,
|
||||
streamInfo.IsTargetAVC);
|
||||
|
||||
return list.FirstOrDefault();
|
||||
return list.Count == 0 ? null : list[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -30,107 +30,6 @@ namespace Emby.Dlna.Profiles
|
||||
|
||||
TimelineOffsetSeconds = 10;
|
||||
|
||||
TranscodingProfiles = new[]
|
||||
{
|
||||
new TranscodingProfile
|
||||
{
|
||||
Container = "mp3",
|
||||
AudioCodec = "mp3",
|
||||
Type = DlnaProfileType.Audio
|
||||
},
|
||||
new TranscodingProfile
|
||||
{
|
||||
Container = "ts",
|
||||
AudioCodec = "ac3",
|
||||
VideoCodec = "h264",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
new TranscodingProfile
|
||||
{
|
||||
Container = "jpeg",
|
||||
Type = DlnaProfileType.Photo
|
||||
}
|
||||
};
|
||||
|
||||
DirectPlayProfiles = new[]
|
||||
{
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "mpeg,mpg",
|
||||
VideoCodec = "mpeg2video,mpeg4",
|
||||
AudioCodec = "ac3,mp3,pcm_dvd",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "mkv",
|
||||
VideoCodec = "h264,mpeg2video",
|
||||
AudioCodec = "aac,ac3,dca,mp3,mp2,pcm,dts",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "ts",
|
||||
VideoCodec = "h264,mpeg2video",
|
||||
AudioCodec = "aac,mp3,mp2",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "mp4,m4v",
|
||||
VideoCodec = "h264",
|
||||
AudioCodec = "aac,ac3,mp3,pcm",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "mov",
|
||||
VideoCodec = "h264",
|
||||
AudioCodec = "aac,pcm",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "avi",
|
||||
VideoCodec = "mpeg4",
|
||||
AudioCodec = "pcm",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "flv",
|
||||
VideoCodec = "h264",
|
||||
AudioCodec = "aac",
|
||||
Type = DlnaProfileType.Video
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "mp3",
|
||||
AudioCodec = "mp3",
|
||||
Type = DlnaProfileType.Audio
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "mp4",
|
||||
AudioCodec = "aac",
|
||||
Type = DlnaProfileType.Audio
|
||||
},
|
||||
|
||||
new DirectPlayProfile
|
||||
{
|
||||
Container = "jpeg",
|
||||
Type = DlnaProfileType.Photo
|
||||
}
|
||||
};
|
||||
|
||||
ContainerProfiles = new[]
|
||||
{
|
||||
new ContainerProfile
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
@@ -24,10 +23,12 @@ namespace Emby.Dlna.Ssdp
|
||||
|
||||
public static string GetDescendantValue(this XElement container, XName name)
|
||||
{
|
||||
var node = container.Descendants(name)
|
||||
.FirstOrDefault();
|
||||
foreach (var node in container.Descendants(name))
|
||||
{
|
||||
return node.Value;
|
||||
}
|
||||
|
||||
return node == null ? null : node.Value;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user