From cafeedcadfa93259529a79cc417faccf20154bd1 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Tue, 8 Mar 2022 22:57:47 +0100
Subject: [PATCH 001/262] Rework SsdpHttpClient
---
Emby.Dlna/PlayTo/Device.cs | 33 +++---
Emby.Dlna/PlayTo/DlnaHttpClient.cs | 105 ++++++++++++++++++
Emby.Dlna/PlayTo/SsdpHttpClient.cs | 141 -------------------------
Jellyfin.Server/Startup.cs | 17 +++
MediaBrowser.Common/Net/NamedClient.cs | 5 +
5 files changed, 144 insertions(+), 157 deletions(-)
create mode 100644 Emby.Dlna/PlayTo/DlnaHttpClient.cs
delete mode 100644 Emby.Dlna/PlayTo/SsdpHttpClient.cs
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs
index 8eb90f4455..0b480f5ab0 100644
--- a/Emby.Dlna/PlayTo/Device.cs
+++ b/Emby.Dlna/PlayTo/Device.cs
@@ -235,7 +235,7 @@ namespace Emby.Dlna.PlayTo
_logger.LogDebug("Setting mute");
var value = mute ? 1 : 0;
- await new SsdpHttpClient(_httpClientFactory)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
.SendCommandAsync(
Properties.BaseUrl,
service,
@@ -276,7 +276,7 @@ namespace Emby.Dlna.PlayTo
// Remote control will perform better
Volume = value;
- await new SsdpHttpClient(_httpClientFactory)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
.SendCommandAsync(
Properties.BaseUrl,
service,
@@ -303,7 +303,7 @@ namespace Emby.Dlna.PlayTo
throw new InvalidOperationException("Unable to find service");
}
- await new SsdpHttpClient(_httpClientFactory)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
.SendCommandAsync(
Properties.BaseUrl,
service,
@@ -343,7 +343,7 @@ namespace Emby.Dlna.PlayTo
}
var post = avCommands.BuildPost(command, service.ServiceType, url, dictionary);
- await new SsdpHttpClient(_httpClientFactory)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
.SendCommandAsync(
Properties.BaseUrl,
service,
@@ -400,7 +400,8 @@ namespace Emby.Dlna.PlayTo
}
var post = avCommands.BuildPost(command, service.ServiceType, url, dictionary);
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, post, header: header, cancellationToken)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
+ .SendCommandAsync(Properties.BaseUrl, service, command.Name, post, header, cancellationToken)
.ConfigureAwait(false);
}
@@ -428,7 +429,7 @@ namespace Emby.Dlna.PlayTo
throw new InvalidOperationException("Unable to find service");
}
- return new SsdpHttpClient(_httpClientFactory).SendCommandAsync(
+ return new DlnaHttpClient(_logger, _httpClientFactory).SendCommandAsync(
Properties.BaseUrl,
service,
command.Name,
@@ -461,7 +462,7 @@ namespace Emby.Dlna.PlayTo
var service = GetAvTransportService();
- await new SsdpHttpClient(_httpClientFactory)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
.SendCommandAsync(
Properties.BaseUrl,
service,
@@ -485,7 +486,7 @@ namespace Emby.Dlna.PlayTo
var service = GetAvTransportService();
- await new SsdpHttpClient(_httpClientFactory)
+ await new DlnaHttpClient(_logger, _httpClientFactory)
.SendCommandAsync(
Properties.BaseUrl,
service,
@@ -618,7 +619,7 @@ namespace Emby.Dlna.PlayTo
return;
}
- var result = await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(
+ var result = await new DlnaHttpClient(_logger, _httpClientFactory).SendCommandAsync(
Properties.BaseUrl,
service,
command.Name,
@@ -668,7 +669,7 @@ namespace Emby.Dlna.PlayTo
return;
}
- var result = await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(
+ var result = await new DlnaHttpClient(_logger, _httpClientFactory).SendCommandAsync(
Properties.BaseUrl,
service,
command.Name,
@@ -701,7 +702,7 @@ namespace Emby.Dlna.PlayTo
return null;
}
- var result = await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(
+ var result = await new DlnaHttpClient(_logger, _httpClientFactory).SendCommandAsync(
Properties.BaseUrl,
service,
command.Name,
@@ -747,7 +748,7 @@ namespace Emby.Dlna.PlayTo
return null;
}
- var result = await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(
+ var result = await new DlnaHttpClient(_logger, _httpClientFactory).SendCommandAsync(
Properties.BaseUrl,
service,
command.Name,
@@ -819,7 +820,7 @@ namespace Emby.Dlna.PlayTo
return (false, null);
}
- var result = await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(
+ var result = await new DlnaHttpClient(_logger, _httpClientFactory).SendCommandAsync(
Properties.BaseUrl,
service,
command.Name,
@@ -997,7 +998,7 @@ namespace Emby.Dlna.PlayTo
string url = NormalizeUrl(Properties.BaseUrl, avService.ScpdUrl);
- var httpClient = new SsdpHttpClient(_httpClientFactory);
+ var httpClient = new DlnaHttpClient(_logger, _httpClientFactory);
var document = await httpClient.GetDataAsync(url, cancellationToken).ConfigureAwait(false);
if (document == null)
@@ -1029,7 +1030,7 @@ namespace Emby.Dlna.PlayTo
string url = NormalizeUrl(Properties.BaseUrl, avService.ScpdUrl);
- var httpClient = new SsdpHttpClient(_httpClientFactory);
+ var httpClient = new DlnaHttpClient(_logger, _httpClientFactory);
_logger.LogDebug("Dlna Device.GetRenderingProtocolAsync");
var document = await httpClient.GetDataAsync(url, cancellationToken).ConfigureAwait(false);
if (document == null)
@@ -1064,7 +1065,7 @@ namespace Emby.Dlna.PlayTo
public static async Task CreateuPnpDeviceAsync(Uri url, IHttpClientFactory httpClientFactory, ILogger logger, CancellationToken cancellationToken)
{
- var ssdpHttpClient = new SsdpHttpClient(httpClientFactory);
+ var ssdpHttpClient = new DlnaHttpClient(logger, httpClientFactory);
var document = await ssdpHttpClient.GetDataAsync(url.ToString(), cancellationToken).ConfigureAwait(false);
if (document == null)
diff --git a/Emby.Dlna/PlayTo/DlnaHttpClient.cs b/Emby.Dlna/PlayTo/DlnaHttpClient.cs
new file mode 100644
index 0000000000..623f4526c8
--- /dev/null
+++ b/Emby.Dlna/PlayTo/DlnaHttpClient.cs
@@ -0,0 +1,105 @@
+#pragma warning disable CS1591
+
+using System;
+using System.Globalization;
+using System.Net.Http;
+using System.Net.Mime;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Xml;
+using System.Xml.Linq;
+using Emby.Dlna.Common;
+using MediaBrowser.Common.Net;
+using Microsoft.Extensions.Logging;
+
+namespace Emby.Dlna.PlayTo
+{
+ public class DlnaHttpClient
+ {
+ private readonly ILogger _logger;
+ private readonly IHttpClientFactory _httpClientFactory;
+
+ public DlnaHttpClient(ILogger logger, IHttpClientFactory httpClientFactory)
+ {
+ _logger = logger;
+ _httpClientFactory = httpClientFactory;
+ }
+
+ private static string NormalizeServiceUrl(string baseUrl, string serviceUrl)
+ {
+ // If it's already a complete url, don't stick anything onto the front of it
+ if (serviceUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
+ {
+ return serviceUrl;
+ }
+
+ if (!serviceUrl.StartsWith('/'))
+ {
+ serviceUrl = "/" + serviceUrl;
+ }
+
+ return baseUrl + serviceUrl;
+ }
+
+ private async Task SendRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ using var response = await _httpClientFactory.CreateClient(NamedClient.Dlna).SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
+ response.EnsureSuccessStatusCode();
+ await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
+ try
+ {
+ return await XDocument.LoadAsync(
+ stream,
+ LoadOptions.None,
+ cancellationToken).ConfigureAwait(false);
+ }
+ catch (XmlException ex)
+ {
+ _logger.LogError(ex, "Failed to parse response");
+ if (_logger.IsEnabled(LogLevel.Debug))
+ {
+ _logger.LogDebug("Malformed response:\n", await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false));
+ }
+
+ return null;
+ }
+ }
+
+ public Task GetDataAsync(string url, CancellationToken cancellationToken)
+ {
+ using var request = new HttpRequestMessage(HttpMethod.Get, url);
+ return SendRequestAsync(request, cancellationToken);
+ }
+
+ public Task SendCommandAsync(
+ string baseUrl,
+ DeviceService service,
+ string command,
+ string postData,
+ string? header = null,
+ CancellationToken cancellationToken = default)
+ {
+ using var request = new HttpRequestMessage(HttpMethod.Post, NormalizeServiceUrl(baseUrl, service.ControlUrl))
+ {
+ Content = new StringContent(postData, Encoding.UTF8, MediaTypeNames.Text.Xml)
+ };
+
+ request.Headers.TryAddWithoutValidation(
+ "SOAPACTION",
+ string.Format(
+ CultureInfo.InvariantCulture,
+ "\"{0}#{1}\"",
+ service.ServiceType,
+ command));
+ request.Headers.Pragma.ParseAdd("no-cache");
+
+ if (!string.IsNullOrEmpty(header))
+ {
+ request.Headers.TryAddWithoutValidation("contentFeatures.dlna.org", header);
+ }
+
+ return SendRequestAsync(request, cancellationToken);
+ }
+ }
+}
diff --git a/Emby.Dlna/PlayTo/SsdpHttpClient.cs b/Emby.Dlna/PlayTo/SsdpHttpClient.cs
deleted file mode 100644
index cade7b4c2c..0000000000
--- a/Emby.Dlna/PlayTo/SsdpHttpClient.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-#nullable disable
-
-#pragma warning disable CS1591
-
-using System;
-using System.Globalization;
-using System.Net.Http;
-using System.Net.Mime;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Emby.Dlna.Common;
-using MediaBrowser.Common.Net;
-
-namespace Emby.Dlna.PlayTo
-{
- public class SsdpHttpClient
- {
- private const string USERAGENT = "Microsoft-Windows/6.2 UPnP/1.0 Microsoft-DLNA DLNADOC/1.50";
- private const string FriendlyName = "Jellyfin";
-
- private readonly IHttpClientFactory _httpClientFactory;
-
- public SsdpHttpClient(IHttpClientFactory httpClientFactory)
- {
- _httpClientFactory = httpClientFactory;
- }
-
- public async Task SendCommandAsync(
- string baseUrl,
- DeviceService service,
- string command,
- string postData,
- string header = null,
- CancellationToken cancellationToken = default)
- {
- var url = NormalizeServiceUrl(baseUrl, service.ControlUrl);
- using var response = await PostSoapDataAsync(
- url,
- $"\"{service.ServiceType}#{command}\"",
- postData,
- header,
- cancellationToken)
- .ConfigureAwait(false);
- response.EnsureSuccessStatusCode();
-
- await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
- return await XDocument.LoadAsync(
- stream,
- LoadOptions.None,
- cancellationToken).ConfigureAwait(false);
- }
-
- private static string NormalizeServiceUrl(string baseUrl, string serviceUrl)
- {
- // If it's already a complete url, don't stick anything onto the front of it
- if (serviceUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
- {
- return serviceUrl;
- }
-
- if (!serviceUrl.StartsWith('/'))
- {
- serviceUrl = "/" + serviceUrl;
- }
-
- return baseUrl + serviceUrl;
- }
-
- public async Task SubscribeAsync(
- string url,
- string ip,
- int port,
- string localIp,
- int eventport,
- int timeOut = 3600)
- {
- using var options = new HttpRequestMessage(new HttpMethod("SUBSCRIBE"), url);
- options.Headers.UserAgent.ParseAdd(USERAGENT);
- options.Headers.TryAddWithoutValidation("HOST", ip + ":" + port.ToString(CultureInfo.InvariantCulture));
- options.Headers.TryAddWithoutValidation("CALLBACK", "<" + localIp + ":" + eventport.ToString(CultureInfo.InvariantCulture) + ">");
- options.Headers.TryAddWithoutValidation("NT", "upnp:event");
- options.Headers.TryAddWithoutValidation("TIMEOUT", "Second-" + timeOut.ToString(CultureInfo.InvariantCulture));
-
- using var response = await _httpClientFactory.CreateClient(NamedClient.Default)
- .SendAsync(options, HttpCompletionOption.ResponseHeadersRead)
- .ConfigureAwait(false);
- response.EnsureSuccessStatusCode();
- }
-
- public async Task GetDataAsync(string url, CancellationToken cancellationToken)
- {
- using var options = new HttpRequestMessage(HttpMethod.Get, url);
- options.Headers.UserAgent.ParseAdd(USERAGENT);
- options.Headers.TryAddWithoutValidation("FriendlyName.DLNA.ORG", FriendlyName);
- using var response = await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
- response.EnsureSuccessStatusCode();
- await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
- try
- {
- return await XDocument.LoadAsync(
- stream,
- LoadOptions.None,
- cancellationToken).ConfigureAwait(false);
- }
- catch
- {
- return null;
- }
- }
-
- private async Task PostSoapDataAsync(
- string url,
- string soapAction,
- string postData,
- string header,
- CancellationToken cancellationToken)
- {
- if (soapAction[0] != '\"')
- {
- soapAction = $"\"{soapAction}\"";
- }
-
- using var options = new HttpRequestMessage(HttpMethod.Post, url);
- options.Headers.UserAgent.ParseAdd(USERAGENT);
- options.Headers.TryAddWithoutValidation("SOAPACTION", soapAction);
- options.Headers.TryAddWithoutValidation("Pragma", "no-cache");
- options.Headers.TryAddWithoutValidation("FriendlyName.DLNA.ORG", FriendlyName);
-
- if (!string.IsNullOrEmpty(header))
- {
- options.Headers.TryAddWithoutValidation("contentFeatures.dlna.org", header);
- }
-
- options.Content = new StringContent(postData, Encoding.UTF8, MediaTypeNames.Text.Xml);
-
- return await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
- }
- }
-}
diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs
index 8eb5f21960..2cb6d937a8 100644
--- a/Jellyfin.Server/Startup.cs
+++ b/Jellyfin.Server/Startup.cs
@@ -1,4 +1,5 @@
using System;
+using System.Globalization;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
@@ -103,6 +104,22 @@ namespace Jellyfin.Server
})
.ConfigurePrimaryHttpMessageHandler(defaultHttpClientHandlerDelegate);
+ services.AddHttpClient(NamedClient.Dlna, c =>
+ {
+ c.DefaultRequestHeaders.UserAgent.ParseAdd(
+ string.Format(
+ CultureInfo.InvariantCulture,
+ "{0}/{1} UPnP/1.1 {2}/{3}",
+ MediaBrowser.Common.System.OperatingSystem.Name,
+ Environment.OSVersion,
+ _serverApplicationHost.Name,
+ _serverApplicationHost.ApplicationVersionString));
+
+ c.DefaultRequestHeaders.Add("CPFN.UPNP.ORG", _serverApplicationHost.FriendlyName); // Required for UPnP DeviceArchitecture v2.0
+ c.DefaultRequestHeaders.Add("FriendlyName.DLNA.ORG", _serverApplicationHost.FriendlyName); // REVIEW: where does this come from?
+ })
+ .ConfigurePrimaryHttpMessageHandler(defaultHttpClientHandlerDelegate);
+
services.AddHealthChecks()
.AddDbContextCheck();
diff --git a/MediaBrowser.Common/Net/NamedClient.cs b/MediaBrowser.Common/Net/NamedClient.cs
index 0f6161c328..a6cacd4f17 100644
--- a/MediaBrowser.Common/Net/NamedClient.cs
+++ b/MediaBrowser.Common/Net/NamedClient.cs
@@ -14,5 +14,10 @@
/// Gets the value for the MusicBrainz named http client.
///
public const string MusicBrainz = nameof(MusicBrainz);
+
+ ///
+ /// Gets the value for the DLNA named http client.
+ ///
+ public const string Dlna = nameof(Dlna);
}
}
From 09e897d372e0b8327deb4427b80d92e0de91218a Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Sat, 19 Mar 2022 00:33:32 +0100
Subject: [PATCH 002/262] Clean up DLNA profile code
---
Emby.Dlna/DlnaManager.cs | 114 ++---
Emby.Dlna/Profiles/DefaultProfile.cs | 14 -
Emby.Dlna/Profiles/DenonAvrProfile.cs | 34 --
Emby.Dlna/Profiles/DirectTvProfile.cs | 129 ------
Emby.Dlna/Profiles/DishHopperJoeyProfile.cs | 228 ----------
Emby.Dlna/Profiles/Foobar2000Profile.cs | 78 ----
Emby.Dlna/Profiles/LgTvProfile.cs | 211 ----------
Emby.Dlna/Profiles/LinksysDMA2100Profile.cs | 55 ---
Emby.Dlna/Profiles/MarantzProfile.cs | 43 --
Emby.Dlna/Profiles/MediaMonkeyProfile.cs | 44 --
Emby.Dlna/Profiles/PanasonicVieraProfile.cs | 222 ----------
Emby.Dlna/Profiles/PopcornHourProfile.cs | 225 ----------
Emby.Dlna/Profiles/SamsungSmartTvProfile.cs | 367 -----------------
Emby.Dlna/Profiles/SharpSmartTvProfile.cs | 121 ------
Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs | 230 -----------
Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs | 230 -----------
Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs | 218 ----------
Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs | 218 ----------
Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs | 284 -------------
Emby.Dlna/Profiles/SonyBravia2010Profile.cs | 366 ----------------
Emby.Dlna/Profiles/SonyBravia2011Profile.cs | 389 ------------------
Emby.Dlna/Profiles/SonyBravia2012Profile.cs | 307 --------------
Emby.Dlna/Profiles/SonyBravia2013Profile.cs | 324 ---------------
Emby.Dlna/Profiles/SonyBravia2014Profile.cs | 324 ---------------
Emby.Dlna/Profiles/SonyPs3Profile.cs | 269 ------------
Emby.Dlna/Profiles/SonyPs4Profile.cs | 278 -------------
Emby.Dlna/Profiles/WdtvLiveProfile.cs | 266 ------------
Emby.Dlna/Profiles/XboxOneProfile.cs | 372 -----------------
.../Controllers/DlnaControllerTests.cs | 54 ++-
29 files changed, 65 insertions(+), 5949 deletions(-)
delete mode 100644 Emby.Dlna/Profiles/DenonAvrProfile.cs
delete mode 100644 Emby.Dlna/Profiles/DirectTvProfile.cs
delete mode 100644 Emby.Dlna/Profiles/DishHopperJoeyProfile.cs
delete mode 100644 Emby.Dlna/Profiles/Foobar2000Profile.cs
delete mode 100644 Emby.Dlna/Profiles/LgTvProfile.cs
delete mode 100644 Emby.Dlna/Profiles/LinksysDMA2100Profile.cs
delete mode 100644 Emby.Dlna/Profiles/MarantzProfile.cs
delete mode 100644 Emby.Dlna/Profiles/MediaMonkeyProfile.cs
delete mode 100644 Emby.Dlna/Profiles/PanasonicVieraProfile.cs
delete mode 100644 Emby.Dlna/Profiles/PopcornHourProfile.cs
delete mode 100644 Emby.Dlna/Profiles/SamsungSmartTvProfile.cs
delete mode 100644 Emby.Dlna/Profiles/SharpSmartTvProfile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBravia2010Profile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBravia2011Profile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBravia2012Profile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBravia2013Profile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyBravia2014Profile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyPs3Profile.cs
delete mode 100644 Emby.Dlna/Profiles/SonyPs4Profile.cs
delete mode 100644 Emby.Dlna/Profiles/WdtvLiveProfile.cs
delete mode 100644 Emby.Dlna/Profiles/XboxOneProfile.cs
diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs
index 192128c7ec..60374e795d 100644
--- a/Emby.Dlna/DlnaManager.cs
+++ b/Emby.Dlna/DlnaManager.cs
@@ -1,4 +1,5 @@
#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -61,6 +62,7 @@ namespace Emby.Dlna
try
{
await ExtractSystemProfilesAsync().ConfigureAwait(false);
+ Directory.CreateDirectory(UserProfilesPath);
LoadProfiles();
}
catch (Exception ex)
@@ -328,32 +330,28 @@ namespace Emby.Dlna
var path = Path.Join(
systemProfilesPath,
- Path.GetFileName(name.AsSpan()).Slice(namespaceName.Length));
+ Path.GetFileName(name.AsSpan())[namespaceName.Length..]);
+
+ if (File.Exists(path))
+ {
+ continue;
+ }
// The stream should exist as we just got its name from GetManifestResourceNames
using (var stream = _assembly.GetManifestResourceStream(name)!)
{
- var length = stream.Length;
- var fileInfo = _fileSystem.GetFileInfo(path);
+ Directory.CreateDirectory(systemProfilesPath);
- if (!fileInfo.Exists || fileInfo.Length != length)
+ var fileOptions = AsyncFile.WriteOptions;
+ fileOptions.Mode = FileMode.CreateNew;
+ fileOptions.PreallocationSize = stream.Length;
+ var fileStream = new FileStream(path, fileOptions);
+ await using (fileStream.ConfigureAwait(false))
{
- Directory.CreateDirectory(systemProfilesPath);
-
- var fileOptions = AsyncFile.WriteOptions;
- fileOptions.Mode = FileMode.Create;
- fileOptions.PreallocationSize = length;
- var fileStream = new FileStream(path, fileOptions);
- await using (fileStream.ConfigureAwait(false))
- {
- await stream.CopyToAsync(fileStream).ConfigureAwait(false);
- }
+ await stream.CopyToAsync(fileStream).ConfigureAwait(false);
}
}
}
-
- // Not necessary, but just to make it easy to find
- Directory.CreateDirectory(UserProfilesPath);
}
///
@@ -406,14 +404,20 @@ namespace Emby.Dlna
}
var current = GetProfileInfosInternal().First(i => string.Equals(i.Info.Id, profileId, StringComparison.OrdinalIgnoreCase));
+ if (current.Info.Type == DeviceProfileType.System)
+ {
+ throw new ArgumentException("System profiles can't be edited");
+ }
var newFilename = _fileSystem.GetValidFilename(profile.Name) + ".xml";
- var path = Path.Combine(UserProfilesPath, newFilename);
+ var path = Path.Join(UserProfilesPath, newFilename);
- if (!string.Equals(path, current.Path, StringComparison.Ordinal) &&
- current.Info.Type != DeviceProfileType.System)
+ if (!string.Equals(path, current.Path, StringComparison.Ordinal))
{
- _fileSystem.DeleteFile(current.Path);
+ lock (_profiles)
+ {
+ _profiles.Remove(current.Path);
+ }
}
SaveProfile(profile, path, DeviceProfileType.User);
@@ -496,72 +500,4 @@ namespace Emby.Dlna
internal string Path { get; }
}
}
-
- /*
- class DlnaProfileEntryPoint : IServerEntryPoint
- {
- private readonly IApplicationPaths _appPaths;
- private readonly IFileSystem _fileSystem;
- private readonly IXmlSerializer _xmlSerializer;
-
- public DlnaProfileEntryPoint(IApplicationPaths appPaths, IFileSystem fileSystem, IXmlSerializer xmlSerializer)
- {
- _appPaths = appPaths;
- _fileSystem = fileSystem;
- _xmlSerializer = xmlSerializer;
- }
-
- public void Run()
- {
- DumpProfiles();
- }
-
- private void DumpProfiles()
- {
- DeviceProfile[] list = new[]
- {
- new SamsungSmartTvProfile(),
- new XboxOneProfile(),
- new SonyPs3Profile(),
- new SonyPs4Profile(),
- new SonyBravia2010Profile(),
- new SonyBravia2011Profile(),
- new SonyBravia2012Profile(),
- new SonyBravia2013Profile(),
- new SonyBravia2014Profile(),
- new SonyBlurayPlayer2013(),
- new SonyBlurayPlayer2014(),
- new SonyBlurayPlayer2015(),
- new SonyBlurayPlayer2016(),
- new SonyBlurayPlayerProfile(),
- new PanasonicVieraProfile(),
- new WdtvLiveProfile(),
- new DenonAvrProfile(),
- new LinksysDMA2100Profile(),
- new LgTvProfile(),
- new Foobar2000Profile(),
- new SharpSmartTvProfile(),
- new MediaMonkeyProfile(),
- // new Windows81Profile(),
- // new WindowsMediaCenterProfile(),
- // new WindowsPhoneProfile(),
- new DirectTvProfile(),
- new DishHopperJoeyProfile(),
- new DefaultProfile(),
- new PopcornHourProfile(),
- new MarantzProfile()
- };
-
- foreach (var item in list)
- {
- var path = Path.Combine(_appPaths.ProgramDataPath, _fileSystem.GetValidFilename(item.Name) + ".xml");
-
- _xmlSerializer.SerializeToFile(item, path);
- }
- }
-
- public void Dispose()
- {
- }
- }*/
}
diff --git a/Emby.Dlna/Profiles/DefaultProfile.cs b/Emby.Dlna/Profiles/DefaultProfile.cs
index 8f4f2bd384..23437f1bdf 100644
--- a/Emby.Dlna/Profiles/DefaultProfile.cs
+++ b/Emby.Dlna/Profiles/DefaultProfile.cs
@@ -2,7 +2,6 @@
using System;
using System.Globalization;
-using System.Linq;
using MediaBrowser.Model.Dlna;
namespace Emby.Dlna.Profiles
@@ -164,18 +163,5 @@ namespace Emby.Dlna.Profiles
}
};
}
-
- public void AddXmlRootAttribute(string name, string value)
- {
- var list = XmlRootAttributes.ToList();
-
- list.Add(new XmlAttribute
- {
- Name = name,
- Value = value
- });
-
- XmlRootAttributes = list.ToArray();
- }
}
}
diff --git a/Emby.Dlna/Profiles/DenonAvrProfile.cs b/Emby.Dlna/Profiles/DenonAvrProfile.cs
deleted file mode 100644
index a5ba0f36cc..0000000000
--- a/Emby.Dlna/Profiles/DenonAvrProfile.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class DenonAvrProfile : DefaultProfile
- {
- public DenonAvrProfile()
- {
- Name = "Denon AVR";
-
- SupportedMediaTypes = "Audio";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"Denon:\[AVR:.*",
- Manufacturer = "Denon"
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "mp3,flac,m4a,wma",
- Type = DlnaProfileType.Audio
- },
- };
-
- ResponseProfiles = System.Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/DirectTvProfile.cs b/Emby.Dlna/Profiles/DirectTvProfile.cs
deleted file mode 100644
index f6f98b07d8..0000000000
--- a/Emby.Dlna/Profiles/DirectTvProfile.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class DirectTvProfile : DefaultProfile
- {
- public DirectTvProfile()
- {
- Name = "DirecTV HD-DVR";
-
- TimelineOffsetSeconds = 10;
- RequiresPlainFolders = true;
- RequiresPlainVideoItems = true;
-
- Identification = new DeviceIdentification
- {
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Match = HeaderMatchType.Substring,
- Name = "User-Agent",
- Value = "DIRECTV"
- }
- },
-
- FriendlyName = "^DIRECTV.*$"
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "jpeg,jpg",
- Type = DlnaProfileType.Photo
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp2",
- Type = DlnaProfileType.Video
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Codec = "mpeg2video",
- Type = CodecType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "8192000"
- }
- }
- },
- new CodecProfile
- {
- Codec = "mp2",
- Type = CodecType.Audio,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
-
- ResponseProfiles = System.Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs b/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs
deleted file mode 100644
index 2a7524a6a2..0000000000
--- a/Emby.Dlna/Profiles/DishHopperJoeyProfile.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class DishHopperJoeyProfile : DefaultProfile
- {
- public DishHopperJoeyProfile()
- {
- Name = "Dish Hopper-Joey";
-
- ProtocolInfo = "http-get:*:video/mp2t:*,http-get:*:video/mpeg:*,http-get:*:video/MP1S:*,http-get:*:video/mpeg2:*,http-get:*:video/mp4:*,http-get:*:video/x-matroska:*,http-get:*:audio/mpeg:*,http-get:*:audio/mpeg3:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/mp4a-latm:*,http-get:*:image/jpeg:*";
-
- Identification = new DeviceIdentification
- {
- Manufacturer = "Echostar Technologies LLC",
- ManufacturerUrl = "http://www.echostar.com",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Match = HeaderMatchType.Substring,
- Name = "User-Agent",
- Value = "Zip_"
- }
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "mp4",
- Type = DlnaProfileType.Video,
- AudioCodec = "aac",
- VideoCodec = "h264"
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "mp4,mkv,mpeg,ts",
- VideoCodec = "h264,mpeg2video",
- AudioCodec = "mp3,ac3,aac,he-aac,pcm",
- Type = DlnaProfileType.Video
- },
-
- new DirectPlayProfile
- {
- Container = "mp3,alac,flac",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "20000000",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41",
- IsRequired = true
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = true
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "20000000",
- IsRequired = true
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3,he-aac",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = true
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = true
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Conditions = new[]
- {
- // The device does not have any audio switching capabilities
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.IsSecondaryAudio,
- Value = "false"
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "mkv,ts,mpegts",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/Foobar2000Profile.cs b/Emby.Dlna/Profiles/Foobar2000Profile.cs
deleted file mode 100644
index 68e959770a..0000000000
--- a/Emby.Dlna/Profiles/Foobar2000Profile.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class Foobar2000Profile : DefaultProfile
- {
- public Foobar2000Profile()
- {
- Name = "foobar2000";
-
- SupportedMediaTypes = "Audio";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"foobar",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "foobar",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp2,mp3",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "mp4",
- AudioCodec = "mp4",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "aac,wav",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "flac",
- AudioCodec = "flac",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "ogg",
- AudioCodec = "vorbis",
- Type = DlnaProfileType.Audio
- }
- };
-
- ResponseProfiles = System.Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/LgTvProfile.cs b/Emby.Dlna/Profiles/LgTvProfile.cs
deleted file mode 100644
index fbb368d3e3..0000000000
--- a/Emby.Dlna/Profiles/LgTvProfile.cs
+++ /dev/null
@@ -1,211 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class LgTvProfile : DefaultProfile
- {
- public LgTvProfile()
- {
- Name = "LG Smart TV";
-
- TimelineOffsetSeconds = 10;
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"LG.*",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "LG",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- AudioCodec = "ac3,aac,mp3",
- VideoCodec = "h264",
- Type = DlnaProfileType.Video
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts,avi,mkv,m2ts",
- VideoCodec = "h264",
- AudioCodec = "aac,ac3,eac3,mp3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac,ac3,eac3,mp3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg4",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3,eac3,aac,mp3",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.External
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- },
- new ResponseProfile
- {
- Container = "ts,mpegts",
- Type = DlnaProfileType.Video,
- MimeType = "video/mpeg"
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs b/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs
deleted file mode 100644
index 1a510dfecf..0000000000
--- a/Emby.Dlna/Profiles/LinksysDMA2100Profile.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class LinksysDMA2100Profile : DefaultProfile
- {
- public LinksysDMA2100Profile()
- {
- // Linksys DMA2100us does not need any transcoding of the formats we support statically
- Name = "Linksys DMA2100";
-
- Identification = new DeviceIdentification
- {
- ModelName = "DMA2100us"
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "mp3,flac,m4a,wma",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "avi,mp4,mkv,ts,mpegts,m4v",
- Type = DlnaProfileType.Video
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/MarantzProfile.cs b/Emby.Dlna/Profiles/MarantzProfile.cs
deleted file mode 100644
index 24078ab29c..0000000000
--- a/Emby.Dlna/Profiles/MarantzProfile.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class MarantzProfile : DefaultProfile
- {
- public MarantzProfile()
- {
- Name = "Marantz";
-
- SupportedMediaTypes = "Audio";
-
- Identification = new DeviceIdentification
- {
- Manufacturer = @"Marantz",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "Marantz",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "aac,mp3,wav,wma,flac",
- Type = DlnaProfileType.Audio
- },
- };
-
- ResponseProfiles = System.Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/MediaMonkeyProfile.cs b/Emby.Dlna/Profiles/MediaMonkeyProfile.cs
deleted file mode 100644
index 28d639b6db..0000000000
--- a/Emby.Dlna/Profiles/MediaMonkeyProfile.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class MediaMonkeyProfile : DefaultProfile
- {
- public MediaMonkeyProfile()
- {
- Name = "MediaMonkey";
-
- SupportedMediaTypes = "Audio";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"MediaMonkey",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "MediaMonkey",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac,m4a",
- Type = DlnaProfileType.Audio
- }
- };
-
- ResponseProfiles = Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs
deleted file mode 100644
index 0d536acf39..0000000000
--- a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class PanasonicVieraProfile : DefaultProfile
- {
- public PanasonicVieraProfile()
- {
- Name = "Panasonic Viera";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"VIERA",
- Manufacturer = "Panasonic",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "Panasonic MIL DLNA",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:pv", "http://www.pv.com/pvns/");
-
- 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,mpegts",
- 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
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitDepth,
- Value = "8",
- IsRequired = false
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.External
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Type = DlnaProfileType.Video,
- Container = "ts,mpegts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- MimeType = "video/vnd.dlna.mpeg-tts"
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/PopcornHourProfile.cs b/Emby.Dlna/Profiles/PopcornHourProfile.cs
deleted file mode 100644
index 7fbf8c1649..0000000000
--- a/Emby.Dlna/Profiles/PopcornHourProfile.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class PopcornHourProfile : DefaultProfile
- {
- public PopcornHourProfile()
- {
- Name = "Popcorn Hour";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "mp4",
- Type = DlnaProfileType.Video,
- AudioCodec = "aac",
- VideoCodec = "h264"
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "mp4,mov,m4v",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac"
- },
-
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264",
- AudioCodec = "aac,ac3,eac3,mp3,mp2,pcm"
- },
-
- new DirectPlayProfile
- {
- Container = "asf,wmv",
- Type = DlnaProfileType.Video,
- VideoCodec = "wmv3,vc1",
- AudioCodec = "wmav2,wmapro"
- },
-
- new DirectPlayProfile
- {
- Container = "avi",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg4,msmpeg4",
- AudioCodec = "mp3,ac3,eac3,mp2,pcm"
- },
-
- new DirectPlayProfile
- {
- Container = "mkv",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264",
- AudioCodec = "aac,mp3,ac3,eac3,mp2,pcm"
- },
- new DirectPlayProfile
- {
- Container = "aac,mp3,flac,ogg,wma,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,gif,bmp,png",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline"),
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.IsAnamorphic,
- Value = "true",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.IsAnamorphic,
- Value = "true",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Audio,
- Codec = "aac",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Audio,
- Codec = "mp3",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioBitrate,
- Value = "320000",
- IsRequired = false
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs b/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs
deleted file mode 100644
index ddbebba2a4..0000000000
--- a/Emby.Dlna/Profiles/SamsungSmartTvProfile.cs
+++ /dev/null
@@ -1,367 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SamsungSmartTvProfile : DefaultProfile
- {
- public SamsungSmartTvProfile()
- {
- Name = "Samsung Smart TV";
-
- EnableAlbumArtInDidl = true;
-
- // Without this, older samsungs fail to browse
- EnableSingleAlbumArtLimit = true;
-
- Identification = new DeviceIdentification
- {
- ModelUrl = "samsung.com",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = @"SEC_",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:sec", "http://www.sec.co.kr/");
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- AudioCodec = "ac3",
- VideoCodec = "h264",
- Type = DlnaProfileType.Video,
- EstimateContentLength = false
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "h264,mpeg4,mjpeg",
- AudioCodec = "mp3,ac3,wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "h264,mpeg4,mjpeg",
- AudioCodec = "mp3,ac3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "h264,mpeg4,mjpeg4",
- AudioCodec = "mp3,ac3,dca,aac,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "mp3,aac",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "3gp",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac,he-aac",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpg,mpeg",
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "ac3,mp2,mp3,aac",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "vro,vob",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,mp2,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "ts",
- VideoCodec = "mpeg2video,h264,vc1",
- AudioCodec = "ac3,aac,mp3,eac3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3",
- AudioCodec = "wmav2,wmavoice",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3,flac",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg2video",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "30720000"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg4",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "8192000"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "37500000"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "wmv2,wmv3,vc1",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "25600000"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "wmav2,dca,aac,mp3,dts",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6"
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "avi",
- MimeType = "video/x-msvideo",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mkv",
- MimeType = "video/x-mkv",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "flac",
- MimeType = "audio/x-flac",
- Type = DlnaProfileType.Audio
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.External,
- DidlMode = "CaptionInfoEx"
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SharpSmartTvProfile.cs b/Emby.Dlna/Profiles/SharpSmartTvProfile.cs
deleted file mode 100644
index aa8d434e3f..0000000000
--- a/Emby.Dlna/Profiles/SharpSmartTvProfile.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SharpSmartTvProfile : DefaultProfile
- {
- public SharpSmartTvProfile()
- {
- Name = "Sharp Smart TV";
-
- RequiresPlainFolders = true;
- RequiresPlainVideoItems = true;
-
- Identification = new DeviceIdentification
- {
- Manufacturer = "Sharp",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "Sharp",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "ts",
- Type = DlnaProfileType.Video,
- AudioCodec = "ac3,aac,mp3,dts,dca",
- VideoCodec = "h264",
- EnableMpegtsM2TsMode = true
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "m4v,mkv,avi,mov,mp4",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac,mp3,ac3,dts,dca",
- Type = DlnaProfileType.Video
- },
-
- new DirectPlayProfile
- {
- Container = "asf,wmv",
- Type = DlnaProfileType.Video
- },
-
- new DirectPlayProfile
- {
- Container = "mpg,mpeg",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp3,aac",
- Type = DlnaProfileType.Video
- },
-
- new DirectPlayProfile
- {
- Container = "flv",
- VideoCodec = "h264",
- AudioCodec = "mp3,aac",
- Type = DlnaProfileType.Video
- },
-
- new DirectPlayProfile
- {
- Container = "mp3,wav",
- Type = DlnaProfileType.Audio
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.External
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs
deleted file mode 100644
index 765c125045..0000000000
--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBlurayPlayer2013 : DefaultProfile
- {
- public SonyBlurayPlayer2013()
- {
- Name = "Sony Blu-ray Player 2013";
-
- Identification = new DeviceIdentification
- {
- ModelNumber = "BDP-2013",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S1100",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S3100",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S5100",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S6100",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S7100",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- Manufacturer = "Microsoft Corporation";
-
- ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "mkv",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg,mpg",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,mp3,mp2,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,pcm,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,dca,aac,mp3,pcm,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "m2ts,mts",
- VideoCodec = "h264,mpeg4,vc1",
- AudioCodec = "aac,mp3,ac3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "wmv,asf",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3,m4a,wma,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,png,gif",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
-
- ResponseProfiles = Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs
deleted file mode 100644
index 390c8a3e43..0000000000
--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBlurayPlayer2014 : DefaultProfile
- {
- public SonyBlurayPlayer2014()
- {
- Name = "Sony Blu-ray Player 2014";
-
- Identification = new DeviceIdentification
- {
- ModelNumber = "BDP-2014",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S1200",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S3200",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S5200",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S6200",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S7200",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- Manufacturer = "Microsoft Corporation";
-
- ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "mkv",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg,mpg",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,mp3,mp2,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,pcm,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,dca,aac,mp3,pcm,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "m2ts,mts",
- VideoCodec = "h264,mpeg4,vc1",
- AudioCodec = "aac,mp3,ac3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "wmv,asf",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3,m4a,wma,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,png,gif",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
-
- ResponseProfiles = Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs
deleted file mode 100644
index 25adc4d022..0000000000
--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs
+++ /dev/null
@@ -1,218 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBlurayPlayer2015 : DefaultProfile
- {
- public SonyBlurayPlayer2015()
- {
- Name = "Sony Blu-ray Player 2015";
-
- Identification = new DeviceIdentification
- {
- ModelNumber = "BDP-2015",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S1500",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S3500",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S6500",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- Manufacturer = "Microsoft Corporation";
-
- ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "mkv",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg,mpg",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,mp3,mp2,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,pcm,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,dca,aac,mp3,pcm,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "m2ts,mts",
- VideoCodec = "h264,mpeg4,vc1",
- AudioCodec = "aac,mp3,ac3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "wmv,asf",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3,m4a,wma,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,png,gif",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
-
- ResponseProfiles = Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs
deleted file mode 100644
index 0a39a5f401..0000000000
--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs
+++ /dev/null
@@ -1,218 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBlurayPlayer2016 : DefaultProfile
- {
- public SonyBlurayPlayer2016()
- {
- Name = "Sony Blu-ray Player 2016";
-
- Identification = new DeviceIdentification
- {
- ModelNumber = "BDP-2016",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S1700",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S3700",
- Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = "BDP-S6700",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- Manufacturer = "Microsoft Corporation";
-
- ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "mkv",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg,mpg",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,mp3,mp2,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,pcm,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,dca,aac,mp3,pcm,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "m2ts,mts",
- VideoCodec = "h264,mpeg4,vc1",
- AudioCodec = "aac,mp3,ac3,dca,dts",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "wmv,asf",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3,m4a,wma,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,png,gif",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
-
- ResponseProfiles = Array.Empty();
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs
deleted file mode 100644
index 05c8ab1c14..0000000000
--- a/Emby.Dlna/Profiles/SonyBlurayPlayerProfile.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBlurayPlayerProfile : DefaultProfile
- {
- public SonyBlurayPlayerProfile()
- {
- Name = "Sony Blu-ray Player";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"Blu-ray Disc Player",
- Manufacturer = "Sony",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @"(Blu-ray Disc Player|Home Theater System|Home Theatre System|Media Player)",
- Match = HeaderMatchType.Regex
- },
-
- new HttpHeaderInfo
- {
- Name = "X-AV-Physical-Unit-Info",
- Value = @"(Blu-ray Disc Player|Home Theater System|Home Theatre System|Media Player)",
- Match = HeaderMatchType.Regex
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- Manufacturer = "Microsoft Corporation";
-
- ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
-
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "mpeg2video",
- AudioCodec = "ac3",
- Type = DlnaProfileType.Video
- },
-
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi,mp4,m4v",
- VideoCodec = "mpeg4,h264",
- AudioCodec = "ac3,aac,mp3,pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "15360000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- }
- }
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264,mpeg4,vc1",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "avi",
- MimeType = "video/mpeg",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mkv",
- MimeType = "video/vnd.dlna.mpeg-tts",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- MimeType = "video/vnd.dlna.mpeg-tts",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mp4",
- MimeType = "video/mpeg",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "m4v",
- MimeType = "video/mpeg",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mpeg",
- MimeType = "video/mpeg",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mp3",
- MimeType = "audio/mpeg",
- Type = DlnaProfileType.Audio
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs
deleted file mode 100644
index 9f0d82b8f8..0000000000
--- a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs
+++ /dev/null
@@ -1,366 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBravia2010Profile : DefaultProfile
- {
- public SonyBravia2010Profile()
- {
- Name = "Sony Bravia (2010)";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"KDL-[0-9]{2}[EHLNPB]X[0-9][01][0-9].*",
- Manufacturer = "Sony",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @".*KDL-[0-9]{2}[EHLNPB]X[0-9][01][0-9].*",
- Match = HeaderMatchType.Regex
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- AlbumArtPn = "JPEG_TN";
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- ModelUrl = "http://www.microsoft.com/";
- Manufacturer = "Microsoft Corporation";
- ManufacturerUrl = "http://www.microsoft.com/";
- SonyAggregationFlags = "10";
- ProtocolInfo =
- "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000";
-
- EnableSingleAlbumArtLimit = true;
- EnableAlbumArtInDidl = true;
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "ac3",
- Type = DlnaProfileType.Video,
- EnableMpegtsM2TsMode = true
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video,mpeg1video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "192"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.VideoTimestamp,
- Value = "Valid"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/mpeg",
- OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "188"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg1video,mpeg2video",
- MimeType = "video/mpeg",
- OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",
- Type = DlnaProfileType.Video
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "20000000"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg2video",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "20000000"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.AudioProfile,
- Value = "he-aac"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "mp3,mp2",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs b/Emby.Dlna/Profiles/SonyBravia2011Profile.cs
deleted file mode 100644
index dfb91817ac..0000000000
--- a/Emby.Dlna/Profiles/SonyBravia2011Profile.cs
+++ /dev/null
@@ -1,389 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBravia2011Profile : DefaultProfile
- {
- public SonyBravia2011Profile()
- {
- Name = "Sony Bravia (2011)";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*",
- Manufacturer = "Sony",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @".*KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*",
- Match = HeaderMatchType.Regex
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- AlbumArtPn = "JPEG_TN";
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- ModelUrl = "http://www.microsoft.com/";
- Manufacturer = "Microsoft Corporation";
- ManufacturerUrl = "http://www.microsoft.com/";
- SonyAggregationFlags = "10";
- EnableSingleAlbumArtLimit = true;
- EnableAlbumArtInDidl = true;
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "ac3",
- Type = DlnaProfileType.Video,
- EnableMpegtsM2TsMode = true
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video,mpeg1video",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3,vc1",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "192"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.VideoTimestamp,
- Value = "Valid"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/mpeg",
- OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "188"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg1video,mpeg2video",
- MimeType = "video/mpeg",
- OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",
- Type = DlnaProfileType.Video
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "20000000"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg2video",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "20000000"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.AudioProfile,
- Value = "he-aac"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "mp3,mp2",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs b/Emby.Dlna/Profiles/SonyBravia2012Profile.cs
deleted file mode 100644
index d59ee38d74..0000000000
--- a/Emby.Dlna/Profiles/SonyBravia2012Profile.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBravia2012Profile : DefaultProfile
- {
- public SonyBravia2012Profile()
- {
- Name = "Sony Bravia (2012)";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"KDL-[0-9]{2}[A-Z]X[0-9]5([0-9]|G).*",
- Manufacturer = "Sony",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @".*KDL-[0-9]{2}[A-Z]X[0-9]5([0-9]|G).*",
- Match = HeaderMatchType.Regex
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- AlbumArtPn = "JPEG_TN";
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- ModelUrl = "http://www.microsoft.com/";
- Manufacturer = "Microsoft Corporation";
- ManufacturerUrl = "http://www.microsoft.com/";
- SonyAggregationFlags = "10";
- EnableSingleAlbumArtLimit = true;
- EnableAlbumArtInDidl = true;
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "ac3",
- Type = DlnaProfileType.Video,
- EnableMpegtsM2TsMode = true
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "ac3,aac,mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4",
- AudioCodec = "ac3,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video,mpeg1video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3,vc1",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "192"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.VideoTimestamp,
- Value = "Valid"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/mpeg",
- OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "188"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg1video,mpeg2video",
- MimeType = "video/mpeg",
- OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",
- Type = DlnaProfileType.Video
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "mp3,mp2",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs b/Emby.Dlna/Profiles/SonyBravia2013Profile.cs
deleted file mode 100644
index 73b0fd67eb..0000000000
--- a/Emby.Dlna/Profiles/SonyBravia2013Profile.cs
+++ /dev/null
@@ -1,324 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBravia2013Profile : DefaultProfile
- {
- public SonyBravia2013Profile()
- {
- Name = "Sony Bravia (2013)";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"KDL-[0-9]{2}[WR][5689][0-9]{2}A.*",
- Manufacturer = "Sony",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @".*KDL-[0-9]{2}[WR][5689][0-9]{2}A.*",
- Match = HeaderMatchType.Regex
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- AlbumArtPn = "JPEG_TN";
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- ModelUrl = "http://www.microsoft.com/";
- Manufacturer = "Microsoft Corporation";
- ManufacturerUrl = "http://www.microsoft.com/";
- SonyAggregationFlags = "10";
- EnableSingleAlbumArtLimit = true;
- EnableAlbumArtInDidl = true;
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "ac3",
- Type = DlnaProfileType.Video,
- EnableMpegtsM2TsMode = true
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,eac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "ac3,eac3,aac,mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mov",
- VideoCodec = "h264,mpeg4,mjpeg",
- AudioCodec = "ac3,eac3,aac,mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "h264,mpeg4,vp8",
- AudioCodec = "ac3,eac3,aac,mp3,mp2,pcm,vorbis",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4",
- AudioCodec = "ac3,eac3,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mjpeg",
- AudioCodec = "pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video,mpeg1video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3,vc1",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "mp4",
- AudioCodec = "aac",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "wav",
- AudioCodec = "pcm",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "192"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.VideoTimestamp,
- Value = "Valid"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/mpeg",
- OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "188"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg1video,mpeg2video",
- MimeType = "video/mpeg",
- OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",
- Type = DlnaProfileType.Video
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "mp3,mp2",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs b/Emby.Dlna/Profiles/SonyBravia2014Profile.cs
deleted file mode 100644
index db8ee5750f..0000000000
--- a/Emby.Dlna/Profiles/SonyBravia2014Profile.cs
+++ /dev/null
@@ -1,324 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyBravia2014Profile : DefaultProfile
- {
- public SonyBravia2014Profile()
- {
- Name = "Sony Bravia (2014)";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = @"(KDL-[0-9]{2}W[5-9][0-9]{2}B|KDL-[0-9]{2}R480|XBR-[0-9]{2}X[89][0-9]{2}B|KD-[0-9]{2}[SX][89][0-9]{3}B).*",
- Manufacturer = "Sony",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @".*(KDL-[0-9]{2}W[5-9][0-9]{2}B|KDL-[0-9]{2}R480|XBR-[0-9]{2}X[89][0-9]{2}B|KD-[0-9]{2}[SX][89][0-9]{3}B).*",
- Match = HeaderMatchType.Regex
- }
- }
- };
-
- AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
-
- AlbumArtPn = "JPEG_TN";
-
- ModelName = "Windows Media Player Sharing";
- ModelNumber = "3.0";
- ModelUrl = "http://www.microsoft.com/";
- Manufacturer = "Microsoft Corporation";
- ManufacturerUrl = "http://www.microsoft.com/";
- SonyAggregationFlags = "10";
- EnableSingleAlbumArtLimit = true;
- EnableAlbumArtInDidl = true;
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "ac3",
- Type = DlnaProfileType.Video,
- EnableMpegtsM2TsMode = true
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,eac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,m4v",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "ac3,eac3,aac,mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mov",
- VideoCodec = "h264,mpeg4,mjpeg",
- AudioCodec = "ac3,eac3,aac,mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mkv",
- VideoCodec = "h264,mpeg4,vp8",
- AudioCodec = "ac3,eac3,aac,mp3,mp2,pcm,vorbis",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4",
- AudioCodec = "ac3,eac3,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mjpeg",
- AudioCodec = "pcm",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg2video,mpeg1video",
- AudioCodec = "mp3,mp2",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3,vc1",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "mp4",
- AudioCodec = "aac",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "wav",
- AudioCodec = "pcm",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "192"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.VideoTimestamp,
- Value = "Valid"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/mpeg",
- OrgPn = "AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
- Type = DlnaProfileType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.PacketLength,
- Value = "188"
- }
- }
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264",
- AudioCodec = "ac3,aac,mp3",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "mpeg2video",
- MimeType = "video/vnd.dlna.mpeg-tts",
- OrgPn = "MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "mpeg",
- VideoCodec = "mpeg1video,mpeg2video",
- MimeType = "video/mpeg",
- OrgPn = "MPEG_PS_NTSC,MPEG_PS_PAL",
- Type = DlnaProfileType.Video
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "mp3,mp2",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyPs3Profile.cs b/Emby.Dlna/Profiles/SonyPs3Profile.cs
deleted file mode 100644
index e4a7a3a596..0000000000
--- a/Emby.Dlna/Profiles/SonyPs3Profile.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyPs3Profile : DefaultProfile
- {
- public SonyPs3Profile()
- {
- Name = "Sony PlayStation 3";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = "PLAYSTATION 3",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = @"PLAYSTATION 3",
- Match = HeaderMatchType.Substring
- },
-
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @"PLAYSTATION 3",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AlbumArtPn = "JPEG_TN";
-
- SonyAggregationFlags = "10";
- EnableSingleAlbumArtLimit = true;
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "avi",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg4",
- AudioCodec = "mp2,mp3"
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "aac,ac3,mp2"
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "mp2"
- },
- new DirectPlayProfile
- {
- Container = "mp4",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac,ac3"
- },
- new DirectPlayProfile
- {
- Container = "aac,mp3,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,png,gif,bmp,tiff",
- Type = DlnaProfileType.Photo
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "aac,ac3,mp2",
- Type = DlnaProfileType.Video
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "15360000",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- },
-
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioBitrate,
- Value = "640000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "wmapro",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.AudioProfile,
- Value = "he-aac",
- IsRequired = false
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "mp4,mov",
- AudioCodec = "aac",
- MimeType = "video/mp4",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "avi",
- MimeType = "video/divx",
- OrgPn = "AVI",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "wav",
- MimeType = "audio/wav",
- Type = DlnaProfileType.Audio
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/SonyPs4Profile.cs b/Emby.Dlna/Profiles/SonyPs4Profile.cs
deleted file mode 100644
index 985df0c9a5..0000000000
--- a/Emby.Dlna/Profiles/SonyPs4Profile.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class SonyPs4Profile : DefaultProfile
- {
- public SonyPs4Profile()
- {
- Name = "Sony PlayStation 4";
-
- Identification = new DeviceIdentification
- {
- FriendlyName = "PLAYSTATION 4",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = @"PLAYSTATION 4",
- Match = HeaderMatchType.Substring
- },
-
- new HttpHeaderInfo
- {
- Name = "X-AV-Client-Info",
- Value = @"PLAYSTATION 4",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- AlbumArtPn = "JPEG_TN";
-
- SonyAggregationFlags = "10";
- EnableSingleAlbumArtLimit = true;
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "avi",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg4",
- AudioCodec = "mp2,mp3"
- },
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video,h264",
- AudioCodec = "aac,ac3,mp2"
- },
- new DirectPlayProfile
- {
- Container = "mpeg",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "mp2"
- },
- new DirectPlayProfile
- {
- Container = "mp4,mkv,m4v",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac,ac3"
- },
- new DirectPlayProfile
- {
- Container = "aac,mp3,wav",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg,png,gif,bmp,tiff",
- Type = DlnaProfileType.Photo
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio,
- // Transcoded audio won't be playable at all without this
- TranscodeSeekInfo = TranscodeSeekInfo.Bytes
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "aac,ac3,mp2",
- Type = DlnaProfileType.Video
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "15360000",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- },
-
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioBitrate,
- Value = "640000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "wmapro",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.AudioProfile,
- Value = "he-aac",
- IsRequired = false
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "mp4,mov",
- AudioCodec = "aac",
- MimeType = "video/mp4",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "avi",
- MimeType = "video/divx",
- OrgPn = "AVI",
- Type = DlnaProfileType.Video
- },
-
- new ResponseProfile
- {
- Container = "wav",
- MimeType = "audio/wav",
- Type = DlnaProfileType.Audio
- },
-
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/WdtvLiveProfile.cs b/Emby.Dlna/Profiles/WdtvLiveProfile.cs
deleted file mode 100644
index 937ca0f425..0000000000
--- a/Emby.Dlna/Profiles/WdtvLiveProfile.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class WdtvLiveProfile : DefaultProfile
- {
- public WdtvLiveProfile()
- {
- Name = "WDTV Live";
-
- TimelineOffsetSeconds = 5;
- IgnoreTranscodeByteRangeRequests = true;
-
- Identification = new DeviceIdentification
- {
- ModelName = "WD TV",
-
- Headers = new[]
- {
- new HttpHeaderInfo { Name = "User-Agent", Value = "alphanetworks", Match = HeaderMatchType.Substring },
- new HttpHeaderInfo
- {
- Name = "User-Agent",
- Value = "ALPHA Networks",
- Match = HeaderMatchType.Substring
- }
- }
- };
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- Type = DlnaProfileType.Audio,
- AudioCodec = "mp3"
- },
- new TranscodingProfile
- {
- Container = "ts",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264",
- AudioCodec = "aac"
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "avi",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
- AudioCodec = "ac3,eac3,dca,mp2,mp3,pcm,dts"
- },
-
- new DirectPlayProfile
- {
- Container = "mpeg",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video",
- AudioCodec = "ac3,eac3,dca,mp2,mp3,pcm,dts"
- },
-
- new DirectPlayProfile
- {
- Container = "mkv",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
- AudioCodec = "ac3,eac3,dca,aac,mp2,mp3,pcm,dts"
- },
-
- new DirectPlayProfile
- {
- Container = "ts,m2ts,mpegts",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg1video,mpeg2video,h264,vc1",
- AudioCodec = "ac3,eac3,dca,mp2,mp3,aac,dts"
- },
-
- new DirectPlayProfile
- {
- Container = "mp4,mov,m4v",
- Type = DlnaProfileType.Video,
- VideoCodec = "h264,mpeg4",
- AudioCodec = "ac3,eac3,aac,mp2,mp3,dca,dts"
- },
-
- new DirectPlayProfile
- {
- Container = "asf",
- Type = DlnaProfileType.Video,
- VideoCodec = "vc1",
- AudioCodec = "wmav2,wmapro"
- },
-
- new DirectPlayProfile
- {
- Container = "asf",
- Type = DlnaProfileType.Video,
- VideoCodec = "mpeg2video",
- AudioCodec = "mp2,ac3"
- },
-
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp2,mp3",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "mp4",
- AudioCodec = "mp4",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "flac",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Container = "ogg",
- AudioCodec = "vorbis",
- Type = DlnaProfileType.Audio
- },
-
- new DirectPlayProfile
- {
- Type = DlnaProfileType.Photo,
-
- Container = "jpeg,png,gif,bmp,tiff"
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "ts,mpegts",
- OrgPn = "MPEG_TS_SD_NA",
- Type = DlnaProfileType.Video
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Photo,
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2"
- }
- }
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.External
- },
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "sub",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "subrip",
- Method = SubtitleDeliveryMethod.Embed
- },
- new SubtitleProfile
- {
- Format = "idx",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/Emby.Dlna/Profiles/XboxOneProfile.cs b/Emby.Dlna/Profiles/XboxOneProfile.cs
deleted file mode 100644
index 84d8184a22..0000000000
--- a/Emby.Dlna/Profiles/XboxOneProfile.cs
+++ /dev/null
@@ -1,372 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Dlna;
-
-namespace Emby.Dlna.Profiles
-{
- [System.Xml.Serialization.XmlRoot("Profile")]
- public class XboxOneProfile : DefaultProfile
- {
- public XboxOneProfile()
- {
- Name = "Xbox One";
-
- TimelineOffsetSeconds = 40;
-
- Identification = new DeviceIdentification
- {
- ModelName = "Xbox One",
-
- Headers = new[]
- {
- new HttpHeaderInfo
- {
- Name = "FriendlyName.DLNA.ORG", Value = "XboxOne", Match = HeaderMatchType.Substring
- },
- new HttpHeaderInfo
- {
- Name = "User-Agent", Value = "NSPlayer/12", Match = HeaderMatchType.Substring
- }
- }
- };
-
- var videoProfile = "high|main|baseline|constrained baseline";
- var videoLevel = "41";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "jpeg",
- VideoCodec = "jpeg",
- Type = DlnaProfileType.Photo
- },
- new TranscodingProfile
- {
- Container = "ts",
- VideoCodec = "h264",
- AudioCodec = "aac",
- Type = DlnaProfileType.Video
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "ts,mpegts",
- VideoCodec = "h264,mpeg2video,hevc",
- AudioCodec = "ac3,aac,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4",
- AudioCodec = "ac3,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "h264",
- AudioCodec = "aac",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,mov,mkv,m4v",
- VideoCodec = "h264,mpeg4,mpeg2video,hevc",
- AudioCodec = "aac,ac3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3,vc1",
- AudioCodec = "wmav2,wmapro",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Video,
- Container = "mp4,mov",
-
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.Has64BitOffsets,
- Value = "false",
- IsRequired = false
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg4",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.IsAnamorphic,
- Value = "true",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitDepth,
- Value = "8",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "5120000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.IsAnamorphic,
- Value = "true",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitDepth,
- Value = "8",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = videoLevel,
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.EqualsAny,
- Property = ProfileConditionValue.VideoProfile,
- Value = videoProfile,
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "wmv2,wmv3,vc1",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.IsAnamorphic,
- Value = "true",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitDepth,
- Value = "8",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "15360000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.NotEquals,
- Property = ProfileConditionValue.IsAnamorphic,
- Value = "true",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitDepth,
- Value = "8",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3,wmav2,wmapro",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
- Conditions = new[]
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.AudioProfile,
- Value = "lc",
- IsRequired = false
- }
- }
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "avi",
- MimeType = "video/avi",
- Type = DlnaProfileType.Video
- },
- new ResponseProfile
- {
- Container = "m4v",
- Type = DlnaProfileType.Video,
- MimeType = "video/mp4"
- }
- };
-
- SubtitleProfiles = new[]
- {
- new SubtitleProfile
- {
- Format = "srt",
- Method = SubtitleDeliveryMethod.Embed
- }
- };
- }
- }
-}
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs
index 5d7b0e874e..a65f65bb21 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs
@@ -34,8 +34,8 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
var client = _factory.CreateClient();
client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client).ConfigureAwait(false));
- using var getResponse = await client.GetAsync("/Dlna/Profiles/" + NonExistentProfile).ConfigureAwait(false);
- Assert.Equal(HttpStatusCode.NotFound, getResponse.StatusCode);
+ using var response = await client.GetAsync("/Dlna/Profiles/" + NonExistentProfile).ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
}
[Fact]
@@ -45,8 +45,8 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
var client = _factory.CreateClient();
client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client).ConfigureAwait(false));
- using var getResponse = await client.DeleteAsync("/Dlna/Profiles/" + NonExistentProfile).ConfigureAwait(false);
- Assert.Equal(HttpStatusCode.NotFound, getResponse.StatusCode);
+ using var response = await client.DeleteAsync("/Dlna/Profiles/" + NonExistentProfile).ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
}
[Fact]
@@ -61,8 +61,8 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
Name = "ThisProfileDoesNotExist"
};
- using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles/" + NonExistentProfile, deviceProfile, _jsonOptions).ConfigureAwait(false);
- Assert.Equal(HttpStatusCode.NotFound, getResponse.StatusCode);
+ using var response = await client.PostAsJsonAsync("/Dlna/Profiles/" + NonExistentProfile, deviceProfile, _jsonOptions).ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
}
[Fact]
@@ -77,8 +77,8 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
Name = "ThisProfileIsNew"
};
- using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles", deviceProfile, _jsonOptions).ConfigureAwait(false);
- Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode);
+ using var response = await client.PostAsJsonAsync("/Dlna/Profiles", deviceProfile, _jsonOptions).ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
}
[Fact]
@@ -115,20 +115,46 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
Id = _newDeviceProfileId
};
- using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles", updatedProfile, _jsonOptions).ConfigureAwait(false);
- Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode);
+ using var postResponse = await client.PostAsJsonAsync("/Dlna/Profiles/" + _newDeviceProfileId, updatedProfile, _jsonOptions).ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.NoContent, postResponse.StatusCode);
+
+ // Verify that the profile got updated
+ using var response = await client.GetAsync("/Dlna/ProfileInfos").ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType);
+ Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet);
+
+ var profiles = await JsonSerializer.DeserializeAsync(
+ await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
+ _jsonOptions).ConfigureAwait(false);
+
+ Assert.Null(profiles?.FirstOrDefault(x => string.Equals(x.Name, "ThisProfileIsNew", StringComparison.Ordinal)));
+ var newProfile = profiles?.FirstOrDefault(x => string.Equals(x.Name, "ThisProfileIsUpdated", StringComparison.Ordinal));
+ Assert.NotNull(newProfile);
+ _newDeviceProfileId = newProfile!.Id;
}
[Fact]
- [Priority(4)]
+ [Priority(5)]
public async Task DeleteProfile_Valid_NoContent()
{
var client = _factory.CreateClient();
client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client).ConfigureAwait(false));
- using var getResponse = await client.DeleteAsync("/Dlna/Profiles/" + _newDeviceProfileId).ConfigureAwait(false);
- Console.WriteLine(await getResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
- Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode);
+ using var deleteResponse = await client.DeleteAsync("/Dlna/Profiles/" + _newDeviceProfileId).ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.NoContent, deleteResponse.StatusCode);
+
+ // Verify that the profile got deleted
+ using var response = await client.GetAsync("/Dlna/ProfileInfos").ConfigureAwait(false);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType);
+ Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet);
+
+ var profiles = await JsonSerializer.DeserializeAsync(
+ await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
+ _jsonOptions).ConfigureAwait(false);
+
+ Assert.Null(profiles?.FirstOrDefault(x => string.Equals(x.Name, "ThisProfileIsUpdated", StringComparison.Ordinal)));
}
}
}
From 181b2760b8ce590c25cdb8fd57f44ac1aaa49984 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Thu, 26 May 2022 16:30:21 +0200
Subject: [PATCH 003/262] Revert UPnP version to 1.0
---
Jellyfin.Server/Startup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs
index 2cb6d937a8..1954a5c558 100644
--- a/Jellyfin.Server/Startup.cs
+++ b/Jellyfin.Server/Startup.cs
@@ -109,7 +109,7 @@ namespace Jellyfin.Server
c.DefaultRequestHeaders.UserAgent.ParseAdd(
string.Format(
CultureInfo.InvariantCulture,
- "{0}/{1} UPnP/1.1 {2}/{3}",
+ "{0}/{1} UPnP/1.0 {2}/{3}",
MediaBrowser.Common.System.OperatingSystem.Name,
Environment.OSVersion,
_serverApplicationHost.Name,
From d89596591e0e51d347444f7677a12a716d4d7dfe Mon Sep 17 00:00:00 2001
From: hogenf
Date: Sun, 5 Jun 2022 11:25:55 +0200
Subject: [PATCH 004/262] Add cinema ratings for sv,fi,no
---
Emby.Server.Implementations/Localization/Ratings/fi.csv | 6 ++++++
Emby.Server.Implementations/Localization/Ratings/no.csv | 6 ++++++
Emby.Server.Implementations/Localization/Ratings/sv.csv | 5 +++++
3 files changed, 17 insertions(+)
create mode 100644 Emby.Server.Implementations/Localization/Ratings/fi.csv
create mode 100644 Emby.Server.Implementations/Localization/Ratings/no.csv
create mode 100644 Emby.Server.Implementations/Localization/Ratings/sv.csv
diff --git a/Emby.Server.Implementations/Localization/Ratings/fi.csv b/Emby.Server.Implementations/Localization/Ratings/fi.csv
new file mode 100644
index 0000000000..d7d8be49d4
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Ratings/fi.csv
@@ -0,0 +1,6 @@
+FI-S,1
+FI-T,1
+FI-7,4
+FI-12,5
+FI-16,8
+FI-18,9
diff --git a/Emby.Server.Implementations/Localization/Ratings/no.csv b/Emby.Server.Implementations/Localization/Ratings/no.csv
new file mode 100644
index 0000000000..127407be86
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Ratings/no.csv
@@ -0,0 +1,6 @@
+NO-A,1
+NO-6,3
+NO-9,4
+NO-12,5
+NO-15,8
+NO-18,9
diff --git a/Emby.Server.Implementations/Localization/Ratings/sv.csv b/Emby.Server.Implementations/Localization/Ratings/sv.csv
new file mode 100644
index 0000000000..1443c07df7
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Ratings/sv.csv
@@ -0,0 +1,5 @@
+SE-Btl,1
+SE-Barntillåten,1
+SE-7,3
+SE-11,5
+SE-15,8
From 5df2ee9e55c1628ec7bd02a5c69565802f9462a0 Mon Sep 17 00:00:00 2001
From: hogenf
Date: Sun, 5 Jun 2022 11:31:08 +0200
Subject: [PATCH 005/262] Add TV ratings Finland
---
Emby.Server.Implementations/Localization/Ratings/fi.csv | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Emby.Server.Implementations/Localization/Ratings/fi.csv b/Emby.Server.Implementations/Localization/Ratings/fi.csv
index d7d8be49d4..782785890f 100644
--- a/Emby.Server.Implementations/Localization/Ratings/fi.csv
+++ b/Emby.Server.Implementations/Localization/Ratings/fi.csv
@@ -4,3 +4,7 @@ FI-7,4
FI-12,5
FI-16,8
FI-18,9
+FI-K7,4
+FI-K12,5
+FI-K16,8
+FI-K18,9
From e2ae79be2b0b044092762d54b0e0056b127a3e2b Mon Sep 17 00:00:00 2001
From: hogenf
Date: Thu, 9 Jun 2022 13:48:29 +0200
Subject: [PATCH 006/262] Change Country code is SE
SV is language code. SE country code.
---
.../Localization/Ratings/{sv.csv => se.csv} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename Emby.Server.Implementations/Localization/Ratings/{sv.csv => se.csv} (100%)
diff --git a/Emby.Server.Implementations/Localization/Ratings/sv.csv b/Emby.Server.Implementations/Localization/Ratings/se.csv
similarity index 100%
rename from Emby.Server.Implementations/Localization/Ratings/sv.csv
rename to Emby.Server.Implementations/Localization/Ratings/se.csv
From 5b4e14940ea20c0afeea6c2031e34aa870786fe9 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Tue, 14 Jun 2022 16:43:48 +0200
Subject: [PATCH 007/262] Fix format string
---
Emby.Dlna/PlayTo/DlnaHttpClient.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Emby.Dlna/PlayTo/DlnaHttpClient.cs b/Emby.Dlna/PlayTo/DlnaHttpClient.cs
index 623f4526c8..62156d1833 100644
--- a/Emby.Dlna/PlayTo/DlnaHttpClient.cs
+++ b/Emby.Dlna/PlayTo/DlnaHttpClient.cs
@@ -59,7 +59,7 @@ namespace Emby.Dlna.PlayTo
_logger.LogError(ex, "Failed to parse response");
if (_logger.IsEnabled(LogLevel.Debug))
{
- _logger.LogDebug("Malformed response:\n", await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false));
+ _logger.LogDebug("Malformed response: {Content}\n", await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false));
}
return null;
From 72893da4d8fe90fd8e5c94a4a337c8d154751f42 Mon Sep 17 00:00:00 2001
From: adrez99
Date: Thu, 2 Jun 2022 22:32:15 +0200
Subject: [PATCH 008/262] Use System.IO.Compression instead of SharpCompress
for gzips
---
.../ApplicationHost.cs | 3 -
.../Archiving/ZipClient.cs | 46 -------
.../Emby.Server.Implementations.csproj | 1 -
.../LiveTv/Listings/XmlTvListingsProvider.cs | 113 +++++-------------
MediaBrowser.Model/IO/IZipClient.cs | 16 ---
5 files changed, 33 insertions(+), 146 deletions(-)
delete mode 100644 Emby.Server.Implementations/Archiving/ZipClient.cs
delete mode 100644 MediaBrowser.Model/IO/IZipClient.cs
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 82294644b8..e05f13d053 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -22,7 +22,6 @@ using Emby.Drawing;
using Emby.Naming.Common;
using Emby.Notifications;
using Emby.Photos;
-using Emby.Server.Implementations.Archiving;
using Emby.Server.Implementations.Channels;
using Emby.Server.Implementations.Collections;
using Emby.Server.Implementations.Configuration;
@@ -558,8 +557,6 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton();
- serviceCollection.AddSingleton();
-
serviceCollection.AddSingleton(this);
serviceCollection.AddSingleton(ApplicationPaths);
diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs
deleted file mode 100644
index 6a3b250d25..0000000000
--- a/Emby.Server.Implementations/Archiving/ZipClient.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.IO;
-using MediaBrowser.Model.IO;
-using SharpCompress.Common;
-using SharpCompress.Readers;
-using SharpCompress.Readers.GZip;
-
-namespace Emby.Server.Implementations.Archiving
-{
- ///
- /// Class DotNetZipClient.
- ///
- public class ZipClient : IZipClient
- {
- ///
- public void ExtractAllFromGz(Stream source, string targetPath, bool overwriteExistingFiles)
- {
- using var reader = GZipReader.Open(source);
- var options = new ExtractionOptions
- {
- ExtractFullPath = true,
- Overwrite = overwriteExistingFiles
- };
-
- Directory.CreateDirectory(targetPath);
- reader.WriteAllToDirectory(targetPath, options);
- }
-
- ///
- public void ExtractFirstFileFromGz(Stream source, string targetPath, string defaultFileName)
- {
- using var reader = GZipReader.Open(source);
- if (reader.MoveToNextEntry())
- {
- var entry = reader.Entry;
-
- var filename = entry.Key;
- if (string.IsNullOrWhiteSpace(filename))
- {
- filename = defaultFileName;
- }
-
- reader.WriteEntryToFile(Path.Combine(targetPath, filename));
- }
- }
- }
-}
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index 161c696420..ff037f21bc 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -32,7 +32,6 @@
-
diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
index bd1cd1e1de..10f7e5cc86 100644
--- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
+++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
@@ -6,9 +6,9 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
+using System.IO.Compression;
using System.Linq;
using System.Net.Http;
-using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Extensions;
@@ -33,20 +33,17 @@ namespace Emby.Server.Implementations.LiveTv.Listings
private readonly IHttpClientFactory _httpClientFactory;
private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
- private readonly IZipClient _zipClient;
public XmlTvListingsProvider(
IServerConfigurationManager config,
IHttpClientFactory httpClientFactory,
ILogger logger,
- IFileSystem fileSystem,
- IZipClient zipClient)
+ IFileSystem fileSystem)
{
_config = config;
_httpClientFactory = httpClientFactory;
_logger = logger;
_fileSystem = fileSystem;
- _zipClient = zipClient;
}
public string Name => "XmlTV";
@@ -67,16 +64,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{
_logger.LogInformation("xmltv path: {Path}", info.Path);
- if (!info.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
- {
- return UnzipIfNeeded(info.Path, info.Path);
- }
-
string cacheFilename = info.Id + ".xml";
string cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename);
+
if (File.Exists(cacheFile) && File.GetLastWriteTimeUtc(cacheFile) >= DateTime.UtcNow.Subtract(_maxCacheAge))
{
- return UnzipIfNeeded(info.Path, cacheFile);
+ return cacheFile;
}
// Must check if file exists as parent directory may not exist.
@@ -84,95 +77,55 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{
File.Delete(cacheFile);
}
-
- _logger.LogInformation("Downloading xmltv listings from {Path}", info.Path);
-
- Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
-
- using var response = await _httpClientFactory.CreateClient(NamedClient.Default).GetAsync(info.Path, cancellationToken).ConfigureAwait(false);
- await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
- await using (var fileStream = new FileStream(cacheFile, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.CopyToBufferSize, FileOptions.Asynchronous))
+ else
{
- await stream.CopyToAsync(fileStream, cancellationToken).ConfigureAwait(false);
+ Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
}
- return UnzipIfNeeded(info.Path, cacheFile);
+ if (info.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
+ {
+ _logger.LogInformation("Downloading xmltv listings from {Path}", info.Path);
+
+ using var response = await _httpClientFactory.CreateClient(NamedClient.Default).GetAsync(info.Path, cancellationToken).ConfigureAwait(false);
+ await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
+
+ return await UnzipIfNeededAndCopy(info.Path, stream, cacheFile, cancellationToken).ConfigureAwait(false);
+ }
+ else
+ {
+ await using var stream = new FileStream(info.Path, FileMode.Open, FileAccess.Read, FileShare.Read, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
+
+ return await UnzipIfNeededAndCopy(info.Path, stream, cacheFile, cancellationToken).ConfigureAwait(false);
+ }
}
- private string UnzipIfNeeded(ReadOnlySpan originalUrl, string file)
+ private async Task UnzipIfNeededAndCopy(string originalUrl, Stream stream, string file, CancellationToken cancellationToken)
{
- ReadOnlySpan ext = Path.GetExtension(originalUrl.LeftPart('?'));
+ int index = originalUrl.IndexOf('?', StringComparison.CurrentCulture);
+ string ext = Path.GetExtension(index > -1 ? originalUrl.Remove(index) : originalUrl);
if (ext.Equals(".gz", StringComparison.OrdinalIgnoreCase))
{
try
{
- string tempFolder = ExtractGz(file);
- return FindXmlFile(tempFolder);
+ using var reader = new GZipStream(stream, CompressionMode.Decompress);
+ await using var writer = File.Create(file);
+ await reader.CopyToAsync(writer, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error extracting from gz file {File}", file);
- }
-
- try
- {
- string tempFolder = ExtractFirstFileFromGz(file);
- return FindXmlFile(tempFolder);
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error extracting from zip file {File}", file);
+ _logger.LogError(ex, "Error extracting from gz file {File}", originalUrl);
}
}
+ else
+ {
+ await using var fileStream = new FileStream(file, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.CopyToBufferSize, FileOptions.Asynchronous);
+ await stream.CopyToAsync(fileStream, cancellationToken).ConfigureAwait(false);
+ }
return file;
}
- private string ExtractFirstFileFromGz(string file)
- {
- using (var stream = File.OpenRead(file))
- {
- string tempFolder = GetTempFolderPath(stream);
- Directory.CreateDirectory(tempFolder);
-
- _zipClient.ExtractFirstFileFromGz(stream, tempFolder, "data.xml");
-
- return tempFolder;
- }
- }
-
- private string ExtractGz(string file)
- {
- using (var stream = File.OpenRead(file))
- {
- string tempFolder = GetTempFolderPath(stream);
- Directory.CreateDirectory(tempFolder);
-
- _zipClient.ExtractAllFromGz(stream, tempFolder, true);
-
- return tempFolder;
- }
- }
-
- private string GetTempFolderPath(Stream stream)
- {
-#pragma warning disable CA5351
- using var md5 = MD5.Create();
-#pragma warning restore CA5351
- var checksum = Convert.ToHexString(md5.ComputeHash(stream));
- stream.Position = 0;
- return Path.Combine(_config.ApplicationPaths.TempDirectory, checksum);
- }
-
- private string FindXmlFile(string directory)
- {
- return _fileSystem.GetFiles(directory, true)
- .Where(i => string.Equals(i.Extension, ".xml", StringComparison.OrdinalIgnoreCase))
- .Select(i => i.FullName)
- .FirstOrDefault();
- }
-
public async Task> GetProgramsAsync(ListingsProviderInfo info, string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(channelId))
diff --git a/MediaBrowser.Model/IO/IZipClient.cs b/MediaBrowser.Model/IO/IZipClient.cs
deleted file mode 100644
index 2448575d19..0000000000
--- a/MediaBrowser.Model/IO/IZipClient.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma warning disable CS1591
-
-using System.IO;
-
-namespace MediaBrowser.Model.IO
-{
- ///
- /// Interface IZipClient.
- ///
- public interface IZipClient
- {
- void ExtractAllFromGz(Stream source, string targetPath, bool overwriteExistingFiles);
-
- void ExtractFirstFileFromGz(Stream source, string targetPath, string defaultFileName);
- }
-}
From 9a5869ea82c56757b4d12226005cf86ede780436 Mon Sep 17 00:00:00 2001
From: JinYi-Tsinghua <109143373+JinYi-Tsinghua@users.noreply.github.com>
Date: Tue, 12 Jul 2022 18:18:25 +0800
Subject: [PATCH 009/262] Add static build file for musl-linux-arm64
---
deployment/build.linux.musl-linux-arm64 | 31 +++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 deployment/build.linux.musl-linux-arm64
diff --git a/deployment/build.linux.musl-linux-arm64 b/deployment/build.linux.musl-linux-arm64
new file mode 100644
index 0000000000..e1ccbc266e
--- /dev/null
+++ b/deployment/build.linux.musl-linux-arm64
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#= Generic Linux musl-linux-arm64 .tar.gz
+
+set -o errexit
+set -o xtrace
+
+# Move to source directory
+pushd ${SOURCE_DIR}
+
+# Get version
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ version="${BUILD_ID}"
+else
+ version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+fi
+
+# Build archives
+dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-musl-arm64 --output dist/jellyfin-server_${version}/ "-p:DebugSymbols=false;DebugType=none;UseAppHost=true"
+tar -czf jellyfin-server_${version}_linux-arm64-musl.tar.gz -C dist jellyfin-server_${version}
+rm -rf dist/jellyfin-server_${version}
+
+# Move the artifacts out
+mkdir -p ${ARTIFACT_DIR}/
+mv jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/
+
+if [[ ${IS_DOCKER} == YES ]]; then
+ chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
+fi
+
+popd
From a94aec9b326935bc9583f74f3f3c15df0139cf24 Mon Sep 17 00:00:00 2001
From: JinYi-Tsinghua <109143373+JinYi-Tsinghua@users.noreply.github.com>
Date: Tue, 12 Jul 2022 18:20:29 +0800
Subject: [PATCH 010/262] Create Dockerfile.linux.musl-linux-arm64
---
deployment/Dockerfile.linux.musl-linux-arm64 | 26 ++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 deployment/Dockerfile.linux.musl-linux-arm64
diff --git a/deployment/Dockerfile.linux.musl-linux-arm64 b/deployment/Dockerfile.linux.musl-linux-arm64
new file mode 100644
index 0000000000..2da72e4ae0
--- /dev/null
+++ b/deployment/Dockerfile.linux.musl-linux-arm64
@@ -0,0 +1,26 @@
+FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
+# Docker build arguments
+ARG SOURCE_DIR=/jellyfin
+ARG ARTIFACT_DIR=/dist
+# Docker run environment
+ENV SOURCE_DIR=/jellyfin
+ENV ARTIFACT_DIR=/dist
+ENV DEB_BUILD_OPTIONS=noddebs
+ENV ARCH=arm64
+ENV IS_DOCKER=YES
+
+# Prepare Debian build environment
+RUN apt-get update -yqq \
+ && apt-get install -yqq --no-install-recommends \
+ apt-transport-https debhelper gnupg devscripts unzip \
+ mmv libcurl4-openssl-dev libfontconfig1-dev \
+ libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
+
+# Link to docker-build script
+RUN ln -sf ${SOURCE_DIR}/deployment/build.linux.musl-linux-arm64 /build.sh
+
+VOLUME ${SOURCE_DIR}/
+
+VOLUME ${ARTIFACT_DIR}/
+
+ENTRYPOINT ["/build.sh"]
From 54b3debd2774caedf92a531a2461b42d7bb37af1 Mon Sep 17 00:00:00 2001
From: Joseph <1315585+joseph39@users.noreply.github.com>
Date: Mon, 18 Jul 2022 23:30:27 -0700
Subject: [PATCH 011/262] Add referer parameter to ffmpeg
As of https://trac.ffmpeg.org/ticket/2179, ffmpeg supports referer parameter which injects Referer header to the HTTP request for remote content. Have EncodingHelper pass this in if it's included in RemoteHttpHeaders.
---
.../MediaEncoding/EncodingHelper.cs | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 6fb5c88740..ab2daf7a50 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -255,6 +255,21 @@ namespace MediaBrowser.Controller.MediaEncoding
return string.Empty;
}
+ ///
+ /// Gets the referer param.
+ ///
+ /// The state.
+ /// System.String.
+ public string GetRefererParam(EncodingJobInfo state)
+ {
+ if (state.RemoteHttpHeaders.TryGetValue("Referer", out string referer))
+ {
+ return "-referer \"" + referer + "\"";
+ }
+
+ return string.Empty;
+ }
+
public static string GetInputFormat(string container)
{
if (string.IsNullOrEmpty(container))
@@ -4962,6 +4977,15 @@ namespace MediaBrowser.Controller.MediaEncoding
inputModifier = inputModifier.Trim();
+ var refererParam = GetRefererParam(state);
+
+ if (!string.IsNullOrEmpty(refererParam))
+ {
+ inputModifier += " " + refererParam;
+ }
+
+ inputModifier = inputModifier.Trim();
+
inputModifier += " " + GetFastSeekCommandLineParameter(state, encodingOptions, segmentContainer);
inputModifier = inputModifier.Trim();
From 9ec2870b1034e0b64ebde3e29a3779c7f6bb2ac4 Mon Sep 17 00:00:00 2001
From: luz paz
Date: Mon, 15 Aug 2022 06:48:34 -0400
Subject: [PATCH 012/262] Fix various typos
Found via `codespell -q 3 -S ./Emby.Server.Implementations/Localization -L allready,doesnt,inh,receivedfrom,whoknows`
---
Emby.Dlna/Didl/DidlBuilder.cs | 2 +-
Emby.Dlna/DlnaManager.cs | 2 +-
Emby.Dlna/IDlnaEventManager.cs | 4 ++--
Emby.Server.Implementations/Library/LibraryManager.cs | 2 +-
.../Library/Resolvers/Movies/MovieResolver.cs | 2 +-
.../LiveTv/TunerHosts/M3uParser.cs | 2 +-
Emby.Server.Implementations/Session/SessionManager.cs | 2 +-
.../Session/SessionWebSocketListener.cs | 2 +-
Jellyfin.Api/Controllers/AudioController.cs | 2 +-
Jellyfin.Api/Controllers/DynamicHlsController.cs | 4 ++--
Jellyfin.Api/Controllers/SearchController.cs | 6 +++---
Jellyfin.Api/Controllers/UserController.cs | 2 +-
Jellyfin.Api/Models/StreamingDtos/StreamState.cs | 2 +-
.../SyncPlayDtos/RemoveFromPlaylistRequestDto.cs | 4 ++--
Jellyfin.Drawing.Skia/SkiaHelper.cs | 2 +-
.../Configuration/NetworkConfiguration.cs | 2 +-
Jellyfin.Networking/Manager/NetworkManager.cs | 2 +-
MediaBrowser.Controller/Entities/TV/Season.cs | 2 +-
.../MediaEncoding/EncodingHelper.cs | 4 ++--
.../SyncPlay/GroupStates/WaitingGroupState.cs | 2 +-
.../PlaybackRequests/RemoveFromPlaylistGroupRequest.cs | 4 ++--
.../SyncPlay/Queue/PlayQueueManager.cs | 4 ++--
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 4 ++--
MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs | 2 +-
MediaBrowser.Model/Dto/BaseItemDto.cs | 6 +++---
MediaBrowser.Model/Entities/MediaStream.cs | 2 +-
MediaBrowser.Model/SyncPlay/GroupStateType.cs | 2 +-
MediaBrowser.Model/Tasks/ITaskManager.cs | 10 +++++-----
MediaBrowser.Model/Tasks/ITaskTrigger.cs | 4 ++--
MediaBrowser.Providers/Manager/ProviderManager.cs | 2 +-
.../Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs | 2 +-
MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs | 2 +-
src/Jellyfin.Extensions/SplitStringExtensions.cs | 2 +-
src/Jellyfin.Extensions/StringExtensions.cs | 2 +-
.../Cryptography/PasswordHashTests.cs | 6 +++---
tests/Jellyfin.Networking.Tests/NetworkParseTests.cs | 2 +-
.../SchedulesDirect/SchedulesDirectDeserializeTests.cs | 2 +-
.../Test Data/Updates/manifest-stable.json | 2 +-
38 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs
index df6539a5a6..8e3a335c66 100644
--- a/Emby.Dlna/Didl/DidlBuilder.cs
+++ b/Emby.Dlna/Didl/DidlBuilder.cs
@@ -446,7 +446,7 @@ namespace Emby.Dlna.Didl
///
///
/// If context is a season, this will return a string containing just episode number and name.
- /// Otherwise the result will include series nams and season number.
+ /// Otherwise the result will include series names and season number.
///
/// The episode.
/// Current context.
diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs
index fe78d74ee7..74624334bb 100644
--- a/Emby.Dlna/DlnaManager.cs
+++ b/Emby.Dlna/DlnaManager.cs
@@ -123,7 +123,7 @@ namespace Emby.Dlna
///
/// Attempts to match a device with a profile.
/// Rules:
- /// - If the profile field has no value, the field matches irregardless of its contents.
+ /// - If the profile field has no value, the field matches regardless of its contents.
/// - the profile field can be an exact match, or a reg exp.
///
/// The of the device.
diff --git a/Emby.Dlna/IDlnaEventManager.cs b/Emby.Dlna/IDlnaEventManager.cs
index 33cf0896ba..eea030d6d1 100644
--- a/Emby.Dlna/IDlnaEventManager.cs
+++ b/Emby.Dlna/IDlnaEventManager.cs
@@ -16,7 +16,7 @@ namespace Emby.Dlna
///
/// The subscription identifier.
/// The notification type.
- /// The requested timeout as a sting.
+ /// The requested timeout as a string.
/// The callback url.
/// The response.
EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl);
@@ -25,7 +25,7 @@ namespace Emby.Dlna
/// Creates the event subscription.
///
/// The notification type.
- /// The requested timeout as a sting.
+ /// The requested timeout as a string.
/// The callback url.
/// The response.
EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl);
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 2843fb8f83..6796845525 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -2529,7 +2529,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error reading the episode informations with ffprobe. Episode: {EpisodeInfo}", episodeInfo.Path);
+ _logger.LogError(ex, "Error reading the episode information with ffprobe. Episode: {EpisodeInfo}", episodeInfo.Path);
}
var changed = false;
diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index a60251dacd..b2f388a667 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (!string.IsNullOrEmpty(item.Path))
{
- // check for imdb id - we use full media path, as we can assume, that this will match in any use case (wither id in parent dir or in file name)
+ // check for imdb id - we use full media path, as we can assume, that this will match in any use case (either id in parent dir or in file name)
var imdbid = item.Path.AsSpan().GetAttributeValue("imdbid");
if (!string.IsNullOrWhiteSpace(imdbid))
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
index 708ff52d79..be06356a4f 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
@@ -199,7 +199,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
if (string.IsNullOrWhiteSpace(numberString))
{
// Using this as a fallback now as this leads to Problems with channels like "5 USA"
- // where 5 isn't ment to be the channel number
+ // where 5 isn't meant to be the channel number
// Check for channel number with the format from SatIp
// #EXTINF:0,84. VOX Schweiz
// #EXTINF:0,84.0 - VOX Schweiz
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index d25376297f..7f927e2709 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -1242,7 +1242,7 @@ namespace Emby.Server.Implementations.Session
if (item == null)
{
- _logger.LogError("A non-existant item Id {0} was passed into TranslateItemForPlayback", id);
+ _logger.LogError("A non-existent item Id {0} was passed into TranslateItemForPlayback", id);
return Array.Empty();
}
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
index a085ee546d..fccf50f60f 100644
--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -37,7 +37,7 @@ namespace Emby.Server.Implementations.Session
private const float ForceKeepAliveFactor = 0.75f;
///
- /// Lock used for accesing the KeepAlive cancellation token.
+ /// Lock used for accessing the KeepAlive cancellation token.
///
private readonly object _keepAliveLock = new object();
diff --git a/Jellyfin.Api/Controllers/AudioController.cs b/Jellyfin.Api/Controllers/AudioController.cs
index 54ac06276e..94f7a7b827 100644
--- a/Jellyfin.Api/Controllers/AudioController.cs
+++ b/Jellyfin.Api/Controllers/AudioController.cs
@@ -207,7 +207,7 @@ namespace Jellyfin.Api.Controllers
/// Optional. The dlna device profile id to utilize.
/// The play session id.
/// The segment container.
- /// The segment lenght.
+ /// The segment length.
/// The minimum number of segments.
/// The media version id, if playing an alternate version.
/// The device id of the client requesting. Used to stop encoding processes when needed.
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 1e8d038751..3ed80f6621 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -121,7 +121,7 @@ namespace Jellyfin.Api.Controllers
/// Optional. The dlna device profile id to utilize.
/// The play session id.
/// The segment container.
- /// The segment lenght.
+ /// The segment length.
/// The minimum number of segments.
/// The media version id, if playing an alternate version.
/// The device id of the client requesting. Used to stop encoding processes when needed.
@@ -1832,7 +1832,7 @@ namespace Jellyfin.Api.Controllers
// Set the key frame params for video encoding to match the hls segment time.
args += _encodingHelper.GetHlsVideoKeyFrameArguments(state, codec, state.SegmentLength, isEventPlaylist, startNumber);
- // Currenly b-frames in libx265 breaks the FMP4-HLS playback on iOS, disable it for now.
+ // Currently b-frames in libx265 breaks the FMP4-HLS playback on iOS, disable it for now.
if (string.Equals(codec, "libx265", StringComparison.OrdinalIgnoreCase))
{
args += " -bf 0";
diff --git a/Jellyfin.Api/Controllers/SearchController.cs b/Jellyfin.Api/Controllers/SearchController.cs
index 07e113ad3e..3b1f7a52ab 100644
--- a/Jellyfin.Api/Controllers/SearchController.cs
+++ b/Jellyfin.Api/Controllers/SearchController.cs
@@ -60,9 +60,9 @@ namespace Jellyfin.Api.Controllers
/// Optional. The maximum number of records to return.
/// Optional. Supply a user id to search within a user's library or omit to search all.
/// The search term to filter on.
- /// If specified, only results with the specified item types are returned. This allows multiple, comma delimeted.
- /// If specified, results with these item types are filtered out. This allows multiple, comma delimeted.
- /// If specified, only results with the specified media types are returned. This allows multiple, comma delimeted.
+ /// If specified, only results with the specified item types are returned. This allows multiple, comma delimited.
+ /// If specified, results with these item types are filtered out. This allows multiple, comma delimited.
+ /// If specified, only results with the specified media types are returned. This allows multiple, comma delimited.
/// If specified, only children of the parent are returned.
/// Optional filter for movies.
/// Optional filter for series.
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs
index 82c8563a80..d1109bebc8 100644
--- a/Jellyfin.Api/Controllers/UserController.cs
+++ b/Jellyfin.Api/Controllers/UserController.cs
@@ -502,7 +502,7 @@ namespace Jellyfin.Api.Controllers
if (isLocal)
{
- _logger.LogWarning("Password reset proccess initiated from outside the local network with IP: {IP}", ip);
+ _logger.LogWarning("Password reset process initiated from outside the local network with IP: {IP}", ip);
}
var result = await _userManager.StartForgotPasswordProcess(forgotPasswordRequest.EnteredUsername, isLocal).ConfigureAwait(false);
diff --git a/Jellyfin.Api/Models/StreamingDtos/StreamState.cs b/Jellyfin.Api/Models/StreamingDtos/StreamState.cs
index 192f33ebd1..8182e3c9e8 100644
--- a/Jellyfin.Api/Models/StreamingDtos/StreamState.cs
+++ b/Jellyfin.Api/Models/StreamingDtos/StreamState.cs
@@ -169,7 +169,7 @@ namespace Jellyfin.Api.Models.StreamingDtos
///
/// Disposes the stream state.
///
- /// Whether the object is currently beeing disposed.
+ /// Whether the object is currently being disposed.
protected virtual void Dispose(bool disposing)
{
if (_disposed)
diff --git a/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs b/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs
index 02ce5a0488..226a584e1d 100644
--- a/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs
+++ b/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs
@@ -17,9 +17,9 @@ namespace Jellyfin.Api.Models.SyncPlayDtos
}
///
- /// Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist.
+ /// Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist.
///
- /// The playlist identifiers ot the items.
+ /// The playlist identifiers of the items.
public IReadOnlyList PlaylistItemIds { get; set; }
///
diff --git a/Jellyfin.Drawing.Skia/SkiaHelper.cs b/Jellyfin.Drawing.Skia/SkiaHelper.cs
index c001c32b8c..0478fc7c31 100644
--- a/Jellyfin.Drawing.Skia/SkiaHelper.cs
+++ b/Jellyfin.Drawing.Skia/SkiaHelper.cs
@@ -13,7 +13,7 @@ namespace Jellyfin.Drawing.Skia
///
/// The current skia encoder.
/// The list of image paths.
- /// The current checked indes.
+ /// The current checked index.
/// The new index.
/// A valid bitmap, or null if no bitmap exists after currentIndex.
public static SKBitmap? GetNextValidImage(SkiaEncoder skiaEncoder, IReadOnlyList paths, int currentIndex, out int newIndex)
diff --git a/Jellyfin.Networking/Configuration/NetworkConfiguration.cs b/Jellyfin.Networking/Configuration/NetworkConfiguration.cs
index 61db223d92..361dbc8142 100644
--- a/Jellyfin.Networking/Configuration/NetworkConfiguration.cs
+++ b/Jellyfin.Networking/Configuration/NetworkConfiguration.cs
@@ -193,7 +193,7 @@ namespace Jellyfin.Networking.Configuration
public bool AutoDiscovery { get; set; } = true;
///
- /// Gets or sets the filter for remote IP connectivity. Used in conjuntion with .
+ /// Gets or sets the filter for remote IP connectivity. Used in conjunction with .
///
public string[] RemoteIPFilter { get; set; } = Array.Empty();
diff --git a/Jellyfin.Networking/Manager/NetworkManager.cs b/Jellyfin.Networking/Manager/NetworkManager.cs
index 4b7b87814c..fd0665dbdd 100644
--- a/Jellyfin.Networking/Manager/NetworkManager.cs
+++ b/Jellyfin.Networking/Manager/NetworkManager.cs
@@ -944,7 +944,7 @@ namespace Jellyfin.Networking.Manager
// Add virtual machine interface names to the list of bind exclusions, so that they are auto-excluded.
if (config.IgnoreVirtualInterfaces)
{
- // each virtual interface name must be pre-pended with the exclusion symbol !
+ // each virtual interface name must be prepended with the exclusion symbol !
var virtualInterfaceNames = config.VirtualInterfaceNames.Split(',').Select(p => "!" + p).ToArray();
if (lanAddresses.Length > 0)
{
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs
index bd8df2facb..599d35da64 100644
--- a/MediaBrowser.Controller/Entities/TV/Season.cs
+++ b/MediaBrowser.Controller/Entities/TV/Season.cs
@@ -244,7 +244,7 @@ namespace MediaBrowser.Controller.Entities.TV
///
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
///
- /// true to replace metdata, false to not.
+ /// true to replace metadata, false to not.
/// true if XXXX, false otherwise.
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
{
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index e5aae620ac..17e410fe13 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -194,7 +194,7 @@ namespace MediaBrowser.Controller.MediaEncoding
///
/// Gets the name of the output video codec.
///
- /// Encording state.
+ /// Encoding state.
/// Encoding options.
/// Encoder string.
public string GetVideoEncoder(EncodingJobInfo state, EncodingOptions encodingOptions)
@@ -1980,7 +1980,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
- // Cap the max target bitrate to intMax/2 to satisify the bufsize=bitrate*2.
+ // Cap the max target bitrate to intMax/2 to satisfy the bufsize=bitrate*2.
return Math.Min(bitrate ?? 0, int.MaxValue / 2);
}
diff --git a/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs b/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs
index a0c38b3097..2164945560 100644
--- a/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs
+++ b/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs
@@ -549,7 +549,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
if (InitialState.Equals(GroupStateType.Playing))
{
- // Group went from playing to waiting state and a pause request occured while waiting.
+ // Group went from playing to waiting state and a pause request occurred while waiting.
var pauseRequest = new PauseGroupRequest();
pausedState.HandleRequest(pauseRequest, context, Type, session, cancellationToken);
}
diff --git a/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs b/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
index 2f38d6adc3..619294e957 100644
--- a/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
+++ b/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
@@ -27,9 +27,9 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
}
///
- /// Gets the playlist identifiers ot the items.
+ /// Gets the playlist identifiers of the items.
///
- /// The playlist identifiers ot the items.
+ /// The playlist identifiers of the items.
public IReadOnlyList PlaylistItemIds { get; }
///
diff --git a/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs b/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
index f49876cca4..3a7685f347 100644
--- a/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
+++ b/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
@@ -102,7 +102,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
}
///
- /// Appends new items to the playlist. The specified order is mantained.
+ /// Appends new items to the playlist. The specified order is maintained.
///
/// The items to add to the playlist.
public void Queue(IReadOnlyList items)
@@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
}
///
- /// Adds new items to the playlist right after the playing item. The specified order is mantained.
+ /// Adds new items to the playlist right after the playing item. The specified order is maintained.
///
/// The items to add to the playlist.
public void QueueNext(IReadOnlyList items)
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 77b97c9b48..7f301a9d8b 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -619,9 +619,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
Video3DFormat.HalfSideBySide => "crop=iw/2:ih:0:0,scale=(iw*2):ih,setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
// fsbs crop width in half,set the display aspect,crop out any black bars we may have made
Video3DFormat.FullSideBySide => "crop=iw/2:ih:0:0,setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
- // htab crop heigh in half,scale to correct size, set the display aspect,crop out any black bars we may have made
+ // htab crop height in half,scale to correct size, set the display aspect,crop out any black bars we may have made
Video3DFormat.HalfTopAndBottom => "crop=iw:ih/2:0:0,scale=(iw*2):ih),setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
- // ftab crop heigt in half, set the display aspect,crop out any black bars we may have made
+ // ftab crop height in half, set the display aspect,crop out any black bars we may have made
Video3DFormat.FullTopAndBottom => "crop=iw:ih/2:0:0,setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
_ => "scale=trunc(iw*sar):ih"
};
diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
index 47c36494bd..c32c1c108c 100644
--- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
+++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
@@ -157,7 +157,7 @@ namespace MediaBrowser.Model.Dlna
flagValue |= DlnaFlags.ByteBasedSeek;
}
- // Time based seek is curently disabled when streaming. On LG CX3 adding DlnaFlags.TimeBasedSeek and orgPn causes the DLNA playback to fail (format not supported). Further investigations are needed before enabling the remaining code paths.
+ // Time based seek is currently disabled when streaming. On LG CX3 adding DlnaFlags.TimeBasedSeek and orgPn causes the DLNA playback to fail (format not supported). Further investigations are needed before enabling the remaining code paths.
// else if (runtimeTicks.HasValue)
// {
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 094dc73b27..fdb84fa320 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -294,13 +294,13 @@ namespace MediaBrowser.Model.Dto
public NameGuidPair[] GenreItems { get; set; }
///
- /// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one.
+ /// Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one.
///
/// The parent logo item id.
public Guid? ParentLogoItemId { get; set; }
///
- /// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one.
+ /// Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one.
///
/// The parent backdrop item id.
public Guid? ParentBackdropItemId { get; set; }
@@ -506,7 +506,7 @@ namespace MediaBrowser.Model.Dto
public string ParentLogoImageTag { get; set; }
///
- /// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one.
+ /// Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one.
///
/// The parent art item id.
public Guid? ParentArtItemId { get; set; }
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index ae8f3b0edf..90a60cf470 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -606,7 +606,7 @@ namespace MediaBrowser.Model.Entities
<= 1024 when Height <= 576 => IsInterlaced ? "576i" : "576p",
// 1280x720
<= 1280 when Height <= 962 => IsInterlaced ? "720i" : "720p",
- // 2560x1080 (FHD ultra wide 21:9) using 1440px width to accomodate WQHD
+ // 2560x1080 (FHD ultra wide 21:9) using 1440px width to accommodate WQHD
<= 2560 when Height <= 1440 => IsInterlaced ? "1080i" : "1080p",
// 4K
<= 4096 when Height <= 3072 => "4K",
diff --git a/MediaBrowser.Model/SyncPlay/GroupStateType.cs b/MediaBrowser.Model/SyncPlay/GroupStateType.cs
index 7aa454f928..96364cacc7 100644
--- a/MediaBrowser.Model/SyncPlay/GroupStateType.cs
+++ b/MediaBrowser.Model/SyncPlay/GroupStateType.cs
@@ -11,7 +11,7 @@ namespace MediaBrowser.Model.SyncPlay
Idle = 0,
///
- /// The group is in wating state. Playback is paused. Will start playing when users are ready.
+ /// The group is in waiting state. Playback is paused. Will start playing when users are ready.
///
Waiting = 1,
diff --git a/MediaBrowser.Model/Tasks/ITaskManager.cs b/MediaBrowser.Model/Tasks/ITaskManager.cs
index a86bf2a1c8..13bebc479e 100644
--- a/MediaBrowser.Model/Tasks/ITaskManager.cs
+++ b/MediaBrowser.Model/Tasks/ITaskManager.cs
@@ -22,7 +22,7 @@ namespace MediaBrowser.Model.Tasks
///
/// Cancels if running and queue.
///
- /// An implementatin of .
+ /// An implementation of .
/// Task options.
void CancelIfRunningAndQueue(TaskOptions options)
where T : IScheduledTask;
@@ -30,21 +30,21 @@ namespace MediaBrowser.Model.Tasks
///
/// Cancels if running and queue.
///
- /// An implementatin of .
+ /// An implementation of .
void CancelIfRunningAndQueue()
where T : IScheduledTask;
///
/// Cancels if running.
///
- /// An implementatin of .
+ /// An implementation of .
void CancelIfRunning()
where T : IScheduledTask;
///
/// Queues the scheduled task.
///
- /// An implementatin of .
+ /// An implementation of .
/// Task options.
void QueueScheduledTask(TaskOptions options)
where T : IScheduledTask;
@@ -52,7 +52,7 @@ namespace MediaBrowser.Model.Tasks
///
/// Queues the scheduled task.
///
- /// An implementatin of .
+ /// An implementation of .
void QueueScheduledTask()
where T : IScheduledTask;
diff --git a/MediaBrowser.Model/Tasks/ITaskTrigger.cs b/MediaBrowser.Model/Tasks/ITaskTrigger.cs
index 8c3ec6626c..0536f4ef77 100644
--- a/MediaBrowser.Model/Tasks/ITaskTrigger.cs
+++ b/MediaBrowser.Model/Tasks/ITaskTrigger.cs
@@ -21,10 +21,10 @@ namespace MediaBrowser.Model.Tasks
///
/// Stars waiting for the trigger action.
///
- /// Result of the last run triggerd task.
+ /// Result of the last run triggered task.
/// The .
/// The name of the task.
- /// Wheter or not this is is fired during startup.
+ /// Whether or not this is is fired during startup.
void Start(TaskResult? lastResult, ILogger logger, string taskName, bool isApplicationStartup);
///
diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs
index 01ff473f0c..bbb33ddf0e 100644
--- a/MediaBrowser.Providers/Manager/ProviderManager.cs
+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs
@@ -926,7 +926,7 @@ namespace MediaBrowser.Providers.Manager
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error in {0}.Suports", i.GetType().Name);
+ _logger.LogError(ex, "Error in {0}.Supports", i.GetType().Name);
return false;
}
});
diff --git a/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs
index 4bf66c0988..915fb97fd2 100644
--- a/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs
+++ b/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs
@@ -36,7 +36,7 @@ namespace MediaBrowser.Providers.Music
///
/// The Jellyfin user-agent is unrestricted but source IP must not exceed
/// one request per second, therefore we rate limit to avoid throttling.
- /// Be prudent, use a value slightly above the minimun required.
+ /// Be prudent, use a value slightly above the minimum required.
/// https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting.
///
private readonly long _musicBrainzQueryIntervalMs;
diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
index 09ff84044d..da348239a1 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
@@ -1330,7 +1330,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
};
///
- /// Used to split names of comma or pipe delimeted genres and people.
+ /// Used to split names of comma or pipe delimited genres and people.
///
/// The value.
/// IEnumerable{System.String}.
diff --git a/src/Jellyfin.Extensions/SplitStringExtensions.cs b/src/Jellyfin.Extensions/SplitStringExtensions.cs
index 1d1c377f56..a4dc9fc6b1 100644
--- a/src/Jellyfin.Extensions/SplitStringExtensions.cs
+++ b/src/Jellyfin.Extensions/SplitStringExtensions.cs
@@ -55,7 +55,7 @@ namespace Jellyfin.Extensions
public static Enumerator Split(this ReadOnlySpan str, char separator) => new(str, separator);
///
- /// Provides an enumerator for the substrings seperated by the separator.
+ /// Provides an enumerator for the substrings separated by the separator.
///
[StructLayout(LayoutKind.Auto)]
public ref struct Enumerator
diff --git a/src/Jellyfin.Extensions/StringExtensions.cs b/src/Jellyfin.Extensions/StringExtensions.cs
index dadc9f1d5c..59fb038a75 100644
--- a/src/Jellyfin.Extensions/StringExtensions.cs
+++ b/src/Jellyfin.Extensions/StringExtensions.cs
@@ -40,7 +40,7 @@ namespace Jellyfin.Extensions
}
///
- /// Checks wether or not the specified string has diacritics in it.
+ /// Checks whether or not the specified string has diacritics in it.
///
/// The string to check.
/// True if the string has diacritics, false otherwise.
diff --git a/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs b/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs
index 6948280a3d..162f53e567 100644
--- a/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs
+++ b/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs
@@ -152,9 +152,9 @@ namespace Jellyfin.Model.Tests.Cryptography
[InlineData("$PBKDF2$$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Empty segment
[InlineData("$PBKDF2$iterations=1000$$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Empty salt segment
[InlineData("$PBKDF2$iterations=1000$69F420$")] // Empty hash segment
- [InlineData("$PBKDF2$=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parmeter
- [InlineData("$PBKDF2$=1000$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parmeter
- [InlineData("$PBKDF2$iterations=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parmeter
+ [InlineData("$PBKDF2$=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parameter
+ [InlineData("$PBKDF2$=1000$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parameter
+ [InlineData("$PBKDF2$iterations=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parameter
[InlineData("$PBKDF2$iterations=1000$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D$")] // Ends on $
[InlineData("$PBKDF2$iterations=1000$69F420$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D$")] // Extra segment
[InlineData("$PBKDF2$iterations=1000$69F420$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D$anotherone")] // Extra segment
diff --git a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
index 6b93974373..52b0e5a955 100644
--- a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
+++ b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
@@ -393,7 +393,7 @@ namespace Jellyfin.Networking.Tests
// User on external network, internal binding only - so assumption is a proxy forward, return external override.
[InlineData("jellyfin.org", "192.168.1.0/24", "eth16", false, "0.0.0.0=http://helloworld.com", "http://helloworld.com")]
- // User on external network, no binding - so result is the 1st external which is overriden.
+ // User on external network, no binding - so result is the 1st external which is overridden.
[InlineData("jellyfin.org", "192.168.1.0/24", "", false, "0.0.0.0 = http://helloworld.com", "http://helloworld.com")]
// User assumed to be internal, no binding - so result is the 1st internal.
diff --git a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
index 3b3e38bd1f..e1d2bb2d58 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
@@ -18,7 +18,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect
}
///
- /// /token reponse.
+ /// /token response.
///
[Fact]
public void Deserialize_Token_Response_Live_Success()
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json b/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json
index b766e668e3..fa8fbd8d2c 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json
+++ b/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json
@@ -253,7 +253,7 @@
"versions": [
{
"version": "5.0.0.0",
- "changelog": "Updated to use NextPVR API v5, no longer compatable with API v4.\n",
+ "changelog": "Updated to use NextPVR API v5, no longer compatible with API v4.\n",
"targetAbi": "10.7.0.0",
"sourceUrl": "https://repo.jellyfin.org/releases/plugin/nextpvr/nextpvr_5.0.0.0.zip",
"checksum": "d70f694d14bf9462ba2b2ebe110068d3",
From 05334275a918c80fad86180d99732732f24b63b6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 15 Aug 2022 12:01:13 +0000
Subject: [PATCH 013/262] Bump Swashbuckle.AspNetCore.ReDoc from 6.3.1 to 6.4.0
Bumps [Swashbuckle.AspNetCore.ReDoc](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.3.1 to 6.4.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.3.1...v6.4.0)
---
updated-dependencies:
- dependency-name: Swashbuckle.AspNetCore.ReDoc
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Api/Jellyfin.Api.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index 894d871383..ce01b415bb 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -20,7 +20,7 @@
-
+
From c3405d25fd969ddaf38958e2fe5e08a92f07c062 Mon Sep 17 00:00:00 2001
From: knackebrot
Date: Mon, 13 Jun 2022 00:51:08 +0200
Subject: [PATCH 014/262] Make IgnoreDts configurable for M3U tuner
---
Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs | 2 +-
MediaBrowser.Model/LiveTv/TunerHostInfo.cs | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
index 2a468e14dc..bcb42e1626 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
@@ -196,7 +196,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
IsInfiniteStream = true,
IsRemote = isRemote,
- IgnoreDts = true,
+ IgnoreDts = info.IgnoreDts,
SupportsDirectPlay = supportsDirectPlay,
SupportsDirectStream = supportsDirectStream,
diff --git a/MediaBrowser.Model/LiveTv/TunerHostInfo.cs b/MediaBrowser.Model/LiveTv/TunerHostInfo.cs
index 05576a0f8d..a832169c2a 100644
--- a/MediaBrowser.Model/LiveTv/TunerHostInfo.cs
+++ b/MediaBrowser.Model/LiveTv/TunerHostInfo.cs
@@ -8,6 +8,7 @@ namespace MediaBrowser.Model.LiveTv
public TunerHostInfo()
{
AllowHWTranscoding = true;
+ IgnoreDts = true;
}
public string Id { get; set; }
@@ -31,5 +32,7 @@ namespace MediaBrowser.Model.LiveTv
public int TunerCount { get; set; }
public string UserAgent { get; set; }
+
+ public bool IgnoreDts { get; set; }
}
}
From 5036afd69127cc6f6b0801329b2b04f21aee71f5 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Fri, 12 Aug 2022 20:37:31 +0200
Subject: [PATCH 015/262] Minor cleanup
---
.../AppBase/BaseConfigurationManager.cs | 12 ++-------
.../Attributes/HttpSubscribeAttribute.cs | 7 +----
.../Attributes/HttpUnsubscribeAttribute.cs | 7 +----
.../DisplayPreferencesController.cs | 7 ++---
Jellyfin.Drawing.Skia/SkiaEncoder.cs | 6 +++--
.../Users/DisplayPreferencesManager.cs | 2 +-
...linkFollowingPhysicalFileResultExecutor.cs | 11 ++------
.../ConfigurationUpdateEventArgs.cs | 27 +++++++++++++------
.../Configuration/IApplicationPaths.cs | 2 --
.../Entities/BasePluginFolder.cs | 4 +--
.../Entities/Extensions.cs | 8 +++---
.../IDisplayPreferencesManager.cs | 6 ++---
12 files changed, 39 insertions(+), 60 deletions(-)
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
index 2a4a8fb132..c42cec593a 100644
--- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
+++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
@@ -365,11 +365,7 @@ namespace Emby.Server.Implementations.AppBase
validatingStore.Validate(currentConfiguration, configuration);
}
- NamedConfigurationUpdating?.Invoke(this, new ConfigurationUpdateEventArgs
- {
- Key = key,
- NewConfiguration = configuration
- });
+ NamedConfigurationUpdating?.Invoke(this, new ConfigurationUpdateEventArgs(key, configuration));
_configurations.AddOrUpdate(key, configuration, (_, _) => configuration);
@@ -391,11 +387,7 @@ namespace Emby.Server.Implementations.AppBase
/// The old configuration.
protected virtual void OnNamedConfigurationUpdated(string key, object configuration)
{
- NamedConfigurationUpdated?.Invoke(this, new ConfigurationUpdateEventArgs
- {
- Key = key,
- NewConfiguration = configuration
- });
+ NamedConfigurationUpdated?.Invoke(this, new ConfigurationUpdateEventArgs(key, configuration));
}
///
diff --git a/Jellyfin.Api/Attributes/HttpSubscribeAttribute.cs b/Jellyfin.Api/Attributes/HttpSubscribeAttribute.cs
index af8727552c..7ac089a344 100644
--- a/Jellyfin.Api/Attributes/HttpSubscribeAttribute.cs
+++ b/Jellyfin.Api/Attributes/HttpSubscribeAttribute.cs
@@ -25,11 +25,6 @@ namespace Jellyfin.Api.Attributes
/// The route template. May not be null.
public HttpSubscribeAttribute(string template)
: base(_supportedMethods, template)
- {
- if (template == null)
- {
- throw new ArgumentNullException(nameof(template));
- }
- }
+ => ArgumentNullException.ThrowIfNull(template, nameof(template));
}
}
diff --git a/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs b/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs
index 1c0b70e719..16b3d08160 100644
--- a/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs
+++ b/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs
@@ -25,11 +25,6 @@ namespace Jellyfin.Api.Attributes
/// The route template. May not be null.
public HttpUnsubscribeAttribute(string template)
: base(_supportedMethods, template)
- {
- if (template == null)
- {
- throw new ArgumentNullException(nameof(template));
- }
- }
+ => ArgumentNullException.ThrowIfNull(template, nameof(template));
}
}
diff --git a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
index 27eb223390..64ee5680ce 100644
--- a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
+++ b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
@@ -89,12 +89,9 @@ namespace Jellyfin.Api.Controllers
// Load all custom display preferences
var customDisplayPreferences = _displayPreferencesManager.ListCustomItemDisplayPreferences(displayPreferences.UserId, itemId, displayPreferences.Client);
- if (customDisplayPreferences != null)
+ foreach (var (key, value) in customDisplayPreferences)
{
- foreach (var (key, value) in customDisplayPreferences)
- {
- dto.CustomPrefs.TryAdd(key, value);
- }
+ dto.CustomPrefs.TryAdd(key, value);
}
// This will essentially be a noop if no changes have been made, but new prefs must be saved at least.
diff --git a/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
index 6875282318..13f155f357 100644
--- a/Jellyfin.Drawing.Skia/SkiaEncoder.cs
+++ b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
@@ -145,9 +145,11 @@ namespace Jellyfin.Drawing.Skia
/// The file at the specified path could not be used to generate a codec.
public string GetImageBlurHash(int xComp, int yComp, string path)
{
- if (path == null)
+ ArgumentNullException.ThrowIfNull(path, nameof(path));
+
+ if (path.Length == 0)
{
- throw new ArgumentNullException(nameof(path));
+ throw new ArgumentException("String can't be empty", nameof(path));
}
var extension = Path.GetExtension(path.AsSpan()).TrimStart('.');
diff --git a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs
index f5d38db20f..65edb30ad2 100644
--- a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs
+++ b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs
@@ -79,7 +79,7 @@ namespace Jellyfin.Server.Implementations.Users
}
///
- public void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary customPreferences)
+ public void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary customPreferences)
{
var existingPrefs = _dbContext.CustomItemDisplayPreferences
.AsQueryable()
diff --git a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
index 7e7e4ca95b..28ed3894fd 100644
--- a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
+++ b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
@@ -69,15 +69,8 @@ namespace Jellyfin.Server.Infrastructure
///
protected override Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength)
{
- if (context == null)
- {
- throw new ArgumentNullException(nameof(context));
- }
-
- if (result == null)
- {
- throw new ArgumentNullException(nameof(result));
- }
+ ArgumentNullException.ThrowIfNull(context, nameof(context));
+ ArgumentNullException.ThrowIfNull(result, nameof(result));
if (range != null && rangeLength == 0)
{
diff --git a/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs b/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs
index 2df87d8792..90b1ff70c2 100644
--- a/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs
+++ b/MediaBrowser.Common/Configuration/ConfigurationUpdateEventArgs.cs
@@ -1,22 +1,33 @@
-#nullable disable
-#pragma warning disable CS1591
-
using System;
namespace MediaBrowser.Common.Configuration
{
+ ///
+ /// for the ConfigurationUpdated event.
+ ///
public class ConfigurationUpdateEventArgs : EventArgs
{
///
- /// Gets or sets the key.
+ /// Initializes a new instance of the class.
///
- /// The key.
- public string Key { get; set; }
+ /// The configuration key.
+ /// The new configuration.
+ public ConfigurationUpdateEventArgs(string key, object newConfiguration)
+ {
+ Key = key;
+ NewConfiguration = newConfiguration;
+ }
///
- /// Gets or sets the new configuration.
+ /// Gets the key.
+ ///
+ /// The key.
+ public string Key { get; }
+
+ ///
+ /// Gets the new configuration.
///
/// The new configuration.
- public object NewConfiguration { get; set; }
+ public object NewConfiguration { get; }
}
}
diff --git a/MediaBrowser.Common/Configuration/IApplicationPaths.cs b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
index 1370e6d79e..57c6546675 100644
--- a/MediaBrowser.Common/Configuration/IApplicationPaths.cs
+++ b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
namespace MediaBrowser.Common.Configuration
{
///
diff --git a/MediaBrowser.Controller/Entities/BasePluginFolder.cs b/MediaBrowser.Controller/Entities/BasePluginFolder.cs
index 272a37df1b..afafaf1c24 100644
--- a/MediaBrowser.Controller/Entities/BasePluginFolder.cs
+++ b/MediaBrowser.Controller/Entities/BasePluginFolder.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
#pragma warning disable CS1591
using System.Text.Json.Serialization;
@@ -13,7 +11,7 @@ namespace MediaBrowser.Controller.Entities
public abstract class BasePluginFolder : Folder, ICollectionFolder
{
[JsonIgnore]
- public virtual string CollectionType => null;
+ public virtual string? CollectionType => null;
[JsonIgnore]
public override bool SupportsInheritedParentImages => false;
diff --git a/MediaBrowser.Controller/Entities/Extensions.cs b/MediaBrowser.Controller/Entities/Extensions.cs
index 9ce8eebe34..14534aa50b 100644
--- a/MediaBrowser.Controller/Entities/Extensions.cs
+++ b/MediaBrowser.Controller/Entities/Extensions.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Linq;
using Jellyfin.Extensions;
@@ -19,9 +17,11 @@ namespace MediaBrowser.Controller.Entities
/// Trailer URL.
public static void AddTrailerUrl(this BaseItem item, string url)
{
- if (string.IsNullOrEmpty(url))
+ ArgumentNullException.ThrowIfNull(url, nameof(url));
+
+ if (url.Length == 0)
{
- throw new ArgumentNullException(nameof(url));
+ throw new ArgumentException("String can't be empty", nameof(url));
}
var current = item.RemoteTrailers.FirstOrDefault(i => string.Equals(i.Url, url, StringComparison.OrdinalIgnoreCase));
diff --git a/MediaBrowser.Controller/IDisplayPreferencesManager.cs b/MediaBrowser.Controller/IDisplayPreferencesManager.cs
index 1678d50675..10c0f56e09 100644
--- a/MediaBrowser.Controller/IDisplayPreferencesManager.cs
+++ b/MediaBrowser.Controller/IDisplayPreferencesManager.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Collections.Generic;
using Jellyfin.Data.Entities;
@@ -50,7 +48,7 @@ namespace MediaBrowser.Controller
/// The item id.
/// The client string.
/// The dictionary of custom item display preferences.
- Dictionary ListCustomItemDisplayPreferences(Guid userId, Guid itemId, string client);
+ Dictionary ListCustomItemDisplayPreferences(Guid userId, Guid itemId, string client);
///
/// Sets the custom item display preference for the user and client.
@@ -59,7 +57,7 @@ namespace MediaBrowser.Controller
/// The item id.
/// The client id.
/// A dictionary of custom item display preferences.
- void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary customPreferences);
+ void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary customPreferences);
///
/// Saves changes made to the database.
From cd01c563dfdf4262ceb16b990c4e40d680ef5457 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 22 Aug 2022 12:00:54 +0000
Subject: [PATCH 016/262] Bump SkiaSharp from 2.88.1-preview.79 to 2.88.1
Bumps [SkiaSharp](https://github.com/mono/SkiaSharp) from 2.88.1-preview.79 to 2.88.1.
- [Release notes](https://github.com/mono/SkiaSharp/releases)
- [Commits](https://github.com/mono/SkiaSharp/compare/v2.88.1-preview.79...v2.88.1)
---
updated-dependencies:
- dependency-name: SkiaSharp
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
index b64a842927..e2cdbb562a 100644
--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
@@ -18,7 +18,7 @@
-
+
From 7d48f97db9f6a5809a785417b834d47aa1cde896 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Mon, 22 Aug 2022 19:01:19 +0200
Subject: [PATCH 017/262] Fix regression in DlnaHttpClient
```
[18:53:50] [ERR] [25] Emby.Dlna.Main.DlnaEntryPoint: Error updating device info for 192.168.1.21 - Sonos Connect:Amp Berging
System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Http.StringContent'.
at System.Net.Http.HttpContent.CheckDisposed()
at System.Net.Http.HttpContent.CopyToAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendRequestContentAsync(HttpRequestMessage request, HttpContentWriteStream stream, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Emby.Dlna.PlayTo.DlnaHttpClient.SendRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /home/loma/dev/jellyfin/Emby.Dlna/PlayTo/DlnaHttpClient.cs:line 47
at Emby.Dlna.PlayTo.Device.GetTransportInfo(TransportCommands avCommands, CancellationToken cancellationToken) in /home/loma/dev/jellyfin/Emby.Dlna/PlayTo/Device.cs:line 705
at Emby.Dlna.PlayTo.Device.TimerCallback(Object sender) in /home/loma/dev/jellyfin/Emby.Dlna/PlayTo/Device.cs:line 521
```
---
Emby.Dlna/PlayTo/DlnaHttpClient.cs | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/Emby.Dlna/PlayTo/DlnaHttpClient.cs b/Emby.Dlna/PlayTo/DlnaHttpClient.cs
index 62156d1833..75ff542dd8 100644
--- a/Emby.Dlna/PlayTo/DlnaHttpClient.cs
+++ b/Emby.Dlna/PlayTo/DlnaHttpClient.cs
@@ -66,13 +66,15 @@ namespace Emby.Dlna.PlayTo
}
}
- public Task GetDataAsync(string url, CancellationToken cancellationToken)
+ public async Task GetDataAsync(string url, CancellationToken cancellationToken)
{
using var request = new HttpRequestMessage(HttpMethod.Get, url);
- return SendRequestAsync(request, cancellationToken);
+
+ // Have to await here instead of returning the Task directly, otherwise request would be disposed too soon
+ return await SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
}
- public Task SendCommandAsync(
+ public async Task SendCommandAsync(
string baseUrl,
DeviceService service,
string command,
@@ -99,7 +101,8 @@ namespace Emby.Dlna.PlayTo
request.Headers.TryAddWithoutValidation("contentFeatures.dlna.org", header);
}
- return SendRequestAsync(request, cancellationToken);
+ // Have to await here instead of returning the Task directly, otherwise request would be disposed too soon
+ return await SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
}
}
}
From d675a20540eed5d656ed40e245a2a736e421eb82 Mon Sep 17 00:00:00 2001
From: "Brian J. Murrell"
Date: Wed, 24 Aug 2022 17:20:05 -0400
Subject: [PATCH 018/262] JELLYFIN_NOWEBAPP_OPT is now --nowebclient
--noautorunwebapp has been renamed --nowebclient.
---
fedora/jellyfin.env | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fedora/jellyfin.env b/fedora/jellyfin.env
index 89cad1a2d3..1ccd8196fd 100644
--- a/fedora/jellyfin.env
+++ b/fedora/jellyfin.env
@@ -33,7 +33,7 @@ JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh"
#JELLYFIN_SERVICE_OPT="--service"
# [OPTIONAL] run Jellyfin without the web app
-#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp"
+#JELLYFIN_NOWEBAPP_OPT="--nowebclient"
# [OPTIONAL] run Jellyfin with ASP.NET Server Garbage Collection (uses more RAM and less CPU than Workstation GC)
# 0 = Workstation
From ab1913c49fcf98b8ce20ca7eff90f57142ff192a Mon Sep 17 00:00:00 2001
From: jan
Date: Wed, 24 Aug 2022 14:24:54 +0000
Subject: [PATCH 019/262] Translated using Weblate (Slovenian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sl/
---
Emby.Server.Implementations/Localization/Core/sl-SI.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/sl-SI.json b/Emby.Server.Implementations/Localization/Core/sl-SI.json
index 30b24e9f0d..b2d7ce11df 100644
--- a/Emby.Server.Implementations/Localization/Core/sl-SI.json
+++ b/Emby.Server.Implementations/Localization/Core/sl-SI.json
@@ -122,5 +122,6 @@
"TaskOptimizeDatabaseDescription": "Stisne bazo podatkov in uredi prazen prostor. Zagon tega opravila po iskanju predstavnosti ali drugih spremembah ki vplivajo na bazo podatkov lahko izboljša hitrost delovanja.",
"TaskOptimizeDatabase": "Optimiziraj bazo podatkov",
"TaskKeyframeExtractor": "Ekstraktor ključnih sličic",
- "External": "Zunanje"
+ "External": "Zunanji",
+ "TaskKeyframeExtractorDescription": "Iz video datoteke Izvleče ključne sličice, da ustvari bolj natančne sezname predvajanja HLS. Proces lahko traja dolgo časa."
}
From dd4af49962276e2d5d2d9b72911aa82347459305 Mon Sep 17 00:00:00 2001
From: Niels van Velzen
Date: Sat, 27 Aug 2022 14:19:47 +0200
Subject: [PATCH 020/262] Use Guid type for UserConfiguration fields
---
.../Users/UserManager.cs | 8 ++++----
.../Configuration/UserConfiguration.cs | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs
index 2100fa6d59..6a2ef74dd2 100644
--- a/Jellyfin.Server.Implementations/Users/UserManager.cs
+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs
@@ -326,10 +326,10 @@ namespace Jellyfin.Server.Implementations.Users
EnableNextEpisodeAutoPlay = user.EnableNextEpisodeAutoPlay,
RememberSubtitleSelections = user.RememberSubtitleSelections,
SubtitleLanguagePreference = user.SubtitleLanguagePreference ?? string.Empty,
- OrderedViews = user.GetPreference(PreferenceKind.OrderedViews),
- GroupedFolders = user.GetPreference(PreferenceKind.GroupedFolders),
- MyMediaExcludes = user.GetPreference(PreferenceKind.MyMediaExcludes),
- LatestItemsExcludes = user.GetPreference(PreferenceKind.LatestItemExcludes)
+ OrderedViews = user.GetPreferenceValues(PreferenceKind.OrderedViews),
+ GroupedFolders = user.GetPreferenceValues(PreferenceKind.GroupedFolders),
+ MyMediaExcludes = user.GetPreferenceValues(PreferenceKind.MyMediaExcludes),
+ LatestItemsExcludes = user.GetPreferenceValues(PreferenceKind.LatestItemExcludes)
},
Policy = new UserPolicy
{
diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs
index 81359462c3..94f3546608 100644
--- a/MediaBrowser.Model/Configuration/UserConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs
@@ -22,10 +22,10 @@ namespace MediaBrowser.Model.Configuration
HidePlayedInLatest = true;
PlayDefaultAudioTrack = true;
- LatestItemsExcludes = Array.Empty();
- OrderedViews = Array.Empty();
- MyMediaExcludes = Array.Empty();
- GroupedFolders = Array.Empty();
+ LatestItemsExcludes = Array.Empty();
+ OrderedViews = Array.Empty();
+ MyMediaExcludes = Array.Empty();
+ GroupedFolders = Array.Empty();
}
///
@@ -48,7 +48,7 @@ namespace MediaBrowser.Model.Configuration
public bool DisplayMissingEpisodes { get; set; }
- public string[] GroupedFolders { get; set; }
+ public Guid[] GroupedFolders { get; set; }
public SubtitlePlaybackMode SubtitleMode { get; set; }
@@ -56,11 +56,11 @@ namespace MediaBrowser.Model.Configuration
public bool EnableLocalPassword { get; set; }
- public string[] OrderedViews { get; set; }
+ public Guid[] OrderedViews { get; set; }
- public string[] LatestItemsExcludes { get; set; }
+ public Guid[] LatestItemsExcludes { get; set; }
- public string[] MyMediaExcludes { get; set; }
+ public Guid[] MyMediaExcludes { get; set; }
public bool HidePlayedInLatest { get; set; }
From 56a5db5706ebf6ad316e1120623f5398749188f7 Mon Sep 17 00:00:00 2001
From: Andreas Egli
Date: Sun, 28 Aug 2022 11:40:51 +0200
Subject: [PATCH 021/262] add TryParse to FFProbe Keyframe extraction
---
CONTRIBUTORS.md | 1 +
.../FfProbe/FfProbeKeyframeExtractor.cs | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 9c08929e78..98acd4449f 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -36,6 +36,7 @@
- [dmitrylyzo](https://github.com/dmitrylyzo)
- [DMouse10462](https://github.com/DMouse10462)
- [DrPandemic](https://github.com/DrPandemic)
+ - [eglia](https://github.com/eglia)
- [EraYaN](https://github.com/EraYaN)
- [escabe](https://github.com/escabe)
- [excelite](https://github.com/excelite)
diff --git a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
index 320604e101..60433048be 100644
--- a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
+++ b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
@@ -65,9 +65,11 @@ public static class FfProbeKeyframeExtractor
if (rest.EndsWith(",K_"))
{
// Trim the flags from the packet line. Example line: packet,7169.079000,K_
- var keyframe = double.Parse(rest[..^3], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture);
- // Have to manually convert to ticks to avoid rounding errors as TimeSpan is only precise down to 1 ms when converting double.
- keyframes.Add(Convert.ToInt64(keyframe * TimeSpan.TicksPerSecond));
+ if (double.TryParse(rest[..^3], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var keyframe))
+ {
+ // Have to manually convert to ticks to avoid rounding errors as TimeSpan is only precise down to 1 ms when converting double.
+ keyframes.Add(Convert.ToInt64(keyframe * TimeSpan.TicksPerSecond));
+ }
}
}
else if (lineType.Equals("stream", StringComparison.OrdinalIgnoreCase))
From 1528cb1e778ae5dd9ba10bccad67bd03e9ce3689 Mon Sep 17 00:00:00 2001
From: Andreas Egli
Date: Sun, 28 Aug 2022 15:53:28 +0200
Subject: [PATCH 022/262] add gentps flag to ffprobe for keyframe extraction
---
.../FfProbe/FfProbeKeyframeExtractor.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
index 60433048be..d26048874f 100644
--- a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
+++ b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
@@ -11,7 +11,7 @@ namespace Jellyfin.MediaEncoding.Keyframes.FfProbe;
///
public static class FfProbeKeyframeExtractor
{
- private const string DefaultArguments = "-v error -skip_frame nokey -show_entries format=duration -show_entries stream=duration -show_entries packet=pts_time,flags -select_streams v -of csv \"{0}\"";
+ private const string DefaultArguments = "-fflags +genpts -v error -skip_frame nokey -show_entries format=duration -show_entries stream=duration -show_entries packet=pts_time,flags -select_streams v -of csv \"{0}\"";
///
/// Extracts the keyframes using the ffprobe executable at the specified path.
From bd7898f18a8c06816bead2b5a52477eaf96c2406 Mon Sep 17 00:00:00 2001
From: Andreas Egli
Date: Sun, 28 Aug 2022 16:14:53 +0200
Subject: [PATCH 023/262] allow additional flags after K_ for ffprobe keyframe
extraction
---
.../FfProbe/FfProbeKeyframeExtractor.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
index d26048874f..cda3b4e8ed 100644
--- a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
+++ b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
@@ -62,10 +62,13 @@ public static class FfProbeKeyframeExtractor
var rest = line[(firstComma + 1)..];
if (lineType.Equals("packet", StringComparison.OrdinalIgnoreCase))
{
- if (rest.EndsWith(",K_"))
+ // Split time and flags from the packet line. Example line: packet,7169.079000,K_
+ var secondComma = rest.IndexOf(',');
+ var pts_time = rest[..secondComma];
+ var flags = rest[(secondComma + 1)..];
+ if (flags.StartsWith("K_"))
{
- // Trim the flags from the packet line. Example line: packet,7169.079000,K_
- if (double.TryParse(rest[..^3], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var keyframe))
+ if (double.TryParse(pts_time, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var keyframe))
{
// Have to manually convert to ticks to avoid rounding errors as TimeSpan is only precise down to 1 ms when converting double.
keyframes.Add(Convert.ToInt64(keyframe * TimeSpan.TicksPerSecond));
From 2f67ee141e97df7cf621c089e1aadd2af1a76289 Mon Sep 17 00:00:00 2001
From: Alan Azar
Date: Sat, 27 Aug 2022 16:20:20 +0000
Subject: [PATCH 024/262] Translated using Weblate (Burmese) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/my/
---
.../Localization/Core/my.json | 98 +++++++++----------
1 file changed, 49 insertions(+), 49 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/my.json b/Emby.Server.Implementations/Localization/Core/my.json
index 2642373fa9..198f7540c8 100644
--- a/Emby.Server.Implementations/Localization/Core/my.json
+++ b/Emby.Server.Implementations/Localization/Core/my.json
@@ -6,97 +6,97 @@
"Artists": "အနုပညာရှင်များ",
"Albums": "သီချင်းအခွေများ",
"TaskOptimizeDatabaseDescription": "ဒေတာဘေ့စ်ကို ကျစ်လစ်စေပြီး နေရာလွတ်များကို ဖြတ်တောက်ပေးသည်။ စာကြည့်တိုက်ကို စကင်န်ဖတ်ပြီးနောက် ဤလုပ်ငန်းကို လုပ်ဆောင်ခြင်း သို့မဟုတ် ဒေတာဘေ့စ်မွမ်းမံမှုများ စွမ်းဆောင်ရည်ကို မြှင့်တင်ပေးနိုင်သည်ဟု ရည်ညွှန်းသော အခြားပြောင်းလဲမှုများကို လုပ်ဆောင်ခြင်း။.",
- "TaskOptimizeDatabase": "ဒေတာဘေ့စ်ကို အကောင်းဆုံးဖြစ်အောင်လုပ်ပါ။",
+ "TaskOptimizeDatabase": "ဒေတာဘေ့စ်ကို အကောင်းဆုံးဖြစ်အောင်လုပ်ပါ",
"TaskDownloadMissingSubtitlesDescription": "မက်တာဒေတာ ဖွဲ့စည်းမှုပုံစံအပေါ် အခြေခံ၍ ပျောက်ဆုံးနေသော စာတန်းထိုးများအတွက် အင်တာနက်ကို ရှာဖွေသည်။",
- "TaskDownloadMissingSubtitles": "ပျောက်ဆုံးနေသော စာတန်းထိုးများကို ဒေါင်းလုဒ်လုပ်ပါ။",
+ "TaskDownloadMissingSubtitles": "ပျောက်ဆုံးနေသော စာတန်းထိုးများကို ဒေါင်းလုဒ်လုပ်ပါ",
"TaskRefreshChannelsDescription": "အင်တာနက်ချန်နယ်အချက်အလက်ကို ပြန်လည်စတင်သည်။",
- "TaskRefreshChannels": "ချန်နယ်များကို ပြန်လည်စတင်ပါ။",
+ "TaskRefreshChannels": "ချန်နယ်များကို ပြန်လည်စတင်ပါ",
"TaskCleanTranscodeDescription": "သက်တမ်း တစ်ရက်ထက်ပိုသော အသွင်ပြောင်းကုဒ်ဖိုင်များကို ဖျက်ပါ။",
- "TaskCleanTranscode": "Transcode လမ်းညွှန်ကို သန့်ရှင်းပါ။",
+ "TaskCleanTranscode": "Transcode လမ်းညွှန်ကို သန့်ရှင်းပါ",
"TaskUpdatePluginsDescription": "အလိုအလျောက် အပ်ဒိတ်လုပ်ရန် စီစဉ်ထားသော ပလပ်အင်များအတွက် အပ်ဒိတ်များကို ဒေါင်းလုဒ်လုပ်ပြီး ထည့်သွင်းပါ။",
- "TaskUpdatePlugins": "ပလပ်အင်များကို အပ်ဒိတ်လုပ်ပါ။",
+ "TaskUpdatePlugins": "ပလပ်အင်များကို အပ်ဒိတ်လုပ်ပါ",
"TaskRefreshPeopleDescription": "သင့်မီဒီယာစာကြည့်တိုက်ရှိ သရုပ်ဆောင်များနှင့် ဒါရိုက်တာများအတွက် မက်တာဒေတာကို အပ်ဒိတ်လုပ်ပါ။",
- "TaskRefreshPeople": "လူများကို ပြန်လည်ဆန်းသစ်ပါ။",
+ "TaskRefreshPeople": "လူများကို ပြန်လည်ဆန်းသစ်ပါ",
"TaskCleanLogsDescription": "{0} ရက်ထက်ပိုသော မှတ်တမ်းဖိုင်များကို ဖျက်သည်။",
- "TaskCleanLogs": "မှတ်တမ်းလမ်းညွှန်ကို သန့်ရှင်းပါ။",
+ "TaskCleanLogs": "မှတ်တမ်းလမ်းညွှန်ကို သန့်ရှင်းပါ",
"TaskRefreshLibraryDescription": "သင့်မီဒီယာဒစ်ဂျစ်တိုက်ကို ဖိုင်အသစ်များရှိမရှိ စကင်န်ဖတ်ပြီး ဖိုင်ရဲ့အကြောင်းအရာများ ကို ပြန်ပြုပြင်မွမ်းမံပါ။",
- "TaskRefreshLibrary": "မီဒီယာစာကြည့်တိုက်ကို စကင်န်ဖတ်ပါ။",
+ "TaskRefreshLibrary": "မီဒီယာစာကြည့်တိုက်ကို စကင်န်ဖတ်ပါ",
"TaskRefreshChapterImagesDescription": "အခန်းများပါရှိသော ဗီဒီယိုများအတွက် ပုံသေးများကို ဖန်တီးပါ။",
- "TaskRefreshChapterImages": "အခန်းတစ်ခုစီ ပုံများကို ထုတ်ယူပါ။",
+ "TaskRefreshChapterImages": "အခန်းတစ်ခုစီ ပုံများကို ထုတ်ယူပါ",
"TaskCleanCacheDescription": "စနစ်မှ မလိုအပ်တော့သော ကက်ရှ်ဖိုင်များကို ဖျက်ပါ။.",
- "TaskCleanCache": "Cache Directory ကို ရှင်းပါ။",
+ "TaskCleanCache": "Cache Directory ကို ရှင်းပါ",
"TaskCleanActivityLogDescription": "စီစဉ်သတ်မှတ်ထားသော အသက်ထက် ပိုကြီးသော လုပ်ဆောင်ချက်မှတ်တမ်းများကို ဖျက်ပါ။",
- "TaskCleanActivityLog": "လုပ်ဆောင်ချက်မှတ်တမ်းကို ရှင်းလင်းပါ။",
+ "TaskCleanActivityLog": "လုပ်ဆောင်ချက်မှတ်တမ်းကို ရှင်းလင်းပါ",
"TasksChannelsCategory": "အင်တာနက် ချန်နယ်လိုင်းများ",
"TasksApplicationCategory": "အပလီကေးရှင်း",
"TasksLibraryCategory": "မီဒီယာတိုက်",
"TasksMaintenanceCategory": "ပြုပြင် ထိန်းသိမ်းခြင်း",
"VersionNumber": "ဗားရှင်း {0}",
"ValueSpecialEpisodeName": "အထူး- {0}",
- "ValueHasBeenAddedToLibrary": "{0} ကို သင့်မီဒီယာဒစ်ဂျစ်တိုက်သို့ ပေါင်းထည့်လိုက်ပါပြီ။",
+ "ValueHasBeenAddedToLibrary": "{0} ကို သင့်မီဒီယာဒစ်ဂျစ်တိုက်သို့ ပေါင်းထည့်လိုက်ပါပြီ",
"UserStoppedPlayingItemWithValues": "{0} သည် {1} ကို {2} တွင် ဖွင့်ပြီးပါပြီ",
"UserStartedPlayingItemWithValues": "{0} သည် {1} ကို {2} တွင် ပြသနေသည်",
"UserPolicyUpdatedWithName": "{0} အတွက် အသုံးပြုသူမူဝါဒကို အပ်ဒိတ်လုပ်ပြီးပါပြီ",
"UserPasswordChangedWithName": "အသုံးပြုသူ {0} အတွက် စကားဝှက်ကို ပြောင်းထားသည်",
"UserOnlineFromDevice": "{0} သည် {1} မှ အွန်လိုင်းဖြစ်သည်",
"UserOfflineFromDevice": "{0} သည် {1} မှ ချိတ်ဆက်မှုပြတ်တောက်သွားသည်",
- "UserLockedOutWithName": "အသုံးပြုသူ {0} အား လော့ခ်ချထားသည်။",
+ "UserLockedOutWithName": "အသုံးပြုသူ {0} အား လော့ခ်ချထားသည်",
"UserDownloadingItemWithValues": "{0} သည် {1} ကို ဒေါင်းလုဒ်လုပ်နေသည်",
- "UserDeletedWithName": "အသုံးပြုသူ {0} ကို ဖျက်လိုက်ပါပြီ။",
- "UserCreatedWithName": "အသုံးပြုသူ {0} ကို ဖန်တီးပြီးပါပြီ။",
+ "UserDeletedWithName": "အသုံးပြုသူ {0} ကို ဖျက်လိုက်ပါပြီ",
+ "UserCreatedWithName": "အသုံးပြုသူ {0} ကို ဖန်တီးပြီးပါပြီ",
"User": "အသုံးပြုသူ",
"Undefined": "သတ်မှတ်မထားသော",
"TvShows": "တီဗီ ဇာတ်လမ်းတွဲများ",
"System": "စနစ်",
"Sync": "ထပ်တူကျသည်။",
- "SubtitleDownloadFailureFromForItem": "{1} အတွက် {0} မှ စာတန်းထိုးများ ဒေါင်းလုဒ်လုပ်ခြင်း မအောင်မြင်ပါ။",
+ "SubtitleDownloadFailureFromForItem": "{1} အတွက် {0} မှ စာတန်းထိုးများ ဒေါင်းလုဒ်လုပ်ခြင်း မအောင်မြင်ပါ",
"StartupEmbyServerIsLoading": "Jellyfin ဆာဗာကို အသင့်ပြင်နေပါသည်။ ခဏနေ ထပ်စမ်းကြည့်ပါ။",
"Songs": "သီချင်းများ",
"Shows": "ဇာတ်လမ်းတွဲများ",
- "ServerNameNeedsToBeRestarted": "{0} ကို ပြန်လည်စတင်ရန် လိုအပ်သည်။",
- "ScheduledTaskStartedWithName": "{0} စတင်ခဲ့သည်။",
- "ScheduledTaskFailedWithName": "{0} မအောင်မြင်ပါ။",
+ "ServerNameNeedsToBeRestarted": "{0} ကို ပြန်လည်စတင်ရန် လိုအပ်သည်",
+ "ScheduledTaskStartedWithName": "{0} စတင်ခဲ့သည်",
+ "ScheduledTaskFailedWithName": "{0} မအောင်မြင်ပါ",
"ProviderValue": "ဝန်ဆောင်မှုပေးသူ- {0}",
- "PluginUpdatedWithName": "ပလပ်ခ်အင် {0} ကို အပ်ဒိတ်လုပ်ထားသည်။",
- "PluginUninstalledWithName": "ပလပ်ခ်အင် {0} ကို ဖြုတ်လိုက်ပါပြီ။",
- "PluginInstalledWithName": "ပလပ်ခ်အင် {0} ကို ထည့်သွင်းခဲ့သည်။",
+ "PluginUpdatedWithName": "ပလပ်ခ်အင် {0} ကို အပ်ဒိတ်လုပ်ထားသည်",
+ "PluginUninstalledWithName": "ပလပ်ခ်အင် {0} ကို ဖြုတ်လိုက်ပါပြီ",
+ "PluginInstalledWithName": "ပလပ်ခ်အင် {0} ကို ထည့်သွင်းခဲ့သည်",
"Plugin": "ပလပ်အင်",
"Playlists": "အစီအစဉ်များ",
"Photos": "ဓာတ်ပုံများ",
- "NotificationOptionVideoPlaybackStopped": "ဗီဒီယိုဖွင့်ခြင်း ရပ်သွားသည်။",
- "NotificationOptionVideoPlayback": "ဗီဒီယိုဖွင့်ခြင်း စတင်ပါပြီ။",
- "NotificationOptionUserLockedOut": "အသုံးပြုသူ ဝင်ရန် တားမြစ်ခံရသည်။",
+ "NotificationOptionVideoPlaybackStopped": "ဗီဒီယိုဖွင့်ခြင်း ရပ်သွားသည်",
+ "NotificationOptionVideoPlayback": "ဗီဒီယိုဖွင့်ခြင်း စတင်ပါပြီ",
+ "NotificationOptionUserLockedOut": "အသုံးပြုသူ ဝင်ရန် တားမြစ်ခံရသည်",
"NotificationOptionTaskFailed": "စီစဉ်ထားသော အလုပ်ပျက်ကွက်",
- "NotificationOptionServerRestartRequired": "ဆာဗာ ပြန်လည်စတင်ရန် လိုအပ်သည်။",
- "NotificationOptionPluginUpdateInstalled": "ပလပ်အင် အပ်ဒိတ် ထည့်သွင်းပြီးပါပြီ။",
- "NotificationOptionPluginUninstalled": "ပလပ်အင်ကို ဖြုတ်လိုက်ပါပြီ။",
- "NotificationOptionPluginInstalled": "ပလပ်အင် ထည့်သွင်းထားသည်။",
- "NotificationOptionPluginError": "ပလပ်အင် ချို့ယွင်းခြင်း။",
- "NotificationOptionNewLibraryContent": "အသစ်များ ထပ်ထည့်ထားပါတယ်။",
- "NotificationOptionInstallationFailed": "ထည့်သွင်းမှု မအောင်မြင်ပါ။",
- "NotificationOptionCameraImageUploaded": "ကင်မရာမှ ဓာတ်ပုံ အပ်လုဒ် ပြီးပါပြီ။",
- "NotificationOptionAudioPlaybackStopped": "အသံဖိုင်ဖွင့်ခြင်း ရပ်သွားသည်။",
- "NotificationOptionAudioPlayback": "အသံဖွင့်ခြင်း စတင်ပါပြီ။",
- "NotificationOptionApplicationUpdateInstalled": "အပလီကေးရှင်း အပ်ဒိတ်ကို ထည့်သွင်းထားသည်။",
- "NotificationOptionApplicationUpdateAvailable": "အပလီကေးရှင်း အပ်ဒိတ် ရနိုင်ပါပြီ။",
+ "NotificationOptionServerRestartRequired": "ဆာဗာ ပြန်လည်စတင်ရန် လိုအပ်သည်",
+ "NotificationOptionPluginUpdateInstalled": "ပလပ်အင် အပ်ဒိတ် ထည့်သွင်းပြီးပါပြီ",
+ "NotificationOptionPluginUninstalled": "ပလပ်အင်ကို ဖြုတ်လိုက်ပါပြီ",
+ "NotificationOptionPluginInstalled": "ပလပ်အင် ထည့်သွင်းထားသည်",
+ "NotificationOptionPluginError": "ပလပ်အင် ချို့ယွင်းခြင်း",
+ "NotificationOptionNewLibraryContent": "အသစ်များ ထပ်ထည့်ထားပါတယ်",
+ "NotificationOptionInstallationFailed": "ထည့်သွင်းမှု မအောင်မြင်ပါ",
+ "NotificationOptionCameraImageUploaded": "ကင်မရာမှ ဓာတ်ပုံ အပ်လုဒ် ပြီးပါပြီ",
+ "NotificationOptionAudioPlaybackStopped": "အသံဖိုင်ဖွင့်ခြင်း ရပ်သွားသည်",
+ "NotificationOptionAudioPlayback": "အသံဖွင့်ခြင်း စတင်ပါပြီ",
+ "NotificationOptionApplicationUpdateInstalled": "အပလီကေးရှင်း အပ်ဒိတ်ကို ထည့်သွင်းထားသည်",
+ "NotificationOptionApplicationUpdateAvailable": "အပလီကေးရှင်း အပ်ဒိတ် ရနိုင်ပါပြီ",
"NewVersionIsAvailable": "Jellyfin Server ၏ ဗားရှင်းအသစ်ကို ဒေါင်းလုဒ်လုပ်နိုင်ပါပြီ။",
"NameSeasonUnknown": "ဇာတ်လမ်းတွဲ အပိုင်းမသိ",
"NameSeasonNumber": "ဇာတ်လမ်းတွဲ အပိုင်း {0}",
- "NameInstallFailed": "{0} ထည့်သွင်းမှု မအောင်မြင်ပါ။",
+ "NameInstallFailed": "{0} ထည့်သွင်းမှု မအောင်မြင်ပါ",
"MusicVideos": "ဂီတဗီဒီယိုများ",
"Music": "တေးဂီတ",
"Movies": "ရုပ်ရှင်များ",
"MixedContent": "ရောနှောပါဝင်မှု",
- "MessageServerConfigurationUpdated": "ဆာဗာဖွဲ့စည်းပုံကို အပ်ဒိတ်လုပ်ပြီးပါပြီ။",
- "MessageNamedServerConfigurationUpdatedWithValue": "ဆာဗာဖွဲ့စည်းပုံကဏ္ဍ {0} ကို အပ်ဒိတ်လုပ်ပြီးပါပြီ။",
+ "MessageServerConfigurationUpdated": "ဆာဗာဖွဲ့စည်းပုံကို အပ်ဒိတ်လုပ်ပြီးပါပြီ",
+ "MessageNamedServerConfigurationUpdatedWithValue": "ဆာဗာဖွဲ့စည်းပုံကဏ္ဍ {0} ကို အပ်ဒိတ်လုပ်ပြီးပါပြီ",
"MessageApplicationUpdatedTo": "Jellyfin ဆာဗာကို {0} သို့ အပ်ဒိတ်လုပ်ထားသည်",
- "MessageApplicationUpdated": "Jellyfin ဆာဗာကို အပ်ဒိတ်လုပ်ပြီးပါပြီ။",
+ "MessageApplicationUpdated": "Jellyfin ဆာဗာကို အပ်ဒိတ်လုပ်ပြီးပါပြီ",
"Latest": "နောက်ဆုံး",
"LabelRunningTimeValue": "ကြာချိန် - {0}",
"LabelIpAddressValue": "IP လိပ်စာ- {0}",
- "ItemRemovedWithName": "{0} ကို ဒစ်ဂျစ်တိုက်မှ ဖယ်ရှားခဲ့သည်။",
- "ItemAddedWithName": "{0} ကို စာကြည့်တိုက်သို့ ထည့်ထားသည်။",
- "Inherit": "ဆက်ခံ၍ လုပ်ဆောင်သည်။",
+ "ItemRemovedWithName": "{0} ကို ဒစ်ဂျစ်တိုက်မှ ဖယ်ရှားခဲ့သည်",
+ "ItemAddedWithName": "{0} ကို စာကြည့်တိုက်သို့ ထည့်ထားသည်",
+ "Inherit": "ဆက်ခံ၍ လုပ်ဆောင်သည်",
"HomeVideos": "ကိုယ်တိုင်ရိုက် ဗီဒီယိုများ",
"HeaderRecordingGroups": "အသံဖမ်းအဖွဲ့များ",
"HeaderNextUp": "နောက်ထပ်",
@@ -106,18 +106,18 @@
"HeaderFavoriteEpisodes": "အကြိုက်ဆုံး ဇာတ်လမ်းအပိုင်းများ",
"HeaderFavoriteArtists": "အကြိုက်ဆုံးအနုပညာရှင်များ",
"HeaderFavoriteAlbums": "အကြိုက်ဆုံး အယ်လ်ဘမ်များ",
- "HeaderContinueWatching": "ဆက်လက်ကြည့်ရှုပါ။",
+ "HeaderContinueWatching": "ဆက်လက်ကြည့်ရှုပါ",
"HeaderAlbumArtists": "အယ်လ်ဘမ်အနုပညာရှင်များ",
"Genres": "အမျိုးအစားများ",
"Forced": "အတင်းအကြပ်",
"Folders": "ဖိုလ်ဒါများ",
"Favorites": "အကြိုက်ဆုံးများ",
"FailedLoginAttemptWithUserName": "{0} မှ အကောင့်ဝင်ရန် မအောင်မြင်ပါ",
- "DeviceOnlineWithName": "{0} ကို ချိတ်ဆက်ထားသည်။",
- "DeviceOfflineWithName": "{0} နှင့် အဆက်ပြတ်သွားပါပြီ။",
+ "DeviceOnlineWithName": "{0} ကို ချိတ်ဆက်ထားသည်",
+ "DeviceOfflineWithName": "{0} နှင့် အဆက်ပြတ်သွားပါပြီ",
"ChapterNameValue": "အခန်း {0}",
- "CameraImageUploadedFrom": "ကင်မရာပုံအသစ်ကို {0} မှ ထည့်သွင်းလိုက်သည်။",
- "AuthenticationSucceededWithUserName": "{0} စစ်မှန်ကြောင်း အောင်မြင်စွာ အတည်ပြုပြီးပါပြီ။",
+ "CameraImageUploadedFrom": "ကင်မရာပုံအသစ်ကို {0} မှ ထည့်သွင်းလိုက်သည်",
+ "AuthenticationSucceededWithUserName": "{0} အောင်မြင်စွာ စစ်မှန်ကြောင်း အတည်ပြုပြီးပါပြီ",
"Application": "အပလီကေးရှင်း",
"AppDeviceValues": "အက်ပ်- {0}၊ စက်- {1}",
"External": "ပြင်ပ"
From 2b285b787408417b4ae1f8e3f364b2e5e0a66207 Mon Sep 17 00:00:00 2001
From: JinYi-Tsinghua <109143373+JinYi-Tsinghua@users.noreply.github.com>
Date: Mon, 29 Aug 2022 02:28:15 +0000
Subject: [PATCH 025/262] Add musl-linux-arm64 support in
azure-pipelines-package.yml
This is a supplement to pull request 8112
---
.ci/azure-pipelines-package.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.ci/azure-pipelines-package.yml b/.ci/azure-pipelines-package.yml
index 19d65ea0c1..926d1d3224 100644
--- a/.ci/azure-pipelines-package.yml
+++ b/.ci/azure-pipelines-package.yml
@@ -26,6 +26,8 @@ jobs:
BuildConfiguration: linux.amd64-musl
Linux.arm64:
BuildConfiguration: linux.arm64
+ Linux.musl-linux-arm64:
+ BuildConfiguration: linux.musl-linux-arm64
Linux.armhf:
BuildConfiguration: linux.armhf
Windows.amd64:
From 176e182629fe19dd4e889e0f47711e5f85ab458d Mon Sep 17 00:00:00 2001
From: nema imena
Date: Wed, 31 Aug 2022 15:01:40 +0000
Subject: [PATCH 026/262] Translated using Weblate (Serbian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sr/
---
Emby.Server.Implementations/Localization/Core/sr.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/sr.json b/Emby.Server.Implementations/Localization/Core/sr.json
index 781e93926e..1be8867f47 100644
--- a/Emby.Server.Implementations/Localization/Core/sr.json
+++ b/Emby.Server.Implementations/Localization/Core/sr.json
@@ -86,7 +86,7 @@
"Channels": "Канали",
"CameraImageUploadedFrom": "Нова фотографија је учитана са {0}",
"Books": "Књиге",
- "AuthenticationSucceededWithUserName": "{0} Успешна аутентикација",
+ "AuthenticationSucceededWithUserName": "{0} Успешна аутентификација",
"Artists": "Извођачи",
"Application": "Апликација",
"AppDeviceValues": "Апликација: {0}, Уређај: {1}",
@@ -118,7 +118,7 @@
"Undefined": "Недефинисано",
"Forced": "Принудно",
"Default": "Подразумевано",
- "TaskOptimizeDatabase": "Оптимизуј датабазу",
+ "TaskOptimizeDatabase": "Оптимизуј банку података",
"TaskOptimizeDatabaseDescription": "Сажима базу података и скраћује слободан простор. Покретање овог задатка након скенирања библиотеке или других промена које подразумевају измене базе података које могу побољшати перформансе.",
"External": "Спољно",
"TaskKeyframeExtractorDescription": "Екстрактује кљулне сличице из видео датотека да би креирао више преицзну HLS плеј-листу. Овај задатак може да потраје дуже време.",
From e9bb448e89f1e75d6571f6685fbefe360b47be78 Mon Sep 17 00:00:00 2001
From: Niels van Velzen
Date: Sun, 4 Sep 2022 10:12:58 +0200
Subject: [PATCH 027/262] Simplify UniversalAudioController code, remove
redundant null checks
---
.../Controllers/UniversalAudioController.cs | 89 +++++++------------
1 file changed, 31 insertions(+), 58 deletions(-)
diff --git a/Jellyfin.Api/Controllers/UniversalAudioController.cs b/Jellyfin.Api/Controllers/UniversalAudioController.cs
index 6fcafd426c..43b8e2414d 100644
--- a/Jellyfin.Api/Controllers/UniversalAudioController.cs
+++ b/Jellyfin.Api/Controllers/UniversalAudioController.cs
@@ -10,13 +10,11 @@ using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Api.Models.StreamingDtos;
using MediaBrowser.Common.Extensions;
-using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.MediaInfo;
-using MediaBrowser.Model.Session;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -31,7 +29,6 @@ namespace Jellyfin.Api.Controllers
public class UniversalAudioController : BaseJellyfinApiController
{
private readonly IAuthorizationContext _authorizationContext;
- private readonly IDeviceManager _deviceManager;
private readonly ILibraryManager _libraryManager;
private readonly ILogger _logger;
private readonly MediaInfoHelper _mediaInfoHelper;
@@ -42,7 +39,6 @@ namespace Jellyfin.Api.Controllers
/// Initializes a new instance of the class.
///
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
/// Instance of .
@@ -50,7 +46,6 @@ namespace Jellyfin.Api.Controllers
/// Instance of .
public UniversalAudioController(
IAuthorizationContext authorizationContext,
- IDeviceManager deviceManager,
ILibraryManager libraryManager,
ILogger logger,
MediaInfoHelper mediaInfoHelper,
@@ -58,7 +53,6 @@ namespace Jellyfin.Api.Controllers
DynamicHlsHelper dynamicHlsHelper)
{
_authorizationContext = authorizationContext;
- _deviceManager = deviceManager;
_libraryManager = libraryManager;
_logger = logger;
_mediaInfoHelper = mediaInfoHelper;
@@ -123,70 +117,49 @@ namespace Jellyfin.Api.Controllers
_logger.LogInformation("GetPostedPlaybackInfo profile: {@Profile}", deviceProfile);
- if (deviceProfile == null)
- {
- var clientCapabilities = _deviceManager.GetCapabilities(authInfo.DeviceId);
- if (clientCapabilities != null)
- {
- deviceProfile = clientCapabilities.DeviceProfile;
- }
- }
-
var info = await _mediaInfoHelper.GetPlaybackInfo(
itemId,
userId,
mediaSourceId)
.ConfigureAwait(false);
- if (deviceProfile != null)
+ // set device specific data
+ var item = _libraryManager.GetItemById(itemId);
+
+ foreach (var sourceInfo in info.MediaSources)
{
- // set device specific data
- var item = _libraryManager.GetItemById(itemId);
-
- foreach (var sourceInfo in info.MediaSources)
- {
- _mediaInfoHelper.SetDeviceSpecificData(
- item,
- sourceInfo,
- deviceProfile,
- authInfo,
- maxStreamingBitrate ?? deviceProfile.MaxStreamingBitrate,
- startTimeTicks ?? 0,
- mediaSourceId ?? string.Empty,
- null,
- null,
- maxAudioChannels,
- info.PlaySessionId!,
- userId ?? Guid.Empty,
- true,
- true,
- true,
- true,
- true,
- Request.HttpContext.GetNormalizedRemoteIp());
- }
-
- _mediaInfoHelper.SortMediaSources(info, maxStreamingBitrate);
+ _mediaInfoHelper.SetDeviceSpecificData(
+ item,
+ sourceInfo,
+ deviceProfile,
+ authInfo,
+ maxStreamingBitrate ?? deviceProfile.MaxStreamingBitrate,
+ startTimeTicks ?? 0,
+ mediaSourceId ?? string.Empty,
+ null,
+ null,
+ maxAudioChannels,
+ info.PlaySessionId!,
+ userId ?? Guid.Empty,
+ true,
+ true,
+ true,
+ true,
+ true,
+ Request.HttpContext.GetNormalizedRemoteIp());
}
- if (info.MediaSources != null)
+ _mediaInfoHelper.SortMediaSources(info, maxStreamingBitrate);
+
+ foreach (var source in info.MediaSources)
{
- foreach (var source in info.MediaSources)
- {
- _mediaInfoHelper.NormalizeMediaSourceContainer(source, deviceProfile!, DlnaProfileType.Video);
- }
+ _mediaInfoHelper.NormalizeMediaSourceContainer(source, deviceProfile, DlnaProfileType.Video);
}
- var mediaSource = info.MediaSources![0];
- if (mediaSource.SupportsDirectPlay && mediaSource.Protocol == MediaProtocol.Http)
+ var mediaSource = info.MediaSources[0];
+ if (mediaSource.SupportsDirectPlay && mediaSource.Protocol == MediaProtocol.Http && enableRedirection && mediaSource.IsRemote && enableRemoteMedia.HasValue && enableRemoteMedia.Value)
{
- if (enableRedirection)
- {
- if (mediaSource.IsRemote && enableRemoteMedia.HasValue && enableRemoteMedia.Value)
- {
- return Redirect(mediaSource.Path);
- }
- }
+ return Redirect(mediaSource.Path);
}
var isStatic = mediaSource.SupportsDirectStream;
@@ -249,7 +222,7 @@ namespace Jellyfin.Api.Controllers
BreakOnNonKeyFrames = breakOnNonKeyFrames,
AudioSampleRate = maxAudioSampleRate,
MaxAudioChannels = maxAudioChannels,
- AudioBitRate = isStatic ? (int?)null : (audioBitRate ?? maxStreamingBitrate),
+ AudioBitRate = isStatic ? null : (audioBitRate ?? maxStreamingBitrate),
MaxAudioBitDepth = maxAudioBitDepth,
AudioChannels = maxAudioChannels,
CopyTimestamps = true,
From 49e56c147ec3c1318e727a34ed916f2a4d4032d0 Mon Sep 17 00:00:00 2001
From: Niels van Velzen
Date: Sun, 4 Sep 2022 10:21:21 +0200
Subject: [PATCH 028/262] Fix QuickConnect operation names
---
Jellyfin.Api/Controllers/QuickConnectController.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Jellyfin.Api/Controllers/QuickConnectController.cs b/Jellyfin.Api/Controllers/QuickConnectController.cs
index 87b78fe93f..1df26355f0 100644
--- a/Jellyfin.Api/Controllers/QuickConnectController.cs
+++ b/Jellyfin.Api/Controllers/QuickConnectController.cs
@@ -39,7 +39,7 @@ namespace Jellyfin.Api.Controllers
/// Whether Quick Connect is enabled on the server or not.
[HttpGet("Enabled")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public ActionResult GetEnabled()
+ public ActionResult GetQuickConnectEnabled()
{
return _quickConnect.IsEnabled;
}
@@ -52,7 +52,7 @@ namespace Jellyfin.Api.Controllers
/// A with a secret and code for future use or an error message.
[HttpGet("Initiate")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public async Task> Initiate()
+ public async Task> InitiateQuickConnect()
{
try
{
@@ -75,7 +75,7 @@ namespace Jellyfin.Api.Controllers
[HttpGet("Connect")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
- public ActionResult Connect([FromQuery, Required] string secret)
+ public ActionResult GetQuickConnectState([FromQuery, Required] string secret)
{
try
{
@@ -102,7 +102,7 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
- public async Task> Authorize([FromQuery, Required] string code)
+ public async Task> AuthorizeQuickConnect([FromQuery, Required] string code)
{
var userId = ClaimHelpers.GetUserId(Request.HttpContext.User);
if (!userId.HasValue)
From 7c98f436416aa7cb838217ff452037aa1658b04f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 5 Sep 2022 15:52:11 +0000
Subject: [PATCH 029/262] Bump SQLitePCLRaw.bundle_e_sqlite3 from 2.1.0 to
2.1.1
Bumps [SQLitePCLRaw.bundle_e_sqlite3](https://github.com/ericsink/SQLitePCL.raw) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/ericsink/SQLitePCL.raw/releases)
- [Commits](https://github.com/ericsink/SQLitePCL.raw/commits)
---
updated-dependencies:
- dependency-name: SQLitePCLRaw.bundle_e_sqlite3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Server/Jellyfin.Server.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index e6bc3fe2b9..4474a6d122 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -48,7 +48,7 @@
-
+
From a0f873692e0f612012e1276c55a8cf610e78d045 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 5 Sep 2022 15:52:18 +0000
Subject: [PATCH 030/262] Bump Microsoft.NET.Test.Sdk from 17.2.0 to 17.3.1
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.2.0 to 17.3.1.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v17.2.0...v17.3.1)
---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj | 2 +-
.../Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj | 2 +-
tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj | 2 +-
.../Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Hls.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Keyframes.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Tests.csproj | 2 +-
tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj | 2 +-
tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj | 2 +-
.../Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj | 2 +-
tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj | 2 +-
.../Jellyfin.Server.Implementations.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
.../Jellyfin.XbmcMetadata.Tests.csproj | 2 +-
16 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index 3e610ced91..262ef80247 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -17,7 +17,7 @@
-
+
all
diff --git a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
index 82d7529019..fec70c0e05 100644
--- a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
+++ b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
diff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
index da52b93fc8..4eac60897d 100644
--- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
+++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
index a7ad79def5..5797648a82 100644
--- a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
+++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj
index 9f0f1c4de0..dfe7655837 100644
--- a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj
+++ b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj
@@ -7,7 +7,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
index 21206fb718..6d4dfd09fe 100644
--- a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
@@ -7,7 +7,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
index 67fb00b1c0..3f49a52880 100644
--- a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
@@ -8,7 +8,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
index 3da515bfc8..0e0f0490be 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
index ad3cca77aa..6edfbd50fc 100644
--- a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
+++ b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
index 04c69b130f..d4037c0245 100644
--- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
+++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
index 8e5cbb282e..909c14d0b2 100644
--- a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
+++ b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
diff --git a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
index 7bbd21048f..2dac3dfb11 100644
--- a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
+++ b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
index 086da7f430..49ab03c007 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
+++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index 9d6776b072..fdab02d7b8 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -11,7 +11,7 @@
-
+
all
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index f19e330615..4b11dc1bcb 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
index f3a3058ec3..d3119771d4 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
@@ -13,7 +13,7 @@
-
+
From 2251e7d603926d371e9e604142d2a5634684f5b6 Mon Sep 17 00:00:00 2001
From: Andreas Egli
Date: Tue, 6 Sep 2022 07:41:27 +0200
Subject: [PATCH 031/262] change variable to camelCase
---
.../FfProbe/FfProbeKeyframeExtractor.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
index cda3b4e8ed..79aa8a3549 100644
--- a/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
+++ b/src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs
@@ -64,11 +64,11 @@ public static class FfProbeKeyframeExtractor
{
// Split time and flags from the packet line. Example line: packet,7169.079000,K_
var secondComma = rest.IndexOf(',');
- var pts_time = rest[..secondComma];
+ var ptsTime = rest[..secondComma];
var flags = rest[(secondComma + 1)..];
if (flags.StartsWith("K_"))
{
- if (double.TryParse(pts_time, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var keyframe))
+ if (double.TryParse(ptsTime, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var keyframe))
{
// Have to manually convert to ticks to avoid rounding errors as TimeSpan is only precise down to 1 ms when converting double.
keyframes.Add(Convert.ToInt64(keyframe * TimeSpan.TicksPerSecond));
From faadbbce00bb9b26568a542c4483f81a24427958 Mon Sep 17 00:00:00 2001
From: Kristijan Fremen Velkovski
Date: Tue, 6 Sep 2022 01:32:39 +0000
Subject: [PATCH 032/262] Translated using Weblate (Macedonian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/mk/
---
.../Localization/Core/mk.json | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/mk.json b/Emby.Server.Implementations/Localization/Core/mk.json
index 279734c5ee..3483a7f0cc 100644
--- a/Emby.Server.Implementations/Localization/Core/mk.json
+++ b/Emby.Server.Implementations/Localization/Core/mk.json
@@ -66,7 +66,7 @@
"AuthenticationSucceededWithUserName": "{0} успешно поврзан",
"Artists": "Изведувач",
"Application": "Апликација",
- "AppDeviceValues": "Аплиакција: {0}, Уред: {1}",
+ "AppDeviceValues": "Апликација: {0}, Уред: {1}",
"Albums": "Албуми",
"VersionNumber": "Верзија {0}",
"ValueSpecialEpisodeName": "Специјално - {0}",
@@ -100,5 +100,27 @@
"TasksMaintenanceCategory": "Одржување",
"Undefined": "Недефинирано",
"Forced": "Принудно",
- "Default": "Зададено"
+ "Default": "Зададено",
+ "TaskKeyframeExtractorDescription": "Извлекува клучни рамки од видео фајлови за да се направат попрецизни HLS плејлисти. Оваа задача може да работи многу долго време.",
+ "TaskKeyframeExtractor": "Извлекувач на клучни рамки",
+ "TaskOptimizeDatabaseDescription": "Компактира датабазата и смалува празното место. Извршувањето на оваа задача по скенирање на библиотеката или правење други промени што прават модификации на датабазата може да подобри перформансите.",
+ "TaskOptimizeDatabase": "Оптимизирај датабаза",
+ "TaskDownloadMissingSubtitlesDescription": "Пребарува интернет за преводи што недостиваат според метадата конфигурација.",
+ "TaskDownloadMissingSubtitles": "Симни преводи што недостигаат",
+ "TaskRefreshChannelsDescription": "Ажурирај информации за интернет канали.",
+ "TaskRefreshChannels": "Ажурирај Канали",
+ "TaskCleanTranscodeDescription": "Избриши транскодирани фајлови постари од еден ден.",
+ "TaskCleanTranscode": "Исчисти Директориум за Транскодирање",
+ "TaskUpdatePluginsDescription": "Симни и инсталирај ажурирања за плагини што се конфигурирани за автоматско ажурирање.",
+ "TaskUpdatePlugins": "Ажурирај Плагини",
+ "TaskRefreshPeopleDescription": "Ажурирај метадата за акери и директори во вашата медиска библиотека.",
+ "TaskRefreshPeople": "Ажурирајте ги Луѓето",
+ "TaskCleanLogsDescription": "Избриши лог фајлови постари од {0} денови.",
+ "TaskCleanLogs": "Избриши Директориум на Логови",
+ "TaskRefreshLibraryDescription": "Скенирајте ја вашата медиска библиотека за нови фајлови и ажурирај метадата.",
+ "TaskRefreshLibrary": "Скенирај Медиумска Библиотека",
+ "TaskRefreshChapterImagesDescription": "Создава тамбнеил за видеата шти имаат поглавја.",
+ "TaskCleanActivityLogDescription": "Избришува логови на активности постари од определеното време.",
+ "TaskCleanActivityLog": "Избриши Лог на Активности",
+ "External": "Надворешен"
}
From 58d5827dfea221f490826d19e3f86163d26b7bca Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Thu, 8 Sep 2022 20:43:06 -0600
Subject: [PATCH 033/262] Fix musl permissions
---
deployment/build.linux.musl-linux-arm64 | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 deployment/build.linux.musl-linux-arm64
diff --git a/deployment/build.linux.musl-linux-arm64 b/deployment/build.linux.musl-linux-arm64
old mode 100644
new mode 100755
From 5a2f5609c09c8832972f8e4371425df6e32009a1 Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Thu, 8 Sep 2022 21:19:40 -0600
Subject: [PATCH 034/262] Fix musl publish command
---
deployment/build.linux.musl-linux-arm64 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/deployment/build.linux.musl-linux-arm64 b/deployment/build.linux.musl-linux-arm64
index e1ccbc266e..38826ae7fc 100755
--- a/deployment/build.linux.musl-linux-arm64
+++ b/deployment/build.linux.musl-linux-arm64
@@ -16,7 +16,7 @@ else
fi
# Build archives
-dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-musl-arm64 --output dist/jellyfin-server_${version}/ "-p:DebugSymbols=false;DebugType=none;UseAppHost=true"
+dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-musl-arm64 --output dist/jellyfin-server_${version}/ -p:DebugSymbols=false -p:DebugType=none -p:UseAppHost=true
tar -czf jellyfin-server_${version}_linux-arm64-musl.tar.gz -C dist jellyfin-server_${version}
rm -rf dist/jellyfin-server_${version}
From 1be9eb13ef9e466df30dff5626b7b378a4ec96c7 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 9 Sep 2022 10:49:52 +0000
Subject: [PATCH 035/262] Bump Moq from 4.18.1 to 4.18.2
Bumps [Moq](https://github.com/moq/moq4) from 4.18.1 to 4.18.2.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/main/CHANGELOG.md)
- [Commits](https://github.com/moq/moq4/compare/v4.18.1...v4.18.2)
---
updated-dependencies:
- dependency-name: Moq
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
.../Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj | 2 +-
tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Tests.csproj | 2 +-
tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj | 2 +-
tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj | 2 +-
.../Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj | 2 +-
tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj | 2 +-
.../Jellyfin.Server.Implementations.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
.../Jellyfin.XbmcMetadata.Tests.csproj | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index 262ef80247..8bd769fa06 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -24,7 +24,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
index 4eac60897d..a8ee16a12f 100644
--- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
+++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
index 5797648a82..a79ab08c87 100644
--- a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
+++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
@@ -8,7 +8,7 @@
-
+
all
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
index 0e0f0490be..b0443b5f87 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
@@ -23,7 +23,7 @@
-
+
all
diff --git a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
index 6edfbd50fc..e68253c46e 100644
--- a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
+++ b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
@@ -8,7 +8,7 @@
-
+
all
diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
index d4037c0245..02fc118144 100644
--- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
+++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
diff --git a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
index 909c14d0b2..c260e90ca1 100644
--- a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
+++ b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
index 2dac3dfb11..69963bbc9d 100644
--- a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
+++ b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
@@ -14,7 +14,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
index 49ab03c007..f2325f247d 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
+++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
@@ -22,7 +22,7 @@
-
+
all
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index fdab02d7b8..b6676d2f7d 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index 4b11dc1bcb..c6fff12ff5 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -19,7 +19,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
index d3119771d4..ca58031d9a 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
@@ -14,7 +14,7 @@
-
+
all
From 5f8477ba4749daff7d7779f524a67508fd840ca5 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Fri, 9 Sep 2022 13:36:27 +0200
Subject: [PATCH 036/262] Make Password Reset case sensitive
---
.../Users/DefaultPasswordResetProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs
index 5e84255f91..4fda8f5a41 100644
--- a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs
+++ b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs
@@ -67,7 +67,7 @@ namespace Jellyfin.Server.Implementations.Users
else if (string.Equals(
spr.Pin.Replace("-", string.Empty, StringComparison.Ordinal),
pin.Replace("-", string.Empty, StringComparison.Ordinal),
- StringComparison.OrdinalIgnoreCase))
+ StringComparison.Ordinal))
{
var resetUser = userManager.GetUserByName(spr.UserName)
?? throw new ResourceNotFoundException($"User with a username of {spr.UserName} not found");
From 6076df1b50bcd0a38f5b2bcd22b627e8686a1553 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 9 Sep 2022 13:40:13 +0000
Subject: [PATCH 037/262] Bump SkiaSharp.NativeAssets.Linux from
2.88.1-preview.79 to 2.88.2
Bumps [SkiaSharp.NativeAssets.Linux](https://github.com/mono/SkiaSharp) from 2.88.1-preview.79 to 2.88.2.
- [Release notes](https://github.com/mono/SkiaSharp/releases)
- [Commits](https://github.com/mono/SkiaSharp/compare/v2.88.1-preview.79...v2.88.2)
---
updated-dependencies:
- dependency-name: SkiaSharp.NativeAssets.Linux
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
index e2cdbb562a..e3c04afaab 100644
--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
@@ -19,7 +19,7 @@
-
+
From b8cd50b0f1434b8b824356255e884a6982bcab8a Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Fri, 9 Sep 2022 07:40:55 -0600
Subject: [PATCH 038/262] Update Jellyfin.Drawing.Skia.csproj
---
Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
index e3c04afaab..cbbeee024e 100644
--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
@@ -18,7 +18,7 @@
-
+
From 62ef93e2cebd9dd4318808e93ad4bf64b8ec89a6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 8 Aug 2022 12:00:59 +0000
Subject: [PATCH 039/262] Bump xunit from 2.4.1 to 2.4.2
Bumps [xunit](https://github.com/xunit/xunit) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/xunit/xunit/releases)
- [Commits](https://github.com/xunit/xunit/compare/2.4.1...2.4.2)
---
updated-dependencies:
- dependency-name: xunit
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj | 2 +-
.../Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj | 2 +-
tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Hls.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Keyframes.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Tests.csproj | 2 +-
tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj | 2 +-
tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj | 2 +-
.../Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj | 2 +-
tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj | 2 +-
.../Jellyfin.Server.Implementations.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
.../Jellyfin.XbmcMetadata.Tests.csproj | 2 +-
15 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index 8bd769fa06..97a549943d 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -18,7 +18,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
index fec70c0e05..77cdcfadab 100644
--- a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
+++ b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
index a8ee16a12f..1496bc80c9 100644
--- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
+++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
@@ -14,7 +14,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
index a79ab08c87..f450936f2f 100644
--- a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
+++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
@@ -9,7 +9,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
index 6d4dfd09fe..dae7722c34 100644
--- a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
@@ -8,7 +8,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
index 3f49a52880..ea4788cb87 100644
--- a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
@@ -9,7 +9,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
index b0443b5f87..5914eea47e 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
@@ -24,7 +24,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
index e68253c46e..cef719cbd5 100644
--- a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
+++ b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
@@ -9,7 +9,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
index 02fc118144..a630ace154 100644
--- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
+++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
@@ -14,7 +14,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
index c260e90ca1..75f0e688c6 100644
--- a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
+++ b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
index 69963bbc9d..465ea6b944 100644
--- a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
+++ b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
@@ -15,7 +15,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
index f2325f247d..27390c9379 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
+++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
@@ -23,7 +23,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index b6676d2f7d..2be523a808 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index c6fff12ff5..e69f1f0e0d 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
index ca58031d9a..53921cb6ed 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
@@ -15,7 +15,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
From 6004060b4ea6e68280c5d2e28799bb91fbc4f38e Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Sun, 14 Aug 2022 11:20:01 -0600
Subject: [PATCH 040/262] Fix build errors from new warnings
---
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 2 +-
.../DefaultAuthorizationHandlerTests.cs | 2 +-
.../ModelBinders/CommaDelimitedArrayModelBinderTests.cs | 8 ++++++--
.../ModelBinders/PipeDelimitedArrayModelBinderTests.cs | 8 ++++++--
.../Json/Converters/JsonStringConverterTests.cs | 2 +-
.../Playlist/DynamicHlsPlaylistGeneratorTests.cs | 4 ++--
.../Subtitles/SubtitleEncoderTests.cs | 2 +-
.../Drawing/ImageFormatExtensionsTests.cs | 2 +-
.../Manager/ItemImageProviderTests.cs | 2 +-
.../Manager/MetadataServiceTests.cs | 2 +-
.../MediaInfo/MediaInfoResolverTests.cs | 2 +-
.../MediaInfo/VideoImageProviderTests.cs | 2 +-
.../Sorting/IndexNumberComparerTests.cs | 2 +-
.../Sorting/ParentIndexNumberComparerTests.cs | 2 +-
.../Controllers/DashboardControllerTests.cs | 1 +
.../Controllers/StartupControllerTests.cs | 8 ++++++--
.../Controllers/UserControllerTests.cs | 2 ++
17 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 8e1acc46c9..115f085ff8 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -746,7 +746,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
- internal readonly struct SubtitleInfo
+ public readonly struct SubtitleInfo
{
public SubtitleInfo(string path, MediaProtocol protocol, string format, bool isExternal)
{
diff --git a/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs b/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs
index 23c51999fa..7c85ddd620 100644
--- a/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs
+++ b/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs
@@ -62,7 +62,7 @@ namespace Jellyfin.Api.Tests.Auth.DefaultAuthorizationPolicy
}
}
- private static TheoryData> GetParts_ValidAuthHeader_Success_Data()
+ public static TheoryData> GetParts_ValidAuthHeader_Success_Data()
{
var data = new TheoryData>();
diff --git a/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs b/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs
index 3ae6ae5bdd..e37c9d91f3 100644
--- a/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs
+++ b/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs
@@ -192,7 +192,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Empty((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Empty(listResult);
}
[Fact]
@@ -220,7 +222,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Single((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Single(listResult);
}
}
}
diff --git a/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs b/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs
index 938d19a154..7c05ee0362 100644
--- a/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs
+++ b/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs
@@ -192,7 +192,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Empty((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Empty(listResult);
}
[Fact]
@@ -220,7 +222,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Single((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Single(listResult);
}
}
}
diff --git a/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs b/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs
index 345f37cbe0..77717af703 100644
--- a/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs
+++ b/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs
@@ -32,7 +32,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
const string? input = "123";
const int output = 123;
var deserialized = JsonSerializer.Deserialize(input, _jsonSerializerOptions);
- Assert.Equal(deserialized, output);
+ Assert.Equal(output, deserialized);
}
}
}
diff --git a/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs b/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs
index 79648c4f6e..bbacdcd629 100644
--- a/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs
@@ -53,7 +53,7 @@ namespace Jellyfin.MediaEncoding.Hls.Tests.Playlist
Assert.False(DynamicHlsPlaylistGenerator.IsExtractionAllowedForFile(filePath, allowedExtensions));
}
- private static TheoryData ComputeEqualLengthSegments_Valid_Success_Data()
+ public static TheoryData ComputeEqualLengthSegments_Valid_Success_Data()
{
var data = new TheoryData
{
@@ -67,7 +67,7 @@ namespace Jellyfin.MediaEncoding.Hls.Tests.Playlist
return data;
}
- private static TheoryData ComputeSegments_Valid_Success_Data()
+ public static TheoryData ComputeSegments_Valid_Success_Data()
{
var data = new TheoryData
{
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs
index 639c364df2..2431274383 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs
@@ -12,7 +12,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
public class SubtitleEncoderTests
{
- internal static TheoryData GetReadableFile_Valid_TestData()
+ public static TheoryData GetReadableFile_Valid_TestData()
{
var data = new TheoryData();
diff --git a/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs b/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs
index 7c3a7ff6c7..a5bdb42d89 100644
--- a/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs
+++ b/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs
@@ -7,7 +7,7 @@ namespace Jellyfin.Model.Drawing;
public static class ImageFormatExtensionsTests
{
- private static TheoryData GetAllImageFormats()
+ public static TheoryData GetAllImageFormats()
{
var theoryTypes = new TheoryData();
foreach (var x in Enum.GetValues())
diff --git a/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs b/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs
index c0931dbcf1..08b343cd89 100644
--- a/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs
+++ b/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs
@@ -44,7 +44,7 @@ namespace Jellyfin.Providers.Tests.Manager
ValidateImages_Test(ImageType.Primary, 0, true, 0, false, 0);
}
- private static TheoryData GetImageTypesWithCount()
+ public static TheoryData GetImageTypesWithCount()
{
var theoryTypes = new TheoryData
{
diff --git a/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs b/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs
index b74b331b7f..28b2e1d8f2 100644
--- a/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs
+++ b/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs
@@ -132,7 +132,7 @@ namespace Jellyfin.Providers.Tests.Manager
Assert.True(TestMergeBaseItemData
+
+
+ Libraries\LrcParser.dll
+
+
+
+
+
+ Always
+
+
+
diff --git a/Jellyfin.Api/Libraries/LrcParser.dll b/Jellyfin.Api/Libraries/LrcParser.dll
new file mode 100644
index 0000000000000000000000000000000000000000..46e4fb703335931a91bdb2bcce2a24c62b6b8dda
GIT binary patch
literal 12288
zcmeHNe{dXkb${Qz+r87tch=p>k{!#+$v@AMe3ASM*%;gUMNJ?-1~>-*mOzVG{f_q)3q`p_rHM?`*{*RKn2Wb=u>y~BwqYurqQ!=aU)
z>3#h~gUUzU_pW`kXoq9izm%U!(-*96YvIEm^6*W9?7!ST!SI3W0Z_~`fp
ztjd3tt4A^m$1Cu^myzQ{O`M1uk6EGx;QhRhXyiuOyU_`vV3j-w`i?3(RWQ#KK)0_3
zfK2-8#SKc11fojWj-3G|u^k7(9c{%~b?n4&rED{2L6KvnS)6Pug|q6|Nz_wC3L4re9DdGO_L9>>O5QSQgxmT_6LNko5YVbXJ7AF0zTRpz-MiTM*Tbs3e
z(LaCda?N*E5HK(({#J^2_-Gx%fsv@o^VK_TC=cyk9STYC+d@XeZCZV+D>g1!afn-2
zd)k*=8=QdOU}JsMXy~ZeX*_(X)tG?o8+ar!ZG8{+YDy8ki=BP%!Oks4<0047!`by!
z0UmM#you;iE9Y&;d$2t>#+#Z#e|1`qiZS~xn^tx(}_WU)htVrFx-~Jc(;WbYPd>jwL@4@X@E+y5x_#N7;SAv0O}Sz+)Rf>Tq06NpAR&2
z-ceFE0vL2@mR!tEZ?jv_my+}$*i)_wH!qn3ei+pb@~t{G?D
z5~igcetHvS4Kk`BL7yon$ia*Yg`6h9T4x#Hf`)KIJka$Tmuf(>Fo#0d{0-MsJQxkG
z3u)1Sbt_nHsv%y}5D!IbZauQ0GYYryz&!Q#TKg$>B$1U`#%mhmp_+a~f;sQ5fM3S7
z%VdY4bzxY%dqbcx+%@7dqF{tmLBP;8)#h)6=VV
z+YpY{y3Ws{l>9~@T6@jd%ma^bLrDxso3*AARlve+C)9Qff$f(x><(I36hjT2+nx8Z
z!3B-s=mO6mN`Vb7xMpkgLnP~6WKBd*uS4a33$7mA0w
zE?{EB!b#M6C?2^FcSL_Il0=1vEUfUM_`>Ky>oy?m$ANSJv9Y*LTbQ6BYdt`613*c1
zVXg>MFch!5b=!w>(YixPBrFtG8eI|Btnq5A?AWD4Aq*j!D+^ROXvR^%`v_VQ;)_?`YI$Ux^%gR+hNwV|nz3nBsAR
zvzO#bNWLGy*#^KRZ?rYqHd=VaRyDCvj30o~*2%Z8U;jZQ7QWViz0Oi=J9w`}{T6OG
zA*^qYpslwM=uv+oFKh;HUAnQ(p_r&0;BlNUVG3f?Ajf_7Tij|VEX;DD+k1Q^l53B5
z2yo@@5Cj3Ero<2g4BQ`F4MD)DEinWE1KT85LlA6Q_!icBmwUzSif}+Z2sbF+o<)6f>j=fj@7_bY*>=fC%E4?jX88tK<~6%5%JgQRb}uhg
zPEU19=JI;ua^b6I_|6{X?bOf@I<+y?k=oF)p%YVy*YzCW{pj(E`>=n-^)+O0#c;vS
z<|iH2cqvZwC~g5O4i3|aMt5Jl;`W0BeUP02{T$1Ba@H6to?jrUq%Hx6}s0
z?G{r*wxc|L2#zq<3AZNMrXqS`TgZuQU0
zns!xRNF68zgMO)P_8atl-}8X`1cn8+3Vc%F>l#b%*VuyYe;D}J42F+s3@y?59Ql+%
zPlj%;N7un)YCZa0N7zq*iqa;bFy%qT=zX-Bb{K!FR#T_{
zMb$#z*I!bKI@EW7e@y?L>ZD77R{dw2FGb
zzj6-Msv+xgyr3V{IyA0aK3>rO-ssR|=!E)Xy+gx5$nk>y3S=l=mkPIP3lt`yN8K5y
zratYjrbhK@>OYP5X_a6!$Mk
zKP*$NS`Gcwr4;usMB7>j#~X_KS4;PM6!&idUG*sLUzpmLvnG$jZY@H&6-+%sX9I_{
zD18FkDWZ#uU(k`TKuWiQn_UjPTzgnwRQxL@%513`>q4K2nB+k_k#z^~{E
zs|(NUC4eDX3s^^;0=Ee47C0bqzre!+(|`ue04}0)!pREfO*-sfjrCAg3&qyzfe%xS
zdMa=j@XrG?@ZRjd09fz8NEhi@|096U2Ogs(>UHA_)FQ1`iiLK8FA7|ua{jlW^Ms)k
zYZ~ea+J{PQr*>7RUZmZ61K=;zQnk_Z_!DEDT8W$JUg+#bv@a4{*e2Fi(zE(;)kpP#
zi!?~z0DKDfoqJWM`jT;hUZqEjb83rv!2f%yTh+tMT9wltRs(>aQWxnL`X8x5#Q!<9
zO}sBrU&OpvqMi?227DRtB3*}06MWUd%kjVk+ONj3N^PT^fw$p{Gjow@^go52EBaT|
zD$LEdR0`wrH(CmF@$Uea(i?y)=x2a!w91#F4YU#P{nQQEOM3u!3x61}m+q#+fFZzs
zv6c}|MmQPD(74YO{yE{F_aN(^hxGS-5Agj)yG+aJnC~*3q-TBK7W_v7m16ro#Zn*E
zmA8~nu}+KdR|tQF@VkZ6E1X{8q=j=%;CX>h2)r!td4b;+_(RcGSjFB_Edsj*&T8!a
zae?G#JRxwWz~cgE1wJnDiomM^Nf&*AvjQI%ctzk=5by)dIg$^pPg@jKqBe-hVQ!E6m!+h6p#sOo9Ujx<%SdSGz
zfnEZ<0hOnLy9{tKcA6R`s0Gp%{4~_U3g9d7(`Y5F0=^1AjaJhd;A`;H@S=4s@U{49
z)Q;L!c(2$7JcTRPM8KtVCp}0%rC(vbA68jaQ2tq7$*PY_Sm8?db>=^(wj*aZ^2SAF
zuHN~Z@OHo&zq<`08$skGh@Ndmv^JvLOheS~I^VW^%jjt5=Ftw?mdX??d;3_4+@2X7
z?aMmTx%5nLF6}s-TUcqAZB32fJu~ZpyoplhT%}IhQ_SVkV>$D9Ck^!Hi&LguqW0S3
zrfrVTW%gQA(`nnZS$#0;6!@AiY*A5
z+pa7SPOWrN^6Fw<>JAk11$2kJk)s}S!m>f8rwc_~U85%LOWO|IO^uo3Fh2>Jh7>IP4T?iG@9{NJ=#6tU>TlDl~Y9B69qIIu?DTvxZZ9S
zycr8Mk~JHUmu~SUOO->TIbO1yQh>QG2>**G4Nd@b-khcJhW8ARbwxt`s*?08GgUd$;sU4pq|Onb*ZjD?+s
zO|B3z<1VE#CLWrep3cp9IM-=!(Y8@DqU|lPqF%z0K3;S^Io3bH+!a?8J#@%AW$xk6
zvR-0236!%laxL9UDVrZR&rs>sf*gS=m!M0^t+HnZWzcQg=^1f{J0VYp{(FjPp2mz1
zQi0Mmj+3tx&fyuxrY!cqcwKjT7v4-2DGzx9XOX7yevf6WZGu+-#Woyi
zJq39JJBWMn?&d762|5jVfldIc*mX5JJ&m+yom;IJUW(Mh9Ae1e+qX$)(4Hpyah(R0
z0hK^ZdGVfs_tI+N6zt?BGLD88I*219mdBZ{Wj`ndaA~2-=YHkE
zBb{Y5d$I2(Lo!GQ@F&
zDLi*zO~f`0{TXPN`p6040^$DjqD3CD@K8-iYPo2c$1N)5=RjKxAH$Y>2eju70vF6U
zHs)*5OIJR3P)hP7^ipNr9nfD%YIn(IW#G7gy0N+c5aL)zAEBeL&DtgFbBA>eY___#
zu=7v7^wqTUfjb}j<%xUlKC${0@+XuE`VypcAoyGc7!h=fu_#tlu_j+Y1sB#SUvOD7
z-gq;wnfxILA_4!hSW|FObVx-9V#(m5*gaaTDLSAhG}W|tah;|uip_o;+KXa`1>S=<
zKF!JqiPnNTrC`yO8Lkn8q4^VdQVNn59pE1xu>=c{KN4wbYT6d4Ulcp47DdxqB*IuE
zX2S7NgcDmC32HtqwlUVVD4H#)h+=Fi936;6LY1bvw1vMQI_wMT1anOwrR#Adg<>YM
z5Ho$X+^vY~uu=Mi&ZxOvstJ`eYLGsb#R=KtsDcUNXyO#A1clym_-ua)kYcl+HGt24
zCgLX*WDt(%grtT!8F(btpzRNUfhIvD1qqHr5PW9G=tra93vKlo%XH1q{RYOvXT%oc
zY{z*}Ga`XfYK`asSRFNp%Nr)e&uJlf0WVL4JoGv|sAW3$e=&z1>qj5Ji->P@hXchJ
zOSgF3p(!F2Tf88F*A_R#b#Gp07AgZScT5eV%
z{v`WOmV770cal@-OHzadVhm~sL!ngoXy$JWBU-};?ez2>D_`DTjhwKp(~g3kCVHC`
zEl%y}AL+$&0-i_Oy&dESPHj$gz(AzFygT=vK=)v?PWWhAQ`r{L0!0CAm(4VuDun37
zw<`Q3o4OGA5X9-#<#Mr!+pbl
z5Pjth^DiD4IJco?>#En6_xeqn$#eDU^PVg2PVHw;T|LmgS
z`L3a(3b61+H_*G(osIyR|NW;5qI~^o5>t<
zUW#zOj}*3AIsEwFP&Kq2gpWyS#l4*Noq(#Z*egAllnk{
z;>*qBKG?A2iH4sjDpB67E#6Awt*b(AtJ~a|kxD-J{}DKM-N+YjAEz*ay#3^D^xP~~
Y+Hfv^i;kV{{|xhgd;RYC?aRRb02;KsP5=M^
literal 0
HcmV?d00001
diff --git a/Jellyfin.Api/Models/UserDtos/Lyrics.cs b/Jellyfin.Api/Models/UserDtos/Lyrics.cs
new file mode 100644
index 0000000000..df1b5d08a2
--- /dev/null
+++ b/Jellyfin.Api/Models/UserDtos/Lyrics.cs
@@ -0,0 +1,23 @@
+namespace Jellyfin.Api.Models.UserDtos
+{
+ ///
+ /// Lyric dto.
+ ///
+ public class Lyrics
+ {
+ ///
+ /// Gets or sets the start.
+ ///
+ public double? Start { get; set; }
+
+ ///
+ /// Gets or sets the test.
+ ///
+ public string? Text { get; set; }
+
+ ///
+ /// Gets or sets the error.
+ ///
+ public string? Error { get; set; }
+ }
+}
From 8b78802c0b42d9d55f5bd8c3f34a542d78903f75 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Fri, 9 Sep 2022 21:08:38 -0400
Subject: [PATCH 042/262] Update
Jellyfin.Api/Controllers/UserLibraryController.cs
Co-authored-by: Cody Robibero
---
Jellyfin.Api/Controllers/UserLibraryController.cs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 89fb56744c..42367940d3 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -402,11 +402,7 @@ namespace Jellyfin.Api.Controllers
if (user == null)
{
- List lyricsList = new List
- {
- new Lyrics { Error = "User Not Found" }
- };
- return NotFound(new { Results = lyricsList.ToArray() });
+ return NotFound();
}
var item = itemId.Equals(default)
From 92715a74262fbf52f7071b45f5b61b7f057bb28e Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Fri, 9 Sep 2022 21:09:39 -0400
Subject: [PATCH 043/262] Update
Jellyfin.Api/Controllers/UserLibraryController.cs
Co-authored-by: Cody Robibero
---
Jellyfin.Api/Controllers/UserLibraryController.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 42367940d3..a1b911a450 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -424,7 +424,7 @@ namespace Jellyfin.Api.Controllers
return Ok(new { Results = result });
}
- return NotFound(new { Results = result.ToArray() });
+ return NotFound();
}
}
}
From 0aa2780ea7b23aed31765550f707f7ea9fc0daf1 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Fri, 9 Sep 2022 21:15:57 -0400
Subject: [PATCH 044/262] Update
Jellyfin.Api/Controllers/UserLibraryController.cs
Co-authored-by: Cody Robibero
---
Jellyfin.Api/Controllers/UserLibraryController.cs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index a1b911a450..7830df9bc9 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -411,11 +411,7 @@ namespace Jellyfin.Api.Controllers
if (item == null)
{
- List lyricsList = new List
- {
- new Lyrics { Error = "Requested Item Not Found" }
- };
- return NotFound(new { Results = lyricsList.ToArray() });
+ return NotFound();
}
List result = ItemHelper.GetLyricData(item);
From d24444b6d3a2e973d50edc2a8a1d01a433db645e Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 10 Sep 2022 10:51:05 -0400
Subject: [PATCH 045/262] Update Jellyfin.Api/Models/UserDtos/Lyrics.cs
Co-authored-by: Neil Burrows
---
Jellyfin.Api/Models/UserDtos/Lyrics.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Api/Models/UserDtos/Lyrics.cs b/Jellyfin.Api/Models/UserDtos/Lyrics.cs
index df1b5d08a2..cd548eb037 100644
--- a/Jellyfin.Api/Models/UserDtos/Lyrics.cs
+++ b/Jellyfin.Api/Models/UserDtos/Lyrics.cs
@@ -11,7 +11,7 @@ namespace Jellyfin.Api.Models.UserDtos
public double? Start { get; set; }
///
- /// Gets or sets the test.
+ /// Gets or sets the text.
///
public string? Text { get; set; }
From 2e260e5319b0b58290a1e30a28886c69d5a65325 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 10 Sep 2022 14:29:30 -0400
Subject: [PATCH 046/262] Updates based on review
---
.../Controllers/UserLibraryController.cs | 9 ++-
Jellyfin.Api/Helpers/ItemHelper.cs | 68 +++++++++++-------
Jellyfin.Api/Jellyfin.Api.csproj | 13 +---
Jellyfin.Api/Libraries/LrcParser.dll | Bin 12288 -> 0 bytes
4 files changed, 46 insertions(+), 44 deletions(-)
delete mode 100644 Jellyfin.Api/Libraries/LrcParser.dll
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 89fb56744c..afd4013ed3 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -12,7 +12,6 @@ using Jellyfin.Api.ModelBinders;
using Jellyfin.Api.Models.UserDtos;
using Jellyfin.Data.Enums;
using Jellyfin.Extensions;
-using Kfstorm.LrcParser;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
@@ -422,13 +421,13 @@ namespace Jellyfin.Api.Controllers
return NotFound(new { Results = lyricsList.ToArray() });
}
- List result = ItemHelper.GetLyricData(item);
- if (string.IsNullOrEmpty(result.ElementAt(0).Error))
+ var result = ItemHelper.GetLyricData(item);
+ if (result is not null)
{
- return Ok(new { Results = result });
+ return Ok(result);
}
- return NotFound(new { Results = result.ToArray() });
+ return NotFound();
}
}
}
diff --git a/Jellyfin.Api/Helpers/ItemHelper.cs b/Jellyfin.Api/Helpers/ItemHelper.cs
index 43ef7aa093..c1b5ea6ccc 100644
--- a/Jellyfin.Api/Helpers/ItemHelper.cs
+++ b/Jellyfin.Api/Helpers/ItemHelper.cs
@@ -1,19 +1,13 @@
using System;
using System.Collections.Generic;
+using System.Dynamic;
+using System.Globalization;
using System.IO;
-using System.Net.Http;
-using System.Threading.Tasks;
+using System.Linq;
using Jellyfin.Api.Models.UserDtos;
-using Kfstorm.LrcParser;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Controller.Devices;
-using MediaBrowser.Controller.Dlna;
+using LrcParser.Model;
+using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.MediaEncoding;
-using MediaBrowser.Controller.Net;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
namespace Jellyfin.Api.Helpers
{
@@ -27,7 +21,7 @@ namespace Jellyfin.Api.Helpers
///
/// Requested Item.
/// Collection of Lyrics.
- internal static List GetLyricData(BaseItem item)
+ internal static object? GetLyricData(BaseItem item)
{
List lyricsList = new List();
@@ -39,8 +33,7 @@ namespace Jellyfin.Api.Helpers
string txtFilePath = @Path.ChangeExtension(item.Path, "txt");
if (!System.IO.File.Exists(txtFilePath))
{
- lyricsList.Add(new Lyrics { Error = "Lyric File Not Found" });
- return lyricsList;
+ return null;
}
var lyricTextData = System.IO.File.ReadAllText(txtFilePath);
@@ -51,37 +44,58 @@ namespace Jellyfin.Api.Helpers
lyricsList.Add(new Lyrics { Text = lyricLine });
}
- return lyricsList;
+ return new { lyrics = lyricsList };
}
// Process LRC File
- ILrcFile lyricData;
+ Song lyricData;
+ List sortedLyricData = new List();
+ var metaData = new ExpandoObject() as IDictionary;
string lrcFileContent = System.IO.File.ReadAllText(lrcFilePath);
+
try
{
- lrcFileContent = lrcFileContent.Replace('<', '[');
- lrcFileContent = lrcFileContent.Replace('>', ']');
- lyricData = Kfstorm.LrcParser.LrcFile.FromText(lrcFileContent);
+ LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
+ lyricData = lrcLyricParser.Decode(lrcFileContent);
+ var _metaData = lyricData.Lyrics
+ .Where(x => x.TimeTags.Count == 0)
+ .Where(x => x.Text.StartsWith("[", StringComparison.Ordinal) && x.Text.EndsWith("]", StringComparison.Ordinal))
+ .Select(x => x.Text)
+ .ToList();
+
+ foreach (string dataRow in _metaData)
+ {
+ var data = dataRow.Split(":");
+
+ string newPropertyName = data[0].Replace("[", string.Empty, StringComparison.Ordinal);
+ string newPropertyValue = data[1].Replace("]", string.Empty, StringComparison.Ordinal);
+
+ metaData.Add(newPropertyName, newPropertyValue);
+ }
+
+ sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.ToArray()[0].Value).ToList();
}
catch
{
- lyricsList.Add(new Lyrics { Error = "No Lyrics Data" });
- return lyricsList;
+ return null;
}
if (lyricData == null)
{
- lyricsList.Add(new Lyrics { Error = "No Lyrics Data" });
- return lyricsList;
+ return null;
}
- foreach (var lyricLine in lyricData.Lyrics)
+ for (int i = 0; i < sortedLyricData.Count; i++)
{
- double ticks = lyricLine.Timestamp.TotalSeconds * 10000000;
- lyricsList.Add(new Lyrics { Start = Math.Ceiling(ticks), Text = lyricLine.Content });
+ if (sortedLyricData[i].TimeTags.Count > 0)
+ {
+ var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
+ double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;
+ lyricsList.Add(new Lyrics { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
+ }
}
- return lyricsList;
+ return new { MetaData = metaData, lyrics = lyricsList };
}
}
}
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index 1b78bb1074..972387e02a 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -17,6 +17,7 @@
+
@@ -46,16 +47,4 @@
-
-
- Libraries\LrcParser.dll
-
-
-
-
-
- Always
-
-
-
diff --git a/Jellyfin.Api/Libraries/LrcParser.dll b/Jellyfin.Api/Libraries/LrcParser.dll
deleted file mode 100644
index 46e4fb703335931a91bdb2bcce2a24c62b6b8dda..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 12288
zcmeHNe{dXkb${Qz+r87tch=p>k{!#+$v@AMe3ASM*%;gUMNJ?-1~>-*mOzVG{f_q)3q`p_rHM?`*{*RKn2Wb=u>y~BwqYurqQ!=aU)
z>3#h~gUUzU_pW`kXoq9izm%U!(-*96YvIEm^6*W9?7!ST!SI3W0Z_~`fp
ztjd3tt4A^m$1Cu^myzQ{O`M1uk6EGx;QhRhXyiuOyU_`vV3j-w`i?3(RWQ#KK)0_3
zfK2-8#SKc11fojWj-3G|u^k7(9c{%~b?n4&rED{2L6KvnS)6Pug|q6|Nz_wC3L4re9DdGO_L9>>O5QSQgxmT_6LNko5YVbXJ7AF0zTRpz-MiTM*Tbs3e
z(LaCda?N*E5HK(({#J^2_-Gx%fsv@o^VK_TC=cyk9STYC+d@XeZCZV+D>g1!afn-2
zd)k*=8=QdOU}JsMXy~ZeX*_(X)tG?o8+ar!ZG8{+YDy8ki=BP%!Oks4<0047!`by!
z0UmM#you;iE9Y&;d$2t>#+#Z#e|1`qiZS~xn^tx(}_WU)htVrFx-~Jc(;WbYPd>jwL@4@X@E+y5x_#N7;SAv0O}Sz+)Rf>Tq06NpAR&2
z-ceFE0vL2@mR!tEZ?jv_my+}$*i)_wH!qn3ei+pb@~t{G?D
z5~igcetHvS4Kk`BL7yon$ia*Yg`6h9T4x#Hf`)KIJka$Tmuf(>Fo#0d{0-MsJQxkG
z3u)1Sbt_nHsv%y}5D!IbZauQ0GYYryz&!Q#TKg$>B$1U`#%mhmp_+a~f;sQ5fM3S7
z%VdY4bzxY%dqbcx+%@7dqF{tmLBP;8)#h)6=VV
z+YpY{y3Ws{l>9~@T6@jd%ma^bLrDxso3*AARlve+C)9Qff$f(x><(I36hjT2+nx8Z
z!3B-s=mO6mN`Vb7xMpkgLnP~6WKBd*uS4a33$7mA0w
zE?{EB!b#M6C?2^FcSL_Il0=1vEUfUM_`>Ky>oy?m$ANSJv9Y*LTbQ6BYdt`613*c1
zVXg>MFch!5b=!w>(YixPBrFtG8eI|Btnq5A?AWD4Aq*j!D+^ROXvR^%`v_VQ;)_?`YI$Ux^%gR+hNwV|nz3nBsAR
zvzO#bNWLGy*#^KRZ?rYqHd=VaRyDCvj30o~*2%Z8U;jZQ7QWViz0Oi=J9w`}{T6OG
zA*^qYpslwM=uv+oFKh;HUAnQ(p_r&0;BlNUVG3f?Ajf_7Tij|VEX;DD+k1Q^l53B5
z2yo@@5Cj3Ero<2g4BQ`F4MD)DEinWE1KT85LlA6Q_!icBmwUzSif}+Z2sbF+o<)6f>j=fj@7_bY*>=fC%E4?jX88tK<~6%5%JgQRb}uhg
zPEU19=JI;ua^b6I_|6{X?bOf@I<+y?k=oF)p%YVy*YzCW{pj(E`>=n-^)+O0#c;vS
z<|iH2cqvZwC~g5O4i3|aMt5Jl;`W0BeUP02{T$1Ba@H6to?jrUq%Hx6}s0
z?G{r*wxc|L2#zq<3AZNMrXqS`TgZuQU0
zns!xRNF68zgMO)P_8atl-}8X`1cn8+3Vc%F>l#b%*VuyYe;D}J42F+s3@y?59Ql+%
zPlj%;N7un)YCZa0N7zq*iqa;bFy%qT=zX-Bb{K!FR#T_{
zMb$#z*I!bKI@EW7e@y?L>ZD77R{dw2FGb
zzj6-Msv+xgyr3V{IyA0aK3>rO-ssR|=!E)Xy+gx5$nk>y3S=l=mkPIP3lt`yN8K5y
zratYjrbhK@>OYP5X_a6!$Mk
zKP*$NS`Gcwr4;usMB7>j#~X_KS4;PM6!&idUG*sLUzpmLvnG$jZY@H&6-+%sX9I_{
zD18FkDWZ#uU(k`TKuWiQn_UjPTzgnwRQxL@%513`>q4K2nB+k_k#z^~{E
zs|(NUC4eDX3s^^;0=Ee47C0bqzre!+(|`ue04}0)!pREfO*-sfjrCAg3&qyzfe%xS
zdMa=j@XrG?@ZRjd09fz8NEhi@|096U2Ogs(>UHA_)FQ1`iiLK8FA7|ua{jlW^Ms)k
zYZ~ea+J{PQr*>7RUZmZ61K=;zQnk_Z_!DEDT8W$JUg+#bv@a4{*e2Fi(zE(;)kpP#
zi!?~z0DKDfoqJWM`jT;hUZqEjb83rv!2f%yTh+tMT9wltRs(>aQWxnL`X8x5#Q!<9
zO}sBrU&OpvqMi?227DRtB3*}06MWUd%kjVk+ONj3N^PT^fw$p{Gjow@^go52EBaT|
zD$LEdR0`wrH(CmF@$Uea(i?y)=x2a!w91#F4YU#P{nQQEOM3u!3x61}m+q#+fFZzs
zv6c}|MmQPD(74YO{yE{F_aN(^hxGS-5Agj)yG+aJnC~*3q-TBK7W_v7m16ro#Zn*E
zmA8~nu}+KdR|tQF@VkZ6E1X{8q=j=%;CX>h2)r!td4b;+_(RcGSjFB_Edsj*&T8!a
zae?G#JRxwWz~cgE1wJnDiomM^Nf&*AvjQI%ctzk=5by)dIg$^pPg@jKqBe-hVQ!E6m!+h6p#sOo9Ujx<%SdSGz
zfnEZ<0hOnLy9{tKcA6R`s0Gp%{4~_U3g9d7(`Y5F0=^1AjaJhd;A`;H@S=4s@U{49
z)Q;L!c(2$7JcTRPM8KtVCp}0%rC(vbA68jaQ2tq7$*PY_Sm8?db>=^(wj*aZ^2SAF
zuHN~Z@OHo&zq<`08$skGh@Ndmv^JvLOheS~I^VW^%jjt5=Ftw?mdX??d;3_4+@2X7
z?aMmTx%5nLF6}s-TUcqAZB32fJu~ZpyoplhT%}IhQ_SVkV>$D9Ck^!Hi&LguqW0S3
zrfrVTW%gQA(`nnZS$#0;6!@AiY*A5
z+pa7SPOWrN^6Fw<>JAk11$2kJk)s}S!m>f8rwc_~U85%LOWO|IO^uo3Fh2>Jh7>IP4T?iG@9{NJ=#6tU>TlDl~Y9B69qIIu?DTvxZZ9S
zycr8Mk~JHUmu~SUOO->TIbO1yQh>QG2>**G4Nd@b-khcJhW8ARbwxt`s*?08GgUd$;sU4pq|Onb*ZjD?+s
zO|B3z<1VE#CLWrep3cp9IM-=!(Y8@DqU|lPqF%z0K3;S^Io3bH+!a?8J#@%AW$xk6
zvR-0236!%laxL9UDVrZR&rs>sf*gS=m!M0^t+HnZWzcQg=^1f{J0VYp{(FjPp2mz1
zQi0Mmj+3tx&fyuxrY!cqcwKjT7v4-2DGzx9XOX7yevf6WZGu+-#Woyi
zJq39JJBWMn?&d762|5jVfldIc*mX5JJ&m+yom;IJUW(Mh9Ae1e+qX$)(4Hpyah(R0
z0hK^ZdGVfs_tI+N6zt?BGLD88I*219mdBZ{Wj`ndaA~2-=YHkE
zBb{Y5d$I2(Lo!GQ@F&
zDLi*zO~f`0{TXPN`p6040^$DjqD3CD@K8-iYPo2c$1N)5=RjKxAH$Y>2eju70vF6U
zHs)*5OIJR3P)hP7^ipNr9nfD%YIn(IW#G7gy0N+c5aL)zAEBeL&DtgFbBA>eY___#
zu=7v7^wqTUfjb}j<%xUlKC${0@+XuE`VypcAoyGc7!h=fu_#tlu_j+Y1sB#SUvOD7
z-gq;wnfxILA_4!hSW|FObVx-9V#(m5*gaaTDLSAhG}W|tah;|uip_o;+KXa`1>S=<
zKF!JqiPnNTrC`yO8Lkn8q4^VdQVNn59pE1xu>=c{KN4wbYT6d4Ulcp47DdxqB*IuE
zX2S7NgcDmC32HtqwlUVVD4H#)h+=Fi936;6LY1bvw1vMQI_wMT1anOwrR#Adg<>YM
z5Ho$X+^vY~uu=Mi&ZxOvstJ`eYLGsb#R=KtsDcUNXyO#A1clym_-ua)kYcl+HGt24
zCgLX*WDt(%grtT!8F(btpzRNUfhIvD1qqHr5PW9G=tra93vKlo%XH1q{RYOvXT%oc
zY{z*}Ga`XfYK`asSRFNp%Nr)e&uJlf0WVL4JoGv|sAW3$e=&z1>qj5Ji->P@hXchJ
zOSgF3p(!F2Tf88F*A_R#b#Gp07AgZScT5eV%
z{v`WOmV770cal@-OHzadVhm~sL!ngoXy$JWBU-};?ez2>D_`DTjhwKp(~g3kCVHC`
zEl%y}AL+$&0-i_Oy&dESPHj$gz(AzFygT=vK=)v?PWWhAQ`r{L0!0CAm(4VuDun37
zw<`Q3o4OGA5X9-#<#Mr!+pbl
z5Pjth^DiD4IJco?>#En6_xeqn$#eDU^PVg2PVHw;T|LmgS
z`L3a(3b61+H_*G(osIyR|NW;5qI~^o5>t<
zUW#zOj}*3AIsEwFP&Kq2gpWyS#l4*Noq(#Z*egAllnk{
z;>*qBKG?A2iH4sjDpB67E#6Awt*b(AtJ~a|kxD-J{}DKM-N+YjAEz*ay#3^D^xP~~
Y+Hfv^i;kV{{|xhgd;RYC?aRRb02;KsP5=M^
From 778baf7bf5603187586d6ce64c405053a2c68261 Mon Sep 17 00:00:00 2001
From: jakka
Date: Sat, 10 Sep 2022 23:30:53 +0300
Subject: [PATCH 047/262] added A/T/O/S to separator whitelist
---
MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 74d7341e91..811194d8d5 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -44,6 +44,7 @@ namespace MediaBrowser.MediaEncoding.Probing
private IReadOnlyList SplitWhitelist => _splitWhiteList ??= new string[]
{
"AC/DC",
+ "A/T/O/S",
"As/Hi Soundworks",
"Au/Ra",
"Bremer/McCoy",
From 0b581aa655c6146cc68d0ba29088e1df23938049 Mon Sep 17 00:00:00 2001
From: jakka
Date: Sun, 11 Sep 2022 20:27:58 +0300
Subject: [PATCH 048/262] added more artists with '/' in their names
---
.../Probing/ProbeResultNormalizer.cs | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 811194d8d5..6cae7f5582 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -48,13 +48,24 @@ namespace MediaBrowser.MediaEncoding.Probing
"As/Hi Soundworks",
"Au/Ra",
"Bremer/McCoy",
+ "b/bqスタヂオ",
+ "DOV/S",
+ "DJ'TEKINA//SOMETHING",
+ "IX/ON",
+ "J-CORE SLi//CER",
+ "M(a/u)SH",
+ "Kaoru/Brilliance",
+ "signum/ii",
+ "Richiter(LORB/DUGEM DI BARAT)",
"이달의 소녀 1/3",
"R!N / Gemie",
"LOONA 1/3",
"LOONA / yyxy",
"LOONA / ODD EYE CIRCLE",
"K/DA",
- "22/7"
+ "22/7",
+ "諭吉佳作/men",
+ "//dARTH nULL"
};
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType? videoType, bool isAudio, string path, MediaProtocol protocol)
From 9d5cf67dfe2d5871d42a55a5e114c5ead1036ff0 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 10 Sep 2022 14:58:03 -0400
Subject: [PATCH 049/262] Create ILyricsProvider
---
Emby.Server.Implementations/Dto/DtoService.cs | 5 +
Jellyfin.Api/Helpers/ItemHelper.cs | 135 ++++++++++--------
.../Models/UserDtos/ILyricsProvider.cs | 34 +++++
.../Models/UserDtos/LrcLyricsProvider.cs | 117 +++++++++++++++
Jellyfin.Api/Models/UserDtos/Lyric.cs | 18 +++
Jellyfin.Api/Models/UserDtos/Lyrics.cs | 23 ---
.../Models/UserDtos/TxtLyricsProvider.cs | 81 +++++++++++
MediaBrowser.Model/Dto/BaseItemDto.cs | 2 +
8 files changed, 334 insertions(+), 81 deletions(-)
create mode 100644 Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs
create mode 100644 Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs
create mode 100644 Jellyfin.Api/Models/UserDtos/Lyric.cs
delete mode 100644 Jellyfin.Api/Models/UserDtos/Lyrics.cs
create mode 100644 Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index 09ba368514..96717cff53 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
+using Jellyfin.Api.Helpers;
using Jellyfin.Data.Entities;
using Jellyfin.Data.Enums;
using Jellyfin.Extensions;
@@ -139,6 +140,10 @@ namespace Emby.Server.Implementations.Dto
{
LivetvManager.AddInfoToProgramDto(new[] { (item, dto) }, options.Fields, user).GetAwaiter().GetResult();
}
+ else if (item is Audio)
+ {
+ dto.HasLocalLyricsFile = ItemHelper.HasLyricFile(item.Path);
+ }
if (item is IItemByName itemByName
&& options.ContainsField(ItemFields.ItemCounts))
diff --git a/Jellyfin.Api/Helpers/ItemHelper.cs b/Jellyfin.Api/Helpers/ItemHelper.cs
index c1b5ea6ccc..622eb0b9fe 100644
--- a/Jellyfin.Api/Helpers/ItemHelper.cs
+++ b/Jellyfin.Api/Helpers/ItemHelper.cs
@@ -23,79 +23,98 @@ namespace Jellyfin.Api.Helpers
/// Collection of Lyrics.
internal static object? GetLyricData(BaseItem item)
{
- List lyricsList = new List();
+ List providerList = new List();
- string lrcFilePath = @Path.ChangeExtension(item.Path, "lrc");
+ // Find all classes that implement ILyricsProvider Interface
+ var foundLyricProviders = System.Reflection.Assembly.GetExecutingAssembly()
+ .GetTypes()
+ .Where(type => typeof(ILyricsProvider).IsAssignableFrom(type) && !type.IsInterface);
- // LRC File not found, fallback to TXT file
- if (!System.IO.File.Exists(lrcFilePath))
- {
- string txtFilePath = @Path.ChangeExtension(item.Path, "txt");
- if (!System.IO.File.Exists(txtFilePath))
- {
- return null;
- }
-
- var lyricTextData = System.IO.File.ReadAllText(txtFilePath);
- string[] lyricTextLines = lyricTextData.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
-
- foreach (var lyricLine in lyricTextLines)
- {
- lyricsList.Add(new Lyrics { Text = lyricLine });
- }
-
- return new { lyrics = lyricsList };
- }
-
- // Process LRC File
- Song lyricData;
- List sortedLyricData = new List();
- var metaData = new ExpandoObject() as IDictionary;
- string lrcFileContent = System.IO.File.ReadAllText(lrcFilePath);
-
- try
- {
- LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
- lyricData = lrcLyricParser.Decode(lrcFileContent);
- var _metaData = lyricData.Lyrics
- .Where(x => x.TimeTags.Count == 0)
- .Where(x => x.Text.StartsWith("[", StringComparison.Ordinal) && x.Text.EndsWith("]", StringComparison.Ordinal))
- .Select(x => x.Text)
- .ToList();
-
- foreach (string dataRow in _metaData)
- {
- var data = dataRow.Split(":");
-
- string newPropertyName = data[0].Replace("[", string.Empty, StringComparison.Ordinal);
- string newPropertyValue = data[1].Replace("]", string.Empty, StringComparison.Ordinal);
-
- metaData.Add(newPropertyName, newPropertyValue);
- }
-
- sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.ToArray()[0].Value).ToList();
- }
- catch
+ if (!foundLyricProviders.Any())
{
return null;
}
- if (lyricData == null)
+ foreach (var provider in foundLyricProviders)
+ {
+ providerList.Add((ILyricsProvider)Activator.CreateInstance(provider));
+ }
+
+ foreach (ILyricsProvider provider in providerList)
+ {
+ provider.Process(item);
+ if (provider.HasData)
+ {
+ return provider.Data;
+ }
+ }
+
+ return null;
+ }
+
+ ///
+ /// Checks if requested item has a matching lyric file.
+ ///
+ /// Path of requested item.
+ /// True if item has a matching lyrics file.
+ public static string? GetLyricFilePath(string itemPath)
+ {
+ List supportedLyricFileExtensions = new List();
+
+ // Find all classes that implement ILyricsProvider Interface
+ var foundLyricProviders = System.Reflection.Assembly.GetExecutingAssembly()
+ .GetTypes()
+ .Where(type => typeof(ILyricsProvider).IsAssignableFrom(type) && !type.IsInterface);
+
+ if (!foundLyricProviders.Any())
{
return null;
}
- for (int i = 0; i < sortedLyricData.Count; i++)
+ // Iterate over all found lyric providers
+ foreach (var provider in foundLyricProviders)
{
- if (sortedLyricData[i].TimeTags.Count > 0)
+ var foundProvider = (ILyricsProvider)Activator.CreateInstance(provider);
+ if (foundProvider?.FileExtensions is null)
{
- var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
- double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;
- lyricsList.Add(new Lyrics { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
+ continue;
+ }
+
+ if (foundProvider.FileExtensions.Any())
+ {
+ // Gather distinct list of handled file extentions
+ foreach (string lyricFileExtension in foundProvider.FileExtensions)
+ {
+ if (!supportedLyricFileExtensions.Contains(lyricFileExtension))
+ {
+ supportedLyricFileExtensions.Add(lyricFileExtension);
+ }
+ }
}
}
- return new { MetaData = metaData, lyrics = lyricsList };
+ foreach (string lyricFileExtension in supportedLyricFileExtensions)
+ {
+ string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
+ if (System.IO.File.Exists(lyricFilePath))
+ {
+ return lyricFilePath;
+ }
+ }
+
+ return null;
+ }
+
+
+ ///
+ /// Checks if requested item has a matching local lyric file.
+ ///
+ /// Path of requested item.
+ /// True if item has a matching lyrics file; otherwise false.
+ public static bool HasLyricFile(string itemPath)
+ {
+ string? lyricFilePath = GetLyricFilePath(itemPath);
+ return !string.IsNullOrEmpty(lyricFilePath);
}
}
}
diff --git a/Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs b/Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs
new file mode 100644
index 0000000000..37f1f5bbe4
--- /dev/null
+++ b/Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs
@@ -0,0 +1,34 @@
+using System.Collections.ObjectModel;
+using MediaBrowser.Controller.Entities;
+
+namespace Jellyfin.Api.Models.UserDtos
+{
+ ///
+ /// Interface ILyricsProvider.
+ ///
+ public interface ILyricsProvider
+ {
+ ///
+ /// Gets a value indicating the File Extenstions this provider works with.
+ ///
+ public Collection? FileExtensions { get; }
+
+ ///
+ /// Gets a value indicating whether Process() generated data.
+ ///
+ /// true if data generated; otherwise, false.
+ bool HasData { get; }
+
+ ///
+ /// Gets Data object generated by Process() method.
+ ///
+ /// Object with data if no error occured; otherwise, null.
+ object? Data { get; }
+
+ ///
+ /// Opens lyric file for [the specified item], and processes it for API return.
+ ///
+ /// The item to to process.
+ void Process(BaseItem item);
+ }
+}
diff --git a/Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs b/Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs
new file mode 100644
index 0000000000..029acd6ca5
--- /dev/null
+++ b/Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Dynamic;
+using System.Globalization;
+using System.Linq;
+using LrcParser.Model;
+using LrcParser.Parser;
+using MediaBrowser.Controller.Entities;
+
+namespace Jellyfin.Api.Models.UserDtos
+{
+ ///
+ /// LRC File Lyric Provider.
+ ///
+ public class LrcLyricsProvider : ILyricsProvider
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public LrcLyricsProvider()
+ {
+ FileExtensions = new Collection
+ {
+ "lrc"
+ };
+ }
+
+ ///
+ /// Gets a value indicating the File Extenstions this provider works with.
+ ///
+ public Collection? FileExtensions { get; }
+
+ ///
+ /// Gets or Sets a value indicating whether Process() generated data.
+ ///
+ /// true if data generated; otherwise, false.
+ public bool HasData { get; set; }
+
+ ///
+ /// Gets or Sets Data object generated by Process() method.
+ ///
+ /// Object with data if no error occured; otherwise, null.
+ public object? Data { get; set; }
+
+ ///
+ /// Opens lyric file for [the specified item], and processes it for API return.
+ ///
+ /// The item to to process.
+ public void Process(BaseItem item)
+ {
+ string? lyricFilePath = Helpers.ItemHelper.GetLyricFilePath(item.Path);
+
+ if (string.IsNullOrEmpty(lyricFilePath))
+ {
+ return;
+ }
+
+ List lyricsList = new List();
+
+ List sortedLyricData = new List();
+ var metaData = new ExpandoObject() as IDictionary;
+ string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
+
+ try
+ {
+ // Parse and sort lyric rows
+ LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
+ Song lyricData = lrcLyricParser.Decode(lrcFileContent);
+ sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.ToArray()[0].Value).ToList();
+
+ // Parse metadata rows
+ var metaDataRows = lyricData.Lyrics
+ .Where(x => x.TimeTags.Count == 0)
+ .Where(x => x.Text.StartsWith("[", StringComparison.Ordinal) && x.Text.EndsWith("]", StringComparison.Ordinal))
+ .Select(x => x.Text)
+ .ToList();
+
+ foreach (string metaDataRow in metaDataRows)
+ {
+ var metaDataField = metaDataRow.Split(":");
+
+ string metaDataFieldName = metaDataField[0].Replace("[", string.Empty, StringComparison.Ordinal);
+ string metaDataFieldValue = metaDataField[1].Replace("]", string.Empty, StringComparison.Ordinal);
+
+ metaData.Add(metaDataFieldName, metaDataFieldValue);
+ }
+ }
+ catch
+ {
+ return;
+ }
+
+ if (!sortedLyricData.Any())
+ {
+ return;
+ }
+
+ for (int i = 0; i < sortedLyricData.Count; i++)
+ {
+ var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
+ double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;
+ lyricsList.Add(new Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
+ }
+
+ this.HasData = true;
+ if (metaData.Any())
+ {
+ this.Data = new { MetaData = metaData, lyrics = lyricsList };
+ }
+ else
+ {
+ this.Data = new { lyrics = lyricsList };
+ }
+ }
+ }
+}
diff --git a/Jellyfin.Api/Models/UserDtos/Lyric.cs b/Jellyfin.Api/Models/UserDtos/Lyric.cs
new file mode 100644
index 0000000000..2794cd78a0
--- /dev/null
+++ b/Jellyfin.Api/Models/UserDtos/Lyric.cs
@@ -0,0 +1,18 @@
+namespace Jellyfin.Api.Models.UserDtos
+{
+ ///
+ /// Lyric dto.
+ ///
+ public class Lyric
+ {
+ ///
+ /// Gets or sets the start time (ticks).
+ ///
+ public double Start { get; set; }
+
+ ///
+ /// Gets or sets the text.
+ ///
+ public string Text { get; set; } = string.Empty;
+ }
+}
diff --git a/Jellyfin.Api/Models/UserDtos/Lyrics.cs b/Jellyfin.Api/Models/UserDtos/Lyrics.cs
deleted file mode 100644
index cd548eb037..0000000000
--- a/Jellyfin.Api/Models/UserDtos/Lyrics.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace Jellyfin.Api.Models.UserDtos
-{
- ///
- /// Lyric dto.
- ///
- public class Lyrics
- {
- ///
- /// Gets or sets the start.
- ///
- public double? Start { get; set; }
-
- ///
- /// Gets or sets the text.
- ///
- public string? Text { get; set; }
-
- ///
- /// Gets or sets the error.
- ///
- public string? Error { get; set; }
- }
-}
diff --git a/Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs b/Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs
new file mode 100644
index 0000000000..03cce1ffbb
--- /dev/null
+++ b/Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Dynamic;
+using System.Globalization;
+using System.Linq;
+using LrcParser.Model;
+using LrcParser.Parser;
+using MediaBrowser.Controller.Entities;
+
+namespace Jellyfin.Api.Models.UserDtos
+{
+ ///
+ /// TXT File Lyric Provider.
+ ///
+ public class TxtLyricsProvider : ILyricsProvider
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public TxtLyricsProvider()
+ {
+ FileExtensions = new Collection
+ {
+ "lrc", "txt"
+ };
+ }
+
+ ///
+ /// Gets a value indicating the File Extenstions this provider works with.
+ ///
+ public Collection? FileExtensions { get; }
+
+ ///
+ /// Gets or Sets a value indicating whether Process() generated data.
+ ///
+ /// true if data generated; otherwise, false.
+ public bool HasData { get; set; }
+
+ ///
+ /// Gets or Sets Data object generated by Process() method.
+ ///
+ /// Object with data if no error occured; otherwise, null.
+ public object? Data { get; set; }
+
+ ///
+ /// Opens lyric file for [the specified item], and processes it for API return.
+ ///
+ /// The item to to process.
+ public void Process(BaseItem item)
+ {
+ string? lyricFilePath = Helpers.ItemHelper.GetLyricFilePath(item.Path);
+
+ if (string.IsNullOrEmpty(lyricFilePath))
+ {
+ return;
+ }
+
+ List lyricsList = new List();
+
+ string lyricData = System.IO.File.ReadAllText(lyricFilePath);
+
+ // Splitting on Environment.NewLine caused some new lines to be missed in Windows.
+ char[] newLinedelims = new[] { '\r', '\n' };
+ string[] lyricTextLines = lyricData.Split(newLinedelims, StringSplitOptions.RemoveEmptyEntries);
+
+ if (!lyricTextLines.Any())
+ {
+ return;
+ }
+
+ foreach (string lyricLine in lyricTextLines)
+ {
+ lyricsList.Add(new Lyric { Text = lyricLine });
+ }
+
+ this.HasData = true;
+ this.Data = new { lyrics = lyricsList };
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index fdb84fa320..b40a0210ad 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -76,6 +76,8 @@ namespace MediaBrowser.Model.Dto
public bool? CanDownload { get; set; }
+ public bool? HasLocalLyricsFile { get; set; }
+
public bool? HasSubtitles { get; set; }
public string PreferredMetadataLanguage { get; set; }
From 97f8a63b8934ead26cfc7d41550188d86cada93a Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 11 Sep 2022 15:56:34 -0400
Subject: [PATCH 050/262] Allow LRC start value to be null
---
Jellyfin.Api/Models/UserDtos/Lyric.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Api/Models/UserDtos/Lyric.cs b/Jellyfin.Api/Models/UserDtos/Lyric.cs
index 2794cd78a0..f83fc9839b 100644
--- a/Jellyfin.Api/Models/UserDtos/Lyric.cs
+++ b/Jellyfin.Api/Models/UserDtos/Lyric.cs
@@ -8,7 +8,7 @@ namespace Jellyfin.Api.Models.UserDtos
///
/// Gets or sets the start time (ticks).
///
- public double Start { get; set; }
+ public double? Start { get; set; }
///
/// Gets or sets the text.
From 3928d02e175f732d5e13fa0c66dbccb704c4324d Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 11 Sep 2022 16:13:17 -0400
Subject: [PATCH 051/262] Resolve Possible null reference
---
Jellyfin.Api/Helpers/ItemHelper.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Jellyfin.Api/Helpers/ItemHelper.cs b/Jellyfin.Api/Helpers/ItemHelper.cs
index 622eb0b9fe..cd29361bd7 100644
--- a/Jellyfin.Api/Helpers/ItemHelper.cs
+++ b/Jellyfin.Api/Helpers/ItemHelper.cs
@@ -37,7 +37,11 @@ namespace Jellyfin.Api.Helpers
foreach (var provider in foundLyricProviders)
{
- providerList.Add((ILyricsProvider)Activator.CreateInstance(provider));
+ ILyricsProvider? newProvider = Activator.CreateInstance(provider) as ILyricsProvider;
+ if (newProvider is not null)
+ {
+ providerList.Add(newProvider);
+ }
}
foreach (ILyricsProvider provider in providerList)
@@ -74,7 +78,7 @@ namespace Jellyfin.Api.Helpers
// Iterate over all found lyric providers
foreach (var provider in foundLyricProviders)
{
- var foundProvider = (ILyricsProvider)Activator.CreateInstance(provider);
+ ILyricsProvider? foundProvider = Activator.CreateInstance(provider) as ILyricsProvider;
if (foundProvider?.FileExtensions is null)
{
continue;
From cecca5f715f70b263f81b5c44dfcee5c38d53bf8 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 11 Sep 2022 19:13:02 -0400
Subject: [PATCH 052/262] Remove unneeded 2nd loops
---
.gitignore | 2 --
Jellyfin.Api/Helpers/ItemHelper.cs | 30 ++++++++----------------------
2 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/.gitignore b/.gitignore
index 3f80ffcf7d..c2ae76c1e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -281,5 +281,3 @@ apiclient/generated
# Omnisharp crash logs
mono_crash.*.json
-
-!LrcParser.dll
\ No newline at end of file
diff --git a/Jellyfin.Api/Helpers/ItemHelper.cs b/Jellyfin.Api/Helpers/ItemHelper.cs
index cd29361bd7..0afe5a155d 100644
--- a/Jellyfin.Api/Helpers/ItemHelper.cs
+++ b/Jellyfin.Api/Helpers/ItemHelper.cs
@@ -40,16 +40,11 @@ namespace Jellyfin.Api.Helpers
ILyricsProvider? newProvider = Activator.CreateInstance(provider) as ILyricsProvider;
if (newProvider is not null)
{
- providerList.Add(newProvider);
- }
- }
-
- foreach (ILyricsProvider provider in providerList)
- {
- provider.Process(item);
- if (provider.HasData)
- {
- return provider.Data;
+ newProvider.Process(item);
+ if (newProvider.HasData)
+ {
+ return newProvider.Data;
+ }
}
}
@@ -86,26 +81,17 @@ namespace Jellyfin.Api.Helpers
if (foundProvider.FileExtensions.Any())
{
- // Gather distinct list of handled file extentions
foreach (string lyricFileExtension in foundProvider.FileExtensions)
{
- if (!supportedLyricFileExtensions.Contains(lyricFileExtension))
+ string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
+ if (System.IO.File.Exists(lyricFilePath))
{
- supportedLyricFileExtensions.Add(lyricFileExtension);
+ return lyricFilePath;
}
}
}
}
- foreach (string lyricFileExtension in supportedLyricFileExtensions)
- {
- string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
- if (System.IO.File.Exists(lyricFilePath))
- {
- return lyricFilePath;
- }
- }
-
return null;
}
From 31ec521f5ebfdffc1c38b4c67e7632933041a988 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 11 Sep 2022 19:15:33 -0400
Subject: [PATCH 053/262] Remove now unused variables
---
Jellyfin.Api/Helpers/ItemHelper.cs | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Jellyfin.Api/Helpers/ItemHelper.cs b/Jellyfin.Api/Helpers/ItemHelper.cs
index 0afe5a155d..49bb8af8e3 100644
--- a/Jellyfin.Api/Helpers/ItemHelper.cs
+++ b/Jellyfin.Api/Helpers/ItemHelper.cs
@@ -23,8 +23,6 @@ namespace Jellyfin.Api.Helpers
/// Collection of Lyrics.
internal static object? GetLyricData(BaseItem item)
{
- List providerList = new List();
-
// Find all classes that implement ILyricsProvider Interface
var foundLyricProviders = System.Reflection.Assembly.GetExecutingAssembly()
.GetTypes()
@@ -58,8 +56,6 @@ namespace Jellyfin.Api.Helpers
/// True if item has a matching lyrics file.
public static string? GetLyricFilePath(string itemPath)
{
- List supportedLyricFileExtensions = new List();
-
// Find all classes that implement ILyricsProvider Interface
var foundLyricProviders = System.Reflection.Assembly.GetExecutingAssembly()
.GetTypes()
From d2e18547b16fa30684d7c9ceb8a117d5d9bcef56 Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Sun, 11 Sep 2022 17:47:01 -0600
Subject: [PATCH 054/262] Require properly typed ActionResult (#8382)
---
Jellyfin.Api/BaseJellyfinApiController.cs | 37 +++++++++++++++++++
.../Controllers/ConfigurationController.cs | 1 -
.../Controllers/DlnaServerController.cs | 8 ++--
.../Controllers/MediaInfoController.cs | 1 -
Jellyfin.Api/Controllers/MoviesController.cs | 2 +-
.../Controllers/UserLibraryController.cs | 1 -
.../Controllers/UserViewsController.cs | 10 +----
Jellyfin.Api/Results/OkResultOfT.cs | 21 +++++++++++
8 files changed, 65 insertions(+), 16 deletions(-)
create mode 100644 Jellyfin.Api/Results/OkResultOfT.cs
diff --git a/Jellyfin.Api/BaseJellyfinApiController.cs b/Jellyfin.Api/BaseJellyfinApiController.cs
index 59d6b75137..0c63d24b70 100644
--- a/Jellyfin.Api/BaseJellyfinApiController.cs
+++ b/Jellyfin.Api/BaseJellyfinApiController.cs
@@ -1,4 +1,6 @@
+using System.Collections.Generic;
using System.Net.Mime;
+using Jellyfin.Api.Results;
using Jellyfin.Extensions.Json;
using Microsoft.AspNetCore.Mvc;
@@ -15,5 +17,40 @@ namespace Jellyfin.Api
JsonDefaults.PascalCaseMediaType)]
public class BaseJellyfinApiController : ControllerBase
{
+ ///
+ /// Create a new .
+ ///
+ /// The value to return.
+ /// The type to return.
+ /// The .
+ protected ActionResult> Ok(List value)
+ => new OkResult>(value);
+
+ ///
+ /// Create a new .
+ ///
+ /// The value to return.
+ /// The type to return.
+ /// The .
+ protected ActionResult> Ok(IReadOnlyList value)
+ => new OkResult>(value);
+
+ ///
+ /// Create a new .
+ ///
+ /// The value to return.
+ /// The type to return.
+ /// The .
+ protected ActionResult> Ok(IEnumerable? value)
+ => new OkResult?>(value);
+
+ ///
+ /// Create a new .
+ ///
+ /// The value to return.
+ /// The type to return.
+ /// The .
+ protected ActionResult Ok(T value)
+ => new OkResult(value);
}
}
diff --git a/Jellyfin.Api/Controllers/ConfigurationController.cs b/Jellyfin.Api/Controllers/ConfigurationController.cs
index 464fadc060..bbe1633120 100644
--- a/Jellyfin.Api/Controllers/ConfigurationController.cs
+++ b/Jellyfin.Api/Controllers/ConfigurationController.cs
@@ -2,7 +2,6 @@ using System;
using System.ComponentModel.DataAnnotations;
using System.Net.Mime;
using System.Text.Json;
-using System.Threading.Tasks;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Models.ConfigurationDtos;
diff --git a/Jellyfin.Api/Controllers/DlnaServerController.cs b/Jellyfin.Api/Controllers/DlnaServerController.cs
index 401c0197ac..8859d60207 100644
--- a/Jellyfin.Api/Controllers/DlnaServerController.cs
+++ b/Jellyfin.Api/Controllers/DlnaServerController.cs
@@ -54,7 +54,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status503ServiceUnavailable)]
[Produces(MediaTypeNames.Text.Xml)]
[ProducesFile(MediaTypeNames.Text.Xml)]
- public ActionResult GetDescriptionXml([FromRoute, Required] string serverId)
+ public ActionResult GetDescriptionXml([FromRoute, Required] string serverId)
{
var url = GetAbsoluteUri();
var serverAddress = url.Substring(0, url.IndexOf("/dlna/", StringComparison.OrdinalIgnoreCase));
@@ -77,7 +77,7 @@ namespace Jellyfin.Api.Controllers
[Produces(MediaTypeNames.Text.Xml)]
[ProducesFile(MediaTypeNames.Text.Xml)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
- public ActionResult GetContentDirectory([FromRoute, Required] string serverId)
+ public ActionResult GetContentDirectory([FromRoute, Required] string serverId)
{
return Ok(_contentDirectory.GetServiceXml());
}
@@ -97,7 +97,7 @@ namespace Jellyfin.Api.Controllers
[Produces(MediaTypeNames.Text.Xml)]
[ProducesFile(MediaTypeNames.Text.Xml)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
- public ActionResult GetMediaReceiverRegistrar([FromRoute, Required] string serverId)
+ public ActionResult GetMediaReceiverRegistrar([FromRoute, Required] string serverId)
{
return Ok(_mediaReceiverRegistrar.GetServiceXml());
}
@@ -117,7 +117,7 @@ namespace Jellyfin.Api.Controllers
[Produces(MediaTypeNames.Text.Xml)]
[ProducesFile(MediaTypeNames.Text.Xml)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
- public ActionResult GetConnectionManager([FromRoute, Required] string serverId)
+ public ActionResult GetConnectionManager([FromRoute, Required] string serverId)
{
return Ok(_connectionManager.GetServiceXml());
}
diff --git a/Jellyfin.Api/Controllers/MediaInfoController.cs b/Jellyfin.Api/Controllers/MediaInfoController.cs
index 75df18204d..d2852ed011 100644
--- a/Jellyfin.Api/Controllers/MediaInfoController.cs
+++ b/Jellyfin.Api/Controllers/MediaInfoController.cs
@@ -12,7 +12,6 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
-using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.MediaInfo;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
diff --git a/Jellyfin.Api/Controllers/MoviesController.cs b/Jellyfin.Api/Controllers/MoviesController.cs
index 420dd99233..4669447049 100644
--- a/Jellyfin.Api/Controllers/MoviesController.cs
+++ b/Jellyfin.Api/Controllers/MoviesController.cs
@@ -170,7 +170,7 @@ namespace Jellyfin.Api.Controllers
}
}
- return Ok(categories.OrderBy(i => i.RecommendationType));
+ return Ok(categories.OrderBy(i => i.RecommendationType).AsEnumerable());
}
private IEnumerable GetWithDirector(
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index e45f9b58cd..1656a1e98c 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -8,7 +8,6 @@ using Jellyfin.Api.Constants;
using Jellyfin.Api.Extensions;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Data.Enums;
-using Jellyfin.Extensions;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
diff --git a/Jellyfin.Api/Controllers/UserViewsController.cs b/Jellyfin.Api/Controllers/UserViewsController.cs
index 5cc8c906fb..04732ccf25 100644
--- a/Jellyfin.Api/Controllers/UserViewsController.cs
+++ b/Jellyfin.Api/Controllers/UserViewsController.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
-using System.Threading.Tasks;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Extensions;
using Jellyfin.Api.ModelBinders;
@@ -11,9 +10,7 @@ using Jellyfin.Api.Models.UserViewDtos;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Library;
using MediaBrowser.Model.Querying;
using Microsoft.AspNetCore.Authorization;
@@ -32,7 +29,6 @@ namespace Jellyfin.Api.Controllers
private readonly IUserManager _userManager;
private readonly IUserViewManager _userViewManager;
private readonly IDtoService _dtoService;
- private readonly IAuthorizationContext _authContext;
private readonly ILibraryManager _libraryManager;
///
@@ -41,19 +37,16 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
public UserViewsController(
IUserManager userManager,
IUserViewManager userViewManager,
IDtoService dtoService,
- IAuthorizationContext authContext,
ILibraryManager libraryManager)
{
_userManager = userManager;
_userViewManager = userViewManager;
_dtoService = dtoService;
- _authContext = authContext;
_libraryManager = libraryManager;
}
@@ -138,7 +131,8 @@ namespace Jellyfin.Api.Controllers
Name = i.Name,
Id = i.Id.ToString("N", CultureInfo.InvariantCulture)
})
- .OrderBy(i => i.Name));
+ .OrderBy(i => i.Name)
+ .AsEnumerable());
}
}
}
diff --git a/Jellyfin.Api/Results/OkResultOfT.cs b/Jellyfin.Api/Results/OkResultOfT.cs
new file mode 100644
index 0000000000..f60cbbceea
--- /dev/null
+++ b/Jellyfin.Api/Results/OkResultOfT.cs
@@ -0,0 +1,21 @@
+#pragma warning disable SA1649 // File name should match type name.
+
+using Microsoft.AspNetCore.Mvc;
+
+namespace Jellyfin.Api.Results;
+
+///
+/// Ok result with type specified.
+///
+/// The type to return.
+public class OkResult : OkObjectResult
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The value to return.
+ public OkResult(T value)
+ : base(value)
+ {
+ }
+}
From 2d57e71b4446df7274ae3a9bc45421f890c1bdd2 Mon Sep 17 00:00:00 2001
From: Bond-009
Date: Mon, 12 Sep 2022 01:56:41 +0200
Subject: [PATCH 055/262] Don't allow throwing System.Exception (#8378)
---
.../LiveTv/EmbyTV/EmbyTV.cs | 2 +-
.../LiveTv/EmbyTV/EncodedRecorder.cs | 3 ++-
.../LiveTv/Listings/SchedulesDirect.cs | 18 ++++++++----------
Emby.Server.Implementations/Net/UdpSocket.cs | 4 ++--
jellyfin.ruleset | 2 ++
5 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 2753cf1778..065309688c 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -995,7 +995,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- throw new Exception("Tuner not found.");
+ throw new ResourceNotFoundException("Tuner not found.");
}
public async Task> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken)
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
index 6e05598410..08534de59d 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
@@ -13,6 +13,7 @@ using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Extensions;
using Jellyfin.Extensions.Json;
+using MediaBrowser.Common;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
@@ -297,7 +298,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
else
{
_taskCompletionSource.TrySetException(
- new Exception(
+ new FfmpegException(
string.Format(
CultureInfo.InvariantCulture,
"Recording for {0} failed. Exit code {1}",
diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index ffa0d9b6a0..4311db28d2 100644
--- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
+++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
@@ -20,6 +20,7 @@ using Emby.Server.Implementations.LiveTv.Listings.SchedulesDirectDtos;
using Jellyfin.Extensions;
using Jellyfin.Extensions.Json;
using MediaBrowser.Common.Net;
+using MediaBrowser.Controller.Authentication;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
@@ -591,13 +592,10 @@ namespace Emby.Server.Implementations.LiveTv.Listings
}
catch (HttpRequestException ex)
{
- if (ex.StatusCode.HasValue)
+ if (ex.StatusCode.HasValue && ex.StatusCode.Value == HttpStatusCode.BadRequest)
{
- if ((int)ex.StatusCode.Value == 400)
- {
- _tokens.Clear();
- _lastErrorResponse = DateTime.UtcNow;
- }
+ _tokens.Clear();
+ _lastErrorResponse = DateTime.UtcNow;
}
throw;
@@ -662,7 +660,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
return root.Token;
}
- throw new Exception("Could not authenticate with Schedules Direct Error: " + root.Message);
+ throw new AuthenticationException("Could not authenticate with Schedules Direct Error: " + root.Message);
}
private async Task AddLineupToAccount(ListingsProviderInfo info, CancellationToken cancellationToken)
@@ -697,7 +695,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
if (string.IsNullOrEmpty(token))
{
- throw new Exception("token required");
+ throw new ArgumentException("token required");
}
_logger.LogInformation("Headends on account ");
@@ -768,14 +766,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings
var listingsId = info.ListingsId;
if (string.IsNullOrEmpty(listingsId))
{
- throw new Exception("ListingsId required");
+ throw new ArgumentException("ListingsId required");
}
var token = await GetToken(info, cancellationToken).ConfigureAwait(false);
if (string.IsNullOrEmpty(token))
{
- throw new Exception("token required");
+ throw new ArgumentException("token required");
}
using var options = new HttpRequestMessage(HttpMethod.Get, ApiUrl + "/lineups/" + listingsId);
diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.cs
index bbbca4fc08..2c20daa57f 100644
--- a/Emby.Server.Implementations/Net/UdpSocket.cs
+++ b/Emby.Server.Implementations/Net/UdpSocket.cs
@@ -96,7 +96,7 @@ namespace Emby.Server.Implementations.Net
}
else
{
- tcs.TrySetException(new Exception("SocketError: " + e.SocketError));
+ tcs.TrySetException(new SocketException((int)e.SocketError));
}
}
}
@@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.Net
}
else
{
- tcs.TrySetException(new Exception("SocketError: " + e.SocketError));
+ tcs.TrySetException(new SocketException((int)e.SocketError));
}
}
}
diff --git a/jellyfin.ruleset b/jellyfin.ruleset
index 1c834de822..5ac5f49239 100644
--- a/jellyfin.ruleset
+++ b/jellyfin.ruleset
@@ -84,6 +84,8 @@
+
+
From 2c52741f1d509d19d05a35e03a775d18d6f35707 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 12 Sep 2022 12:01:39 +0000
Subject: [PATCH 056/262] Bump Serilog.Sinks.Console from 4.0.1 to 4.1.0
Bumps [Serilog.Sinks.Console](https://github.com/serilog/serilog-sinks-console) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/serilog/serilog-sinks-console/releases)
- [Commits](https://github.com/serilog/serilog-sinks-console/compare/v4.0.1...v4.1.0)
---
updated-dependencies:
- dependency-name: Serilog.Sinks.Console
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Server/Jellyfin.Server.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index 4474a6d122..a0845a0a8a 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -45,7 +45,7 @@
-
+
From 61fa325ef05daac7c5105623d2de435ec94ef6a7 Mon Sep 17 00:00:00 2001
From: Shadowghost
Date: Mon, 28 Mar 2022 23:11:21 +0200
Subject: [PATCH 057/262] Extend music parsing
---
Emby.Naming/Common/NamingOptions.cs | 23 +++
.../Resolvers/Audio/MusicAlbumResolver.cs | 11 +-
.../Entities/Audio/MusicAlbum.cs | 2 +-
.../MediaBrowser.Providers.csproj | 1 +
.../MediaInfo/FFProbeAudioInfo.cs | 127 +++++++++------
.../Music/AlbumMetadataService.cs | 152 ++++++++++++++++--
.../Music/AudioMetadataService.cs | 40 +++++
7 files changed, 291 insertions(+), 65 deletions(-)
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs
index e016d7e51f..ddeec679d4 100644
--- a/Emby.Naming/Common/NamingOptions.cs
+++ b/Emby.Naming/Common/NamingOptions.cs
@@ -181,6 +181,24 @@ namespace Emby.Naming.Common
"volume"
};
+ ArtistSubfolders = new[]
+ {
+ "albums",
+ "broadcasts",
+ "bootlegs",
+ "compilations",
+ "dj-mixes",
+ "eps",
+ "live",
+ "mixtapes",
+ "others",
+ "remixes",
+ "singles",
+ "soundtracks",
+ "spokenwords",
+ "streets"
+ };
+
AudioFileExtensions = new[]
{
".669",
@@ -732,6 +750,11 @@ namespace Emby.Naming.Common
///
public string[] AlbumStackingPrefixes { get; set; }
+ ///
+ /// Gets or sets list of artist subfolders.
+ ///
+ public string[] ArtistSubfolders { get; set; }
+
///
/// Gets or sets list of subtitle file extensions.
///
diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
index da00b9cfa8..5e05ddfb16 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -98,7 +99,15 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
// Args points to an album if parent is an Artist folder or it directly contains music
if (args.IsDirectory)
{
- // if (args.Parent is MusicArtist) return true; // saves us from testing children twice
+ foreach (var subfolder in _namingOptions.ArtistSubfolders)
+ {
+ if (Path.GetDirectoryName(args.Path.AsSpan()).Equals(subfolder, StringComparison.OrdinalIgnoreCase))
+ {
+ _logger.LogDebug("Found release folder: {Path}", args.Path);
+ return false;
+ }
+ }
+
if (ContainsMusic(args.FileSystemChildren, true, args.DirectoryService))
{
return true;
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
index bd397bdd13..6555de8554 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -54,7 +54,7 @@ namespace MediaBrowser.Controller.Entities.Audio
public string AlbumArtist => AlbumArtists.FirstOrDefault();
[JsonIgnore]
- public override bool SupportsPeople => false;
+ public override bool SupportsPeople => true;
///
/// Gets the tracks.
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 9864db9ac2..459045dffc 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -22,6 +22,7 @@
+
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs
index f22965436f..e801a20efb 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -17,6 +18,7 @@ using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
+using TagLib;
namespace MediaBrowser.Providers.MediaInfo
{
@@ -93,7 +95,7 @@ namespace MediaBrowser.Providers.MediaInfo
// var extension = (Path.GetExtension(audio.Path) ?? string.Empty).TrimStart('.');
// audio.Container = extension;
- FetchDataFromTags(audio, mediaInfo);
+ FetchDataFromTags(audio);
_itemRepo.SaveMediaStreams(audio.Id, mediaInfo.MediaStreams, cancellationToken);
}
@@ -102,71 +104,90 @@ namespace MediaBrowser.Providers.MediaInfo
/// Fetches data from the tags dictionary.
///
/// The audio.
- /// The data.
- private void FetchDataFromTags(Audio audio, Model.MediaInfo.MediaInfo data)
+ private void FetchDataFromTags(Audio audio)
{
- // Only set Name if title was found in the dictionary
- if (!string.IsNullOrEmpty(data.Name))
+ var file = TagLib.File.Create(audio.Path);
+ var tagTypes = file.TagTypesOnDisk;
+ Tag tags = null;
+
+ if (tagTypes.HasFlag(TagTypes.Id3v2))
{
- audio.Name = data.Name;
+ tags = file.GetTag(TagTypes.Id3v2);
+ }
+ else if (tagTypes.HasFlag(TagTypes.Ape))
+ {
+ tags = file.GetTag(TagTypes.Ape);
+ }
+ else if (tagTypes.HasFlag(TagTypes.FlacMetadata))
+ {
+ tags = file.GetTag(TagTypes.FlacMetadata);
+ }
+ else if (tagTypes.HasFlag(TagTypes.Id3v1))
+ {
+ tags = file.GetTag(TagTypes.Id3v1);
}
- if (!string.IsNullOrEmpty(data.ForcedSortName))
+ if (tags != null)
{
- audio.ForcedSortName = data.ForcedSortName;
- }
-
- if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast))
- {
- var people = new List();
-
- foreach (var person in data.People)
+ if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast))
{
- PeopleHelper.AddPerson(people, new PersonInfo
+ var people = new List();
+ var albumArtists = tags.AlbumArtists;
+ foreach (var albumArtist in albumArtists)
{
- Name = person.Name,
- Type = person.Type,
- Role = person.Role
- });
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = albumArtist,
+ Type = "AlbumArtist"
+ });
+ }
+
+ var performers = tags.Performers;
+ foreach (var performer in performers)
+ {
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = performer,
+ Type = "Artist"
+ });
+ }
+
+ foreach (var composer in tags.Composers)
+ {
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = composer,
+ Type = "Composer"
+ });
+ }
+
+ _libraryManager.UpdatePeople(audio, people);
+ audio.Artists = performers;
+ audio.AlbumArtists = albumArtists;
}
- _libraryManager.UpdatePeople(audio, people);
- }
-
- audio.Album = data.Album;
- audio.Artists = data.Artists;
- audio.AlbumArtists = data.AlbumArtists;
- audio.IndexNumber = data.IndexNumber;
- audio.ParentIndexNumber = data.ParentIndexNumber;
- audio.ProductionYear = data.ProductionYear;
- audio.PremiereDate = data.PremiereDate;
-
- // If we don't have a ProductionYear try and get it from PremiereDate
- if (audio.PremiereDate.HasValue && !audio.ProductionYear.HasValue)
- {
- audio.ProductionYear = audio.PremiereDate.Value.ToLocalTime().Year;
- }
-
- if (!audio.LockedFields.Contains(MetadataField.Genres))
- {
- audio.Genres = Array.Empty();
-
- foreach (var genre in data.Genres)
+ audio.Name = tags.Title;
+ audio.Album = tags.Album;
+ audio.IndexNumber = Convert.ToInt32(tags.Track);
+ audio.ParentIndexNumber = Convert.ToInt32(tags.Disc);
+ if(tags.Year != 0)
{
- audio.AddGenre(genre);
+ var year = Convert.ToInt32(tags.Year);
+ audio.ProductionYear = year;
+ audio.PremiereDate = new DateTime(year, 01, 01);
}
- }
- if (!audio.LockedFields.Contains(MetadataField.Studios))
- {
- audio.SetStudios(data.Studios);
- }
+ if (!audio.LockedFields.Contains(MetadataField.Genres))
+ {
+ audio.Genres = tags.Genres.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
+ }
- audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, data.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist));
- audio.SetProviderId(MetadataProvider.MusicBrainzArtist, data.GetProviderId(MetadataProvider.MusicBrainzArtist));
- audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, data.GetProviderId(MetadataProvider.MusicBrainzAlbum));
- audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, data.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup));
- audio.SetProviderId(MetadataProvider.MusicBrainzTrack, data.GetProviderId(MetadataProvider.MusicBrainzTrack));
+ audio.SetProviderId(MetadataProvider.MusicBrainzArtist, tags.MusicBrainzArtistId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, tags.MusicBrainzReleaseArtistId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, tags.MusicBrainzReleaseId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, tags.MusicBrainzReleaseGroupId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzTrack, tags.MusicBrainzTrackId);
+ }
}
}
}
diff --git a/MediaBrowser.Providers/Music/AlbumMetadataService.cs b/MediaBrowser.Providers/Music/AlbumMetadataService.cs
index 7743d3b27b..b8426f31c1 100644
--- a/MediaBrowser.Providers/Music/AlbumMetadataService.cs
+++ b/MediaBrowser.Providers/Music/AlbumMetadataService.cs
@@ -61,40 +61,61 @@ namespace MediaBrowser.Providers.Music
var songs = children.Cast
/// The args.
- /// true if [is music album] [the specified args]; otherwise, false.
+ /// true if [is music album] [the specified args], false otherwise.
private bool IsMusicAlbum(ItemResolveArgs args)
{
- // Args points to an album if parent is an Artist folder or it directly contains music
if (args.IsDirectory)
{
+ // If args is a artist subfolder it's not a music album
foreach (var subfolder in _namingOptions.ArtistSubfolders)
{
if (Path.GetDirectoryName(args.Path.AsSpan()).Equals(subfolder, StringComparison.OrdinalIgnoreCase))
@@ -108,6 +108,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
}
}
+ // If args contains music it's a music album
if (ContainsMusic(args.FileSystemChildren, true, args.DirectoryService))
{
return true;
@@ -120,22 +121,23 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
///
/// Determine if the supplied list contains what we should consider music.
///
+ /// true if the provided path list contains music, false otherwise.
private bool ContainsMusic(
ICollection list,
bool allowSubfolders,
IDirectoryService directoryService)
{
- // check for audio files before digging down into directories
+ // Check for audio files before digging down into directories
var foundAudioFile = list.Any(fileSystemInfo => !fileSystemInfo.IsDirectory && AudioFileParser.IsAudioFile(fileSystemInfo.FullName, _namingOptions));
if (foundAudioFile)
{
- // at least one audio file exists
+ // At least one audio file exists
return true;
}
if (!allowSubfolders)
{
- // not music since no audio file exists and we're not looking into subfolders
+ // Not music since no audio file exists and we're not looking into subfolders
return false;
}
diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
index b7c1724c07..2538c2b5b4 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
@@ -13,7 +13,7 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
///
- /// Class MusicArtistResolver.
+ /// The music artist resolver.
///
public class MusicArtistResolver : ItemResolver
{
@@ -23,8 +23,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
///
/// Initializes a new instance of the class.
///
- /// The logger for the created instances.
- /// The naming options.
+ /// Instance of the interface.
+ /// The .
public MusicArtistResolver(
ILogger logger,
NamingOptions namingOptions)
@@ -40,10 +40,10 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
public override ResolverPriority Priority => ResolverPriority.Second;
///
- /// Resolves the specified args.
+ /// Resolves the specified resolver arguments.
///
- /// The args.
- /// MusicArtist.
+ /// The resolver arguments.
+ /// A .
protected override MusicArtist Resolve(ItemResolveArgs args)
{
if (!args.IsDirectory)
@@ -82,23 +82,24 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var albumResolver = new MusicAlbumResolver(_logger, _namingOptions);
- // If we contain an album assume we are an artist folder
var directories = args.FileSystemChildren.Where(i => i.IsDirectory);
var result = Parallel.ForEach(directories, (fileSystemInfo, state) =>
{
+ // If we contain a artist subfolder assume we are an artist folder
foreach (var subfolder in _namingOptions.ArtistSubfolders)
{
if (fileSystemInfo.Name.Equals(subfolder, StringComparison.OrdinalIgnoreCase))
{
- // stop once we see a artist subfolder
+ // Stop once we see an artist subfolder
state.Stop();
}
}
+ // If we contain a music album assume we are an artist folder
if (albumResolver.IsMusicAlbum(fileSystemInfo.FullName, directoryService))
{
- // stop once we see a music album
+ // Stop once we see a music album
state.Stop();
}
});
diff --git a/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs b/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs
index 32a9cbef2e..14428df5b3 100644
--- a/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs
+++ b/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs
@@ -18,9 +18,9 @@ namespace MediaBrowser.Controller.Providers
/// Fetches the metadata asynchronously.
///
/// The item.
- /// The options.
- /// The cancellation token.
- /// Task{ItemUpdateType}.
+ /// The .
+ /// The .
+ /// A fetching the .
Task FetchAsync(TItemType item, MetadataRefreshOptions options, CancellationToken cancellationToken);
}
}
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
index 2591e880f6..2b26b31379 100644
--- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
+++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
@@ -1,7 +1,5 @@
#nullable disable
-#pragma warning disable CS1591
-
using System;
using System.Collections.Generic;
using System.Linq;
@@ -21,6 +19,9 @@ using TagLib;
namespace MediaBrowser.Providers.MediaInfo
{
+ ///
+ /// Probes audio files for metadata.
+ ///
public class AudioFileProber
{
private readonly IMediaEncoder _mediaEncoder;
@@ -28,6 +29,13 @@ namespace MediaBrowser.Providers.MediaInfo
private readonly ILibraryManager _libraryManager;
private readonly IMediaSourceManager _mediaSourceManager;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
public AudioFileProber(
IMediaSourceManager mediaSourceManager,
IMediaEncoder mediaEncoder,
@@ -40,6 +48,14 @@ namespace MediaBrowser.Providers.MediaInfo
_mediaSourceManager = mediaSourceManager;
}
+ ///
+ /// Probes the specified item for metadata.
+ ///
+ /// The item to probe.
+ /// The .
+ /// The .
+ /// The type of item to resolve.
+ /// A probing the item for metadata.
public async Task Probe(
T item,
MetadataRefreshOptions options,
@@ -80,9 +96,9 @@ namespace MediaBrowser.Providers.MediaInfo
///
/// Fetches the specified audio.
///
- /// The audio.
- /// The media information.
- /// The cancellation token.
+ /// The .
+ /// The .
+ /// The .
protected void Fetch(Audio audio, Model.MediaInfo.MediaInfo mediaInfo, CancellationToken cancellationToken)
{
audio.Container = mediaInfo.Container;
@@ -91,18 +107,15 @@ namespace MediaBrowser.Providers.MediaInfo
audio.RunTimeTicks = mediaInfo.RunTimeTicks;
audio.Size = mediaInfo.Size;
- // var extension = (Path.GetExtension(audio.Path) ?? string.Empty).TrimStart('.');
- // audio.Container = extension;
-
FetchDataFromTags(audio);
_itemRepo.SaveMediaStreams(audio.Id, mediaInfo.MediaStreams, cancellationToken);
}
///
- /// Fetches data from the tags dictionary.
+ /// Fetches data from the tags.
///
- /// The audio.
+ /// The .
private void FetchDataFromTags(Audio audio)
{
var file = TagLib.File.Create(audio.Path);
diff --git a/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
index 54c12a8f17..6591366076 100644
--- a/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
@@ -1,7 +1,5 @@
#nullable disable
-#pragma warning disable CS1591
-
using System;
using System.IO;
using System.Linq;
@@ -27,6 +25,9 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.MediaInfo
{
+ ///
+ /// The probe provider.
+ ///
public class ProbeProvider : ICustomMetadataProvider,
ICustomMetadataProvider,
ICustomMetadataProvider,
@@ -46,6 +47,22 @@ namespace MediaBrowser.Providers.MediaInfo
private readonly AudioFileProber _audioProber;
private readonly Task _cachedTask = Task.FromResult(ItemUpdateType.None);
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the .
+ /// Instance of the interface.
+ /// The .
public ProbeProvider(
IMediaSourceManager mediaSourceManager,
IMediaEncoder mediaEncoder,
@@ -81,11 +98,13 @@ namespace MediaBrowser.Providers.MediaInfo
_subtitleResolver);
}
- public string Name => "filemetadataprober";
+ ///
+ public string Name => "Probe Provider";
- // Run last
+ ///
public int Order => 100;
+ ///
public bool HasChanged(BaseItem item, IDirectoryService directoryService)
{
var video = item as Video;
@@ -127,41 +146,56 @@ namespace MediaBrowser.Providers.MediaInfo
return false;
}
+ ///
public Task FetchAsync(Episode item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(MusicVideo item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Movie item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Trailer item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Video item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Audio item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchAudioInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(AudioBook item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchAudioInfo(item, options, cancellationToken);
}
+ ///
+ /// Fetches video information for an item.
+ ///
+ /// The item.
+ /// The .
+ /// The .
+ /// The type of item to resolve.
+ /// A fetching the for an item.
public Task FetchVideoInfo(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
where T : Video
{
@@ -208,6 +242,14 @@ namespace MediaBrowser.Providers.MediaInfo
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i) && !i.StartsWith('#'));
}
+ ///
+ /// Fetches audio information for an item.
+ ///
+ /// The item.
+ /// The .
+ /// The .
+ /// The type of item to resolve.
+ /// A fetching the for an item.
public Task FetchAudioInfo(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
where T : Audio
{
diff --git a/MediaBrowser.Providers/Music/AlbumMetadataService.cs b/MediaBrowser.Providers/Music/AlbumMetadataService.cs
index b8426f31c1..1a8e20be32 100644
--- a/MediaBrowser.Providers/Music/AlbumMetadataService.cs
+++ b/MediaBrowser.Providers/Music/AlbumMetadataService.cs
@@ -1,5 +1,3 @@
-#pragma warning disable CS1591
-
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,8 +13,19 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Music
{
+ ///
+ /// The album metadata service.
+ ///
public class AlbumMetadataService : MetadataService
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the .
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
public AlbumMetadataService(
IServerConfigurationManager serverConfigurationManager,
ILogger logger,
diff --git a/MediaBrowser.Providers/Music/AudioMetadataService.cs b/MediaBrowser.Providers/Music/AudioMetadataService.cs
index 64f40ef49f..7c38d0bcf5 100644
--- a/MediaBrowser.Providers/Music/AudioMetadataService.cs
+++ b/MediaBrowser.Providers/Music/AudioMetadataService.cs
@@ -1,5 +1,3 @@
-#pragma warning disable CS1591
-
using System;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities.Audio;
@@ -12,8 +10,19 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Music
{
+ ///
+ /// The audio metadata service.
+ ///
public class AudioMetadataService : MetadataService
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the .
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
public AudioMetadataService(
IServerConfigurationManager serverConfigurationManager,
ILogger logger,
From c71d6f2358ba8a5b1f80a2bef41b6f438c06d03c Mon Sep 17 00:00:00 2001
From: Zach Phelan
Date: Tue, 13 Sep 2022 16:40:47 -0600
Subject: [PATCH 061/262] Sort special features same as other spots, removing
unnecssary function
Added to contributors
---
CONTRIBUTORS.md | 1 +
Jellyfin.Api/Controllers/UserLibraryController.cs | 3 ++-
MediaBrowser.Controller/Entities/BaseItem.cs | 13 -------------
3 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 98acd4449f..8daaae4d94 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -148,6 +148,7 @@
- [xosdy](https://github.com/xosdy)
- [XVicarious](https://github.com/XVicarious)
- [YouKnowBlom](https://github.com/YouKnowBlom)
+ - [ZachPhelan](https://github.com/ZachPhelan)
- [KristupasSavickas](https://github.com/KristupasSavickas)
- [Pusta](https://github.com/pusta)
- [nielsvanvelzen](https://github.com/nielsvanvelzen)
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 1656a1e98c..940fa27a70 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -233,7 +233,8 @@ namespace Jellyfin.Api.Controllers
var dtoOptions = new DtoOptions().AddClientFields(Request);
return Ok(item
- .GetExtras(BaseItem.DisplayExtraTypes)
+ .GetExtras()
+ .Where(i => i.ExtraType.HasValue && BaseItem.DisplayExtraTypes.Contains(i.ExtraType.Value))
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)));
}
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 5cee6ce406..988d0a534a 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -2606,19 +2606,6 @@ namespace MediaBrowser.Controller.Entities
.OrderBy(i => i.SortName);
}
- ///
- /// Get all extras with specific types that are associated with this item.
- ///
- /// The types of extras to retrieve.
- /// An enumerable containing the extras.
- public IEnumerable GetExtras(IReadOnlyCollection extraTypes)
- {
- return ExtraIds
- .Select(LibraryManager.GetItemById)
- .Where(i => i != null)
- .Where(i => i.ExtraType.HasValue && extraTypes.Contains(i.ExtraType.Value));
- }
-
public virtual long GetRunTimeTicksForPlayState()
{
return RunTimeTicks ?? 0;
From 8857edb66cbc0260981aa1aa3542da495e1b2443 Mon Sep 17 00:00:00 2001
From: Zach Phelan
Date: Tue, 13 Sep 2022 17:13:02 -0600
Subject: [PATCH 062/262] Add function back for compatibility, add sorting
---
MediaBrowser.Controller/Entities/BaseItem.cs | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 988d0a534a..9461b01e31 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -2606,6 +2606,20 @@ namespace MediaBrowser.Controller.Entities
.OrderBy(i => i.SortName);
}
+ ///
+ /// Get all extras with specific types that are associated with this item.
+ ///
+ /// The types of extras to retrieve.
+ /// An enumerable containing the extras.
+ public IEnumerable GetExtras(IReadOnlyCollection extraTypes)
+ {
+ return ExtraIds
+ .Select(LibraryManager.GetItemById)
+ .Where(i => i != null)
+ .Where(i => i.ExtraType.HasValue && extraTypes.Contains(i.ExtraType.Value))
+ .OrderBy(i => i.SortName);
+ }
+
public virtual long GetRunTimeTicksForPlayState()
{
return RunTimeTicks ?? 0;
From b01a61ce430606226b4cc5084a2863e8e8e68bdc Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Wed, 14 Sep 2022 01:17:27 +0200
Subject: [PATCH 063/262] Remove libraspberrypi0 package from arm Dockerfile
---
Dockerfile.arm | 1 -
1 file changed, 1 deletion(-)
diff --git a/Dockerfile.arm b/Dockerfile.arm
index 8da17ee5fc..69d57194d4 100644
--- a/Dockerfile.arm
+++ b/Dockerfile.arm
@@ -40,7 +40,6 @@ RUN apt-get update \
libfreetype6 \
libomxil-bellagio0 \
libomxil-bellagio-bin \
- libraspberrypi0 \
vainfo \
libva2 \
locales \
From d75c699ad4568fb2546588497c201fd6e4830477 Mon Sep 17 00:00:00 2001
From: Robin Schneider
Date: Wed, 14 Sep 2022 01:34:21 +0200
Subject: [PATCH 064/262] Drop transitional package apt-transport-https (#5950)
---
Dockerfile | 4 ++--
deployment/Dockerfile.debian.amd64 | 2 +-
deployment/Dockerfile.debian.arm64 | 2 +-
deployment/Dockerfile.debian.armhf | 2 +-
deployment/Dockerfile.linux.amd64 | 2 +-
deployment/Dockerfile.linux.amd64-musl | 2 +-
deployment/Dockerfile.linux.arm64 | 2 +-
deployment/Dockerfile.linux.armhf | 2 +-
deployment/Dockerfile.macos | 2 +-
deployment/Dockerfile.portable | 2 +-
deployment/Dockerfile.ubuntu.amd64 | 2 +-
deployment/Dockerfile.ubuntu.arm64 | 2 +-
deployment/Dockerfile.ubuntu.armhf | 2 +-
deployment/Dockerfile.windows.amd64 | 2 +-
14 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 5ca233b8ff..219b958935 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -31,7 +31,7 @@ ARG LEVEL_ZERO_VERSION=1.3.22549
# mesa-va-drivers: needed for AMD VAAPI. Mesa >= 20.1 is required for HEVC transcoding.
# curl: healthcheck
RUN apt-get update \
- && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gnupg wget apt-transport-https curl \
+ && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gnupg wget curl \
&& wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add - \
&& echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list \
&& apt-get update \
@@ -53,7 +53,7 @@ RUN apt-get update \
&& dpkg -i *.deb \
&& cd .. \
&& rm -rf intel-compute-runtime \
- && apt-get remove gnupg wget apt-transport-https -y \
+ && apt-get remove gnupg wget -y \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
diff --git a/deployment/Dockerfile.debian.amd64 b/deployment/Dockerfile.debian.amd64
index daba0eb7d1..c7bb5f7687 100644
--- a/deployment/Dockerfile.debian.amd64
+++ b/deployment/Dockerfile.debian.amd64
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts build-essential mmv \
+ debhelper gnupg devscripts build-essential mmv \
libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev \
libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.debian.arm64 b/deployment/Dockerfile.debian.arm64
index db4e7f8178..a0ca9b3f35 100644
--- a/deployment/Dockerfile.debian.arm64
+++ b/deployment/Dockerfile.debian.arm64
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts build-essential mmv
+ debhelper gnupg devscripts build-essential mmv
# Prepare the cross-toolchain
RUN dpkg --add-architecture arm64 \
diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf
index 9b008e7fb0..42a55ebfee 100644
--- a/deployment/Dockerfile.debian.armhf
+++ b/deployment/Dockerfile.debian.armhf
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts build-essential mmv
+ debhelper gnupg devscripts build-essential mmv
# Prepare the cross-toolchain
RUN dpkg --add-architecture armhf \
diff --git a/deployment/Dockerfile.linux.amd64 b/deployment/Dockerfile.linux.amd64
index 2c7e41cace..14b580d11d 100644
--- a/deployment/Dockerfile.linux.amd64
+++ b/deployment/Dockerfile.linux.amd64
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts unzip \
+ debhelper gnupg devscripts unzip \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.linux.amd64-musl b/deployment/Dockerfile.linux.amd64-musl
index e903cf1d32..672c3f2696 100644
--- a/deployment/Dockerfile.linux.amd64-musl
+++ b/deployment/Dockerfile.linux.amd64-musl
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts unzip \
+ debhelper gnupg devscripts unzip \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.linux.arm64 b/deployment/Dockerfile.linux.arm64
index 0dd3c5e4e8..f2a178be37 100644
--- a/deployment/Dockerfile.linux.arm64
+++ b/deployment/Dockerfile.linux.arm64
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts unzip \
+ debhelper gnupg devscripts unzip \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.linux.armhf b/deployment/Dockerfile.linux.armhf
index 16a8218e18..025716f457 100644
--- a/deployment/Dockerfile.linux.armhf
+++ b/deployment/Dockerfile.linux.armhf
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts unzip \
+ debhelper gnupg devscripts unzip \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.macos b/deployment/Dockerfile.macos
index 699ab2d408..f63dc29065 100644
--- a/deployment/Dockerfile.macos
+++ b/deployment/Dockerfile.macos
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts \
+ debhelper gnupg devscripts \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.portable b/deployment/Dockerfile.portable
index b567d7bcea..e48e2d41a0 100644
--- a/deployment/Dockerfile.portable
+++ b/deployment/Dockerfile.portable
@@ -11,7 +11,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts \
+ debhelper gnupg devscripts \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64
index 313a3e5cb4..7863d13131 100644
--- a/deployment/Dockerfile.ubuntu.amd64
+++ b/deployment/Dockerfile.ubuntu.amd64
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg wget ca-certificates devscripts \
+ debhelper gnupg wget ca-certificates devscripts \
mmv build-essential libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64
index 693ee7c276..206caea110 100644
--- a/deployment/Dockerfile.ubuntu.arm64
+++ b/deployment/Dockerfile.ubuntu.arm64
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg wget ca-certificates devscripts \
+ debhelper gnupg wget ca-certificates devscripts \
mmv build-essential lsb-release
# Install dotnet repository
diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf
index e7765a5b27..5bd1a5638e 100644
--- a/deployment/Dockerfile.ubuntu.armhf
+++ b/deployment/Dockerfile.ubuntu.armhf
@@ -12,7 +12,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg wget ca-certificates devscripts \
+ debhelper gnupg wget ca-certificates devscripts \
mmv build-essential lsb-release
# Install dotnet repository
diff --git a/deployment/Dockerfile.windows.amd64 b/deployment/Dockerfile.windows.amd64
index b9543a7c91..655300d477 100644
--- a/deployment/Dockerfile.windows.amd64
+++ b/deployment/Dockerfile.windows.amd64
@@ -11,7 +11,7 @@ ENV IS_DOCKER=YES
# Prepare Debian build environment
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
- apt-transport-https debhelper gnupg devscripts unzip \
+ debhelper gnupg devscripts unzip \
mmv libcurl4-openssl-dev libfontconfig1-dev \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip
From f5819a303941eb2005ed3a2e3d6cf99f2de60c09 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Wed, 14 Sep 2022 19:48:24 +0200
Subject: [PATCH 065/262] Remove libomxil-bellagio0 libomxil-bellagio-bin
packages from arm Dockerfile
---
Dockerfile.arm | 2 --
1 file changed, 2 deletions(-)
diff --git a/Dockerfile.arm b/Dockerfile.arm
index 69d57194d4..8e0ba7af53 100644
--- a/Dockerfile.arm
+++ b/Dockerfile.arm
@@ -38,8 +38,6 @@ RUN apt-get update \
libssl-dev \
libfontconfig1 \
libfreetype6 \
- libomxil-bellagio0 \
- libomxil-bellagio-bin \
vainfo \
libva2 \
locales \
From 216e5882f64789ce23c16db2de379cd56e82c469 Mon Sep 17 00:00:00 2001
From: Hannes Braun
Date: Wed, 14 Sep 2022 23:10:11 +0200
Subject: [PATCH 066/262] Fix HTML for badges in README
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index a5b57d537d..8cffe211c7 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
-
+
@@ -36,10 +36,10 @@
-
+
-
+
From 4742215ac98d69db9f584b65c11d545ce10c7f97 Mon Sep 17 00:00:00 2001
From: Deyao Chen
Date: Tue, 13 Sep 2022 21:14:22 +0000
Subject: [PATCH 067/262] Translated using Weblate (Chinese (Traditional, Hong
Kong)) Translation: Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/zh_Hant_HK/
---
Emby.Server.Implementations/Localization/Core/zh-HK.json | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/zh-HK.json b/Emby.Server.Implementations/Localization/Core/zh-HK.json
index ac74da67d1..6c8bf76274 100644
--- a/Emby.Server.Implementations/Localization/Core/zh-HK.json
+++ b/Emby.Server.Implementations/Localization/Core/zh-HK.json
@@ -120,5 +120,8 @@
"Default": "預設",
"TaskOptimizeDatabaseDescription": "壓縮數據庫並截斷可用空間。在掃描媒體庫或執行其他數據庫的修改後運行此任務可能會提高性能。",
"TaskOptimizeDatabase": "最佳化數據庫",
- "TaskCleanActivityLogDescription": "刪除早於設定時間的日誌記錄。"
+ "TaskCleanActivityLogDescription": "刪除早於設定時間的日誌記錄。",
+ "TaskKeyframeExtractorDescription": "提取關鍵格以創建更準確的HLS播放列表。次指示可能用時很長。",
+ "TaskKeyframeExtractor": "關鍵幀提取器",
+ "External": "外部"
}
From a9af1d84086026552283e70d107bd3d31c4264ef Mon Sep 17 00:00:00 2001
From: Tome Stojkovski
Date: Tue, 13 Sep 2022 06:05:59 +0000
Subject: [PATCH 068/262] Translated using Weblate (Macedonian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/mk/
---
Emby.Server.Implementations/Localization/Core/mk.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/mk.json b/Emby.Server.Implementations/Localization/Core/mk.json
index 3483a7f0cc..cbccad87ff 100644
--- a/Emby.Server.Implementations/Localization/Core/mk.json
+++ b/Emby.Server.Implementations/Localization/Core/mk.json
@@ -64,7 +64,7 @@
"CameraImageUploadedFrom": "Нова слика од камера беше поставена од {0}",
"Books": "Книги",
"AuthenticationSucceededWithUserName": "{0} успешно поврзан",
- "Artists": "Изведувач",
+ "Artists": "Изведувачи",
"Application": "Апликација",
"AppDeviceValues": "Апликација: {0}, Уред: {1}",
"Albums": "Албуми",
From 6aa9d44fb7c60057621619bcf2521572e5bf6d4d Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Thu, 15 Sep 2022 00:39:00 +0200
Subject: [PATCH 069/262] Use record for AudioBookFilePathParserResult
---
Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs b/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs
index 48ab8b57dc..ae8c8a39bc 100644
--- a/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs
+++ b/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs
@@ -3,7 +3,7 @@ namespace Emby.Naming.AudioBook
///
/// Data object for passing result of audiobook part/chapter extraction.
///
- public struct AudioBookFilePathParserResult
+ public record struct AudioBookFilePathParserResult
{
///
/// Gets or sets optional number of path extracted from audiobook filename.
From b036144b0f1e110dd114d1273796d29c628a1a44 Mon Sep 17 00:00:00 2001
From: Bond_009
Date: Thu, 15 Sep 2022 00:40:14 +0200
Subject: [PATCH 070/262] Remove LGTM badge
---
README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/README.md b/README.md
index a5b57d537d..454aeb17d5 100644
--- a/README.md
+++ b/README.md
@@ -41,9 +41,6 @@
-
-
-
---
From c0dae0fef5255f27071b8dd84e8468a3e1ad29bf Mon Sep 17 00:00:00 2001
From: Jamie Introcaso
Date: Wed, 14 Sep 2022 20:39:26 -0400
Subject: [PATCH 071/262] Adds lyric providers to DI pipeline
This is adding those lyric providers to the DI pipeline along with a super simple implementation of how to use them in the controller method. Probably should be refactored into a lyric service of some sort that would have the providers injected into it.
---
.../ApplicationHost.cs | 3 +++
.../Controllers/UserLibraryController.cs | 19 ++++++++++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 91a16c199d..3e9c540e7b 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -46,6 +46,7 @@ using Emby.Server.Implementations.SyncPlay;
using Emby.Server.Implementations.TV;
using Emby.Server.Implementations.Updates;
using Jellyfin.Api.Helpers;
+using Jellyfin.Api.Models.UserDtos;
using Jellyfin.MediaEncoding.Hls.Playlist;
using Jellyfin.Networking.Configuration;
using Jellyfin.Networking.Manager;
@@ -580,6 +581,8 @@ namespace Emby.Server.Implementations
serviceCollection.AddTransient(provider => new Lazy(provider.GetRequiredService));
serviceCollection.AddTransient(provider => new Lazy(provider.GetRequiredService));
serviceCollection.AddTransient(provider => new Lazy(provider.GetRequiredService));
+ serviceCollection.AddTransient();
+ serviceCollection.AddTransient();
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index ed8a98d23f..123c5e0795 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -1,17 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
-using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Extensions;
-using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Api.Models.UserDtos;
using Jellyfin.Data.Enums;
-using Jellyfin.Extensions;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
@@ -40,6 +37,7 @@ namespace Jellyfin.Api.Controllers
private readonly IDtoService _dtoService;
private readonly IUserViewManager _userViewManager;
private readonly IFileSystem _fileSystem;
+ private readonly IEnumerable _lyricProviders;
///
/// Initializes a new instance of the class.
@@ -50,13 +48,15 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
+ /// Collection of all registered interfaces.
public UserLibraryController(
IUserManager userManager,
IUserDataManager userDataRepository,
ILibraryManager libraryManager,
IDtoService dtoService,
IUserViewManager userViewManager,
- IFileSystem fileSystem)
+ IFileSystem fileSystem,
+ IEnumerable lyricProviders)
{
_userManager = userManager;
_userDataRepository = userDataRepository;
@@ -64,6 +64,7 @@ namespace Jellyfin.Api.Controllers
_dtoService = dtoService;
_userViewManager = userViewManager;
_fileSystem = fileSystem;
+ _lyricProviders = lyricProviders;
}
///
@@ -413,10 +414,14 @@ namespace Jellyfin.Api.Controllers
return NotFound();
}
- var result = ItemHelper.GetLyricData(item);
- if (result is not null)
+ // Super nieve implementation. I would suggest building a lyric service of some sort and doing this there.
+ foreach (var provider in _lyricProviders)
{
- return Ok(result);
+ provider.Process(item);
+ if (provider.HasData)
+ {
+ return Ok(provider.Data);
+ }
}
return NotFound();
From d9be3874ba3842d5888c5cbbe583614ed990849e Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Thu, 15 Sep 2022 19:45:26 -0400
Subject: [PATCH 072/262] Auto stash before merge of "lyric-lrc-file-support"
and "origin/lyric-lrc-file-support"
---
.../ApplicationHost.cs | 2 +
Emby.Server.Implementations/Dto/DtoService.cs | 9 +-
.../Controllers/UserLibraryController.cs | 5 +-
Jellyfin.Api/Helpers/ItemHelper.cs | 106 ------------------
Jellyfin.Api/Jellyfin.Api.csproj | 1 -
.../Models/UserDtos/ILyricsProvider.cs | 34 ------
.../Lyrics/ILyricsProvider.cs | 24 ++++
.../Lyrics}/Lyric.cs | 2 +-
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 87 ++++++++++++++
.../Lyrics/LyricResponse.cs | 15 +++
MediaBrowser.Model/Dto/BaseItemDto.cs | 2 +-
.../Lyric}/LrcLyricsProvider.cs | 39 +++----
.../Lyric}/TxtLyricsProvider.cs | 35 +++---
.../MediaBrowser.Providers.csproj | 2 +
14 files changed, 173 insertions(+), 190 deletions(-)
delete mode 100644 Jellyfin.Api/Helpers/ItemHelper.cs
delete mode 100644 Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs
create mode 100644 MediaBrowser.Controller/Lyrics/ILyricsProvider.cs
rename {Jellyfin.Api/Models/UserDtos => MediaBrowser.Controller/Lyrics}/Lyric.cs (90%)
create mode 100644 MediaBrowser.Controller/Lyrics/LyricInfo.cs
create mode 100644 MediaBrowser.Controller/Lyrics/LyricResponse.cs
rename {Jellyfin.Api/Models/UserDtos => MediaBrowser.Providers/Lyric}/LrcLyricsProvider.cs (76%)
rename {Jellyfin.Api/Models/UserDtos => MediaBrowser.Providers/Lyric}/TxtLyricsProvider.cs (65%)
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 3e9c540e7b..5487e5e023 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -68,6 +68,7 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
+using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Notifications;
@@ -95,6 +96,7 @@ using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Providers.Chapters;
+using MediaBrowser.Providers.Lyric;
using MediaBrowser.Providers.Manager;
using MediaBrowser.Providers.Plugins.Tmdb;
using MediaBrowser.Providers.Subtitles;
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index 96717cff53..bed82a4bbb 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -19,6 +19,7 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
+using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Providers;
@@ -51,6 +52,8 @@ namespace Emby.Server.Implementations.Dto
private readonly IMediaSourceManager _mediaSourceManager;
private readonly Lazy _livetvManagerFactory;
+ private readonly IEnumerable _lyricProviders;
+
public DtoService(
ILogger logger,
ILibraryManager libraryManager,
@@ -60,7 +63,8 @@ namespace Emby.Server.Implementations.Dto
IProviderManager providerManager,
IApplicationHost appHost,
IMediaSourceManager mediaSourceManager,
- Lazy livetvManagerFactory)
+ Lazy livetvManagerFactory,
+ IEnumerable lyricProviders)
{
_logger = logger;
_libraryManager = libraryManager;
@@ -71,6 +75,7 @@ namespace Emby.Server.Implementations.Dto
_appHost = appHost;
_mediaSourceManager = mediaSourceManager;
_livetvManagerFactory = livetvManagerFactory;
+ _lyricProviders = lyricProviders;
}
private ILiveTvManager LivetvManager => _livetvManagerFactory.Value;
@@ -142,7 +147,7 @@ namespace Emby.Server.Implementations.Dto
}
else if (item is Audio)
{
- dto.HasLocalLyricsFile = ItemHelper.HasLyricFile(item.Path);
+ dto.HasLyrics = MediaBrowser.Controller.Lyrics.LyricInfo.HasLyricFile(_lyricProviders, item.Path);
}
if (item is IItemByName itemByName
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 123c5e0795..3da78c1169 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -13,6 +13,7 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
@@ -414,8 +415,8 @@ namespace Jellyfin.Api.Controllers
return NotFound();
}
- // Super nieve implementation. I would suggest building a lyric service of some sort and doing this there.
- foreach (var provider in _lyricProviders)
+ var result = MediaBrowser.Controller.Lyrics.LyricInfo.GetLyricData(_lyricProviders, item);
+ if (result is not null)
{
provider.Process(item);
if (provider.HasData)
diff --git a/Jellyfin.Api/Helpers/ItemHelper.cs b/Jellyfin.Api/Helpers/ItemHelper.cs
deleted file mode 100644
index 49bb8af8e3..0000000000
--- a/Jellyfin.Api/Helpers/ItemHelper.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Dynamic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using Jellyfin.Api.Models.UserDtos;
-using LrcParser.Model;
-using LrcParser.Parser;
-using MediaBrowser.Controller.Entities;
-
-namespace Jellyfin.Api.Helpers
-{
- ///
- /// Item helper.
- ///
- public static class ItemHelper
- {
- ///
- /// Opens lyrics file, converts to a List of Lyrics, and returns it.
- ///
- /// Requested Item.
- /// Collection of Lyrics.
- internal static object? GetLyricData(BaseItem item)
- {
- // Find all classes that implement ILyricsProvider Interface
- var foundLyricProviders = System.Reflection.Assembly.GetExecutingAssembly()
- .GetTypes()
- .Where(type => typeof(ILyricsProvider).IsAssignableFrom(type) && !type.IsInterface);
-
- if (!foundLyricProviders.Any())
- {
- return null;
- }
-
- foreach (var provider in foundLyricProviders)
- {
- ILyricsProvider? newProvider = Activator.CreateInstance(provider) as ILyricsProvider;
- if (newProvider is not null)
- {
- newProvider.Process(item);
- if (newProvider.HasData)
- {
- return newProvider.Data;
- }
- }
- }
-
- return null;
- }
-
- ///
- /// Checks if requested item has a matching lyric file.
- ///
- /// Path of requested item.
- /// True if item has a matching lyrics file.
- public static string? GetLyricFilePath(string itemPath)
- {
- // Find all classes that implement ILyricsProvider Interface
- var foundLyricProviders = System.Reflection.Assembly.GetExecutingAssembly()
- .GetTypes()
- .Where(type => typeof(ILyricsProvider).IsAssignableFrom(type) && !type.IsInterface);
-
- if (!foundLyricProviders.Any())
- {
- return null;
- }
-
- // Iterate over all found lyric providers
- foreach (var provider in foundLyricProviders)
- {
- ILyricsProvider? foundProvider = Activator.CreateInstance(provider) as ILyricsProvider;
- if (foundProvider?.FileExtensions is null)
- {
- continue;
- }
-
- if (foundProvider.FileExtensions.Any())
- {
- foreach (string lyricFileExtension in foundProvider.FileExtensions)
- {
- string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
- if (System.IO.File.Exists(lyricFilePath))
- {
- return lyricFilePath;
- }
- }
- }
- }
-
- return null;
- }
-
-
- ///
- /// Checks if requested item has a matching local lyric file.
- ///
- /// Path of requested item.
- /// True if item has a matching lyrics file; otherwise false.
- public static bool HasLyricFile(string itemPath)
- {
- string? lyricFilePath = GetLyricFilePath(itemPath);
- return !string.IsNullOrEmpty(lyricFilePath);
- }
- }
-}
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index 972387e02a..894d871383 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -17,7 +17,6 @@
-
diff --git a/Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs b/Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs
deleted file mode 100644
index 37f1f5bbe4..0000000000
--- a/Jellyfin.Api/Models/UserDtos/ILyricsProvider.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Collections.ObjectModel;
-using MediaBrowser.Controller.Entities;
-
-namespace Jellyfin.Api.Models.UserDtos
-{
- ///
- /// Interface ILyricsProvider.
- ///
- public interface ILyricsProvider
- {
- ///
- /// Gets a value indicating the File Extenstions this provider works with.
- ///
- public Collection? FileExtensions { get; }
-
- ///
- /// Gets a value indicating whether Process() generated data.
- ///
- /// true if data generated; otherwise, false.
- bool HasData { get; }
-
- ///
- /// Gets Data object generated by Process() method.
- ///
- /// Object with data if no error occured; otherwise, null.
- object? Data { get; }
-
- ///
- /// Opens lyric file for [the specified item], and processes it for API return.
- ///
- /// The item to to process.
- void Process(BaseItem item);
- }
-}
diff --git a/MediaBrowser.Controller/Lyrics/ILyricsProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricsProvider.cs
new file mode 100644
index 0000000000..bac32a398a
--- /dev/null
+++ b/MediaBrowser.Controller/Lyrics/ILyricsProvider.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using MediaBrowser.Controller.Entities;
+
+namespace MediaBrowser.Controller.Lyrics
+{
+ ///
+ /// Interface ILyricsProvider.
+ ///
+ public interface ILyricsProvider
+ {
+ ///
+ /// Gets the supported media types for this provider.
+ ///
+ /// The supported media types.
+ IEnumerable SupportedMediaTypes { get; }
+
+ ///
+ /// Gets the lyrics.
+ ///
+ /// The item to to process.
+ /// Task{LyricResponse}.
+ LyricResponse? GetLyrics(BaseItem item);
+ }
+}
diff --git a/Jellyfin.Api/Models/UserDtos/Lyric.cs b/MediaBrowser.Controller/Lyrics/Lyric.cs
similarity index 90%
rename from Jellyfin.Api/Models/UserDtos/Lyric.cs
rename to MediaBrowser.Controller/Lyrics/Lyric.cs
index f83fc9839b..d44546dd39 100644
--- a/Jellyfin.Api/Models/UserDtos/Lyric.cs
+++ b/MediaBrowser.Controller/Lyrics/Lyric.cs
@@ -1,4 +1,4 @@
-namespace Jellyfin.Api.Models.UserDtos
+namespace MediaBrowser.Controller.Lyrics
{
///
/// Lyric dto.
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
new file mode 100644
index 0000000000..83a10701a2
--- /dev/null
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Lyrics;
+using MediaBrowser.Controller.Net;
+using Microsoft.AspNetCore.Mvc;
+
+namespace MediaBrowser.Controller.Lyrics
+{
+ ///
+ /// Item helper.
+ ///
+ public class LyricInfo
+ {
+ ///
+ /// Opens lyrics file, converts to a List of Lyrics, and returns it.
+ ///
+ /// Collection of all registered interfaces.
+ /// Requested Item.
+ /// Collection of Lyrics.
+ public static LyricResponse? GetLyricData(IEnumerable lyricProviders, BaseItem item)
+ {
+
+ foreach (var provider in lyricProviders)
+ {
+ var result = provider.GetLyrics(item);
+ if (result is not null)
+ {
+ return result;
+ }
+ }
+
+ return new LyricResponse
+ {
+ Lyrics = new List
+ {
+ new Lyric { Start = 0, Text = "Test" }
+ }
+ };
+ }
+
+ ///
+ /// Checks if requested item has a matching lyric file.
+ ///
+ /// The current lyricProvider interface.
+ /// Path of requested item.
+ /// True if item has a matching lyrics file.
+ public static string? GetLyricFilePath(ILyricsProvider lyricProvider, string itemPath)
+ {
+ if (lyricProvider.SupportedMediaTypes.Any())
+ {
+ foreach (string lyricFileExtension in lyricProvider.SupportedMediaTypes)
+ {
+ string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
+ if (System.IO.File.Exists(lyricFilePath))
+ {
+ return lyricFilePath;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ ///
+ /// Checks if requested item has a matching local lyric file.
+ ///
+ /// Collection of all registered interfaces.
+ /// Path of requested item.
+ /// True if item has a matching lyrics file; otherwise false.
+ public static bool HasLyricFile(IEnumerable lyricProviders, string itemPath)
+ {
+ foreach (var provider in lyricProviders)
+ {
+ if (GetLyricFilePath(provider, itemPath) is not null)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
new file mode 100644
index 0000000000..e312638ecc
--- /dev/null
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -0,0 +1,15 @@
+#nullable disable
+
+#pragma warning disable CS1591
+
+using System.Collections.Generic;
+
+namespace MediaBrowser.Controller.Lyrics
+{
+ public class LyricResponse
+ {
+ public IDictionary MetaData { get; set; }
+
+ public IEnumerable Lyrics { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index b40a0210ad..2a86fded22 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -76,7 +76,7 @@ namespace MediaBrowser.Model.Dto
public bool? CanDownload { get; set; }
- public bool? HasLocalLyricsFile { get; set; }
+ public bool? HasLyrics { get; set; }
public bool? HasSubtitles { get; set; }
diff --git a/Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricsProvider.cs
similarity index 76%
rename from Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs
rename to MediaBrowser.Providers/Lyric/LrcLyricsProvider.cs
index 029acd6ca5..e30d563087 100644
--- a/Jellyfin.Api/Models/UserDtos/LrcLyricsProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricsProvider.cs
@@ -4,11 +4,14 @@ using System.Collections.ObjectModel;
using System.Dynamic;
using System.Globalization;
using System.Linq;
+using System.Threading.Tasks;
+using Jellyfin.Api.Helpers;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Lyrics;
-namespace Jellyfin.Api.Models.UserDtos
+namespace MediaBrowser.Providers.Lyric
{
///
/// LRC File Lyric Provider.
@@ -20,7 +23,7 @@ namespace Jellyfin.Api.Models.UserDtos
///
public LrcLyricsProvider()
{
- FileExtensions = new Collection
+ SupportedMediaTypes = new Collection
{
"lrc"
};
@@ -29,13 +32,7 @@ namespace Jellyfin.Api.Models.UserDtos
///
/// Gets a value indicating the File Extenstions this provider works with.
///
- public Collection? FileExtensions { get; }
-
- ///
- /// Gets or Sets a value indicating whether Process() generated data.
- ///
- /// true if data generated; otherwise, false.
- public bool HasData { get; set; }
+ public IEnumerable SupportedMediaTypes { get; }
///
/// Gets or Sets Data object generated by Process() method.
@@ -47,16 +44,17 @@ namespace Jellyfin.Api.Models.UserDtos
/// Opens lyric file for [the specified item], and processes it for API return.
///
/// The item to to process.
- public void Process(BaseItem item)
+ /// A representing the asynchronous operation.
+ public LyricResponse? GetLyrics(BaseItem item)
{
- string? lyricFilePath = Helpers.ItemHelper.GetLyricFilePath(item.Path);
+ string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
if (string.IsNullOrEmpty(lyricFilePath))
{
- return;
+ return null;
}
- List lyricsList = new List();
+ List lyricsList = new List();
List sortedLyricData = new List();
var metaData = new ExpandoObject() as IDictionary;
@@ -88,30 +86,27 @@ namespace Jellyfin.Api.Models.UserDtos
}
catch
{
- return;
+ return null;
}
if (!sortedLyricData.Any())
{
- return;
+ return null;
}
for (int i = 0; i < sortedLyricData.Count; i++)
{
var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;
- lyricsList.Add(new Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
+ lyricsList.Add(new MediaBrowser.Controller.Lyrics.Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
}
- this.HasData = true;
if (metaData.Any())
{
- this.Data = new { MetaData = metaData, lyrics = lyricsList };
- }
- else
- {
- this.Data = new { lyrics = lyricsList };
+ return new LyricResponse { MetaData = metaData, Lyrics = lyricsList };
}
+
+ return new LyricResponse { Lyrics = lyricsList };
}
}
}
diff --git a/Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricsProvider.cs
similarity index 65%
rename from Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs
rename to MediaBrowser.Providers/Lyric/TxtLyricsProvider.cs
index 03cce1ffbb..2a5da4e4d8 100644
--- a/Jellyfin.Api/Models/UserDtos/TxtLyricsProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricsProvider.cs
@@ -1,14 +1,13 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Dynamic;
-using System.Globalization;
using System.Linq;
-using LrcParser.Model;
-using LrcParser.Parser;
+using System.Threading.Tasks;
+using Jellyfin.Api.Helpers;
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Lyrics;
-namespace Jellyfin.Api.Models.UserDtos
+namespace MediaBrowser.Providers.Lyric
{
///
/// TXT File Lyric Provider.
@@ -20,7 +19,7 @@ namespace Jellyfin.Api.Models.UserDtos
///
public TxtLyricsProvider()
{
- FileExtensions = new Collection
+ SupportedMediaTypes = new Collection
{
"lrc", "txt"
};
@@ -29,13 +28,7 @@ namespace Jellyfin.Api.Models.UserDtos
///
/// Gets a value indicating the File Extenstions this provider works with.
///
- public Collection? FileExtensions { get; }
-
- ///
- /// Gets or Sets a value indicating whether Process() generated data.
- ///
- /// true if data generated; otherwise, false.
- public bool HasData { get; set; }
+ public IEnumerable SupportedMediaTypes { get; }
///
/// Gets or Sets Data object generated by Process() method.
@@ -47,16 +40,17 @@ namespace Jellyfin.Api.Models.UserDtos
/// Opens lyric file for [the specified item], and processes it for API return.
///
/// The item to to process.
- public void Process(BaseItem item)
+ /// A representing the asynchronous operation.
+ public LyricResponse? GetLyrics(BaseItem item)
{
- string? lyricFilePath = Helpers.ItemHelper.GetLyricFilePath(item.Path);
+ string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
if (string.IsNullOrEmpty(lyricFilePath))
{
- return;
+ return null;
}
- List lyricsList = new List();
+ List lyricsList = new List();
string lyricData = System.IO.File.ReadAllText(lyricFilePath);
@@ -66,16 +60,15 @@ namespace Jellyfin.Api.Models.UserDtos
if (!lyricTextLines.Any())
{
- return;
+ return null;
}
foreach (string lyricLine in lyricTextLines)
{
- lyricsList.Add(new Lyric { Text = lyricLine });
+ lyricsList.Add(new MediaBrowser.Controller.Lyrics.Lyric { Text = lyricLine });
}
- this.HasData = true;
- this.Data = new { lyrics = lyricsList };
+ return new LyricResponse { Lyrics = lyricsList };
}
}
}
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 9864db9ac2..8514489f8a 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -6,6 +6,7 @@
+
@@ -16,6 +17,7 @@
+
From f4fd908f8d7ffcdea6acaf75928f6c2960ed6338 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Thu, 15 Sep 2022 20:49:25 -0400
Subject: [PATCH 073/262] Create ILyricManager
---
.../ApplicationHost.cs | 4 +-
Emby.Server.Implementations/Dto/DtoService.cs | 8 +-
.../Controllers/UserLibraryController.cs | 16 ++-
.../Lyrics/ILyricManager.cs | 37 +++++++
.../{ILyricsProvider.cs => ILyricProvider.cs} | 7 +-
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 50 +---------
...cLyricsProvider.cs => LrcLyricProvider.cs} | 13 ++-
MediaBrowser.Providers/Lyric/LyricManager.cs | 97 +++++++++++++++++++
...tLyricsProvider.cs => TxtLyricProvider.cs} | 14 ++-
9 files changed, 175 insertions(+), 71 deletions(-)
create mode 100644 MediaBrowser.Controller/Lyrics/ILyricManager.cs
rename MediaBrowser.Controller/Lyrics/{ILyricsProvider.cs => ILyricProvider.cs} (79%)
rename MediaBrowser.Providers/Lyric/{LrcLyricsProvider.cs => LrcLyricProvider.cs} (93%)
create mode 100644 MediaBrowser.Providers/Lyric/LyricManager.cs
rename MediaBrowser.Providers/Lyric/{TxtLyricsProvider.cs => TxtLyricProvider.cs} (88%)
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 5487e5e023..409fc04b16 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -583,8 +583,6 @@ namespace Emby.Server.Implementations
serviceCollection.AddTransient(provider => new Lazy(provider.GetRequiredService));
serviceCollection.AddTransient(provider => new Lazy(provider.GetRequiredService));
serviceCollection.AddTransient(provider => new Lazy(provider.GetRequiredService));
- serviceCollection.AddTransient();
- serviceCollection.AddTransient();
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
@@ -603,6 +601,7 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
+ serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
@@ -790,6 +789,7 @@ namespace Emby.Server.Implementations
Resolve().AddParts(GetExports(), GetExports(), GetExports());
Resolve().AddParts(GetExports());
+ Resolve().AddParts(GetExports());
Resolve().AddParts(GetExports());
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index bed82a4bbb..6ab574c5c5 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -52,7 +52,7 @@ namespace Emby.Server.Implementations.Dto
private readonly IMediaSourceManager _mediaSourceManager;
private readonly Lazy _livetvManagerFactory;
- private readonly IEnumerable _lyricProviders;
+ private readonly ILyricManager _lyricManager;
public DtoService(
ILogger logger,
@@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Dto
IApplicationHost appHost,
IMediaSourceManager mediaSourceManager,
Lazy livetvManagerFactory,
- IEnumerable lyricProviders)
+ ILyricManager lyricManager)
{
_logger = logger;
_libraryManager = libraryManager;
@@ -75,7 +75,7 @@ namespace Emby.Server.Implementations.Dto
_appHost = appHost;
_mediaSourceManager = mediaSourceManager;
_livetvManagerFactory = livetvManagerFactory;
- _lyricProviders = lyricProviders;
+ _lyricManager = lyricManager;
}
private ILiveTvManager LivetvManager => _livetvManagerFactory.Value;
@@ -147,7 +147,7 @@ namespace Emby.Server.Implementations.Dto
}
else if (item is Audio)
{
- dto.HasLyrics = MediaBrowser.Controller.Lyrics.LyricInfo.HasLyricFile(_lyricProviders, item.Path);
+ dto.HasLyrics = _lyricManager.HasLyricFile(item);
}
if (item is IItemByName itemByName
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 3da78c1169..1421ab444a 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -38,7 +38,7 @@ namespace Jellyfin.Api.Controllers
private readonly IDtoService _dtoService;
private readonly IUserViewManager _userViewManager;
private readonly IFileSystem _fileSystem;
- private readonly IEnumerable _lyricProviders;
+ private readonly ILyricManager _lyricManager;
///
/// Initializes a new instance of the class.
@@ -49,7 +49,7 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Collection of all registered interfaces.
+ /// Instance of the interface.
public UserLibraryController(
IUserManager userManager,
IUserDataManager userDataRepository,
@@ -57,7 +57,7 @@ namespace Jellyfin.Api.Controllers
IDtoService dtoService,
IUserViewManager userViewManager,
IFileSystem fileSystem,
- IEnumerable lyricProviders)
+ ILyricManager lyricManager)
{
_userManager = userManager;
_userDataRepository = userDataRepository;
@@ -65,7 +65,7 @@ namespace Jellyfin.Api.Controllers
_dtoService = dtoService;
_userViewManager = userViewManager;
_fileSystem = fileSystem;
- _lyricProviders = lyricProviders;
+ _lyricManager = lyricManager;
}
///
@@ -415,14 +415,10 @@ namespace Jellyfin.Api.Controllers
return NotFound();
}
- var result = MediaBrowser.Controller.Lyrics.LyricInfo.GetLyricData(_lyricProviders, item);
+ var result = _lyricManager.GetLyric(item);
if (result is not null)
{
- provider.Process(item);
- if (provider.HasData)
- {
- return Ok(provider.Data);
- }
+ return Ok(result);
}
return NotFound();
diff --git a/MediaBrowser.Controller/Lyrics/ILyricManager.cs b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
new file mode 100644
index 0000000000..4fd11b9e02
--- /dev/null
+++ b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
@@ -0,0 +1,37 @@
+#nullable disable
+
+#pragma warning disable CS1591
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.Providers;
+
+namespace MediaBrowser.Controller.Lyrics
+{
+ public interface ILyricManager
+ {
+ ///
+ /// Adds the parts.
+ ///
+ /// The lyric providers.
+ void AddParts(IEnumerable lyricProviders);
+
+ ///
+ /// Gets the lyrics.
+ ///
+ /// The media item.
+ /// Lyrics for passed item.
+ LyricResponse GetLyric(BaseItem item);
+
+ ///
+ /// Checks if requested item has a matching local lyric file.
+ ///
+ /// The media item.
+ /// True if item has a matching lyrics file; otherwise false.
+ bool HasLyricFile(BaseItem item);
+ }
+}
diff --git a/MediaBrowser.Controller/Lyrics/ILyricsProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
similarity index 79%
rename from MediaBrowser.Controller/Lyrics/ILyricsProvider.cs
rename to MediaBrowser.Controller/Lyrics/ILyricProvider.cs
index bac32a398a..691fed1fd2 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricsProvider.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
@@ -6,8 +6,13 @@ namespace MediaBrowser.Controller.Lyrics
///
/// Interface ILyricsProvider.
///
- public interface ILyricsProvider
+ public interface ILyricProvider
{
+ ///
+ /// Gets a value indicating the provider name.
+ ///
+ string Name { get; }
+
///
/// Gets the supported media types for this provider.
///
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index 83a10701a2..d44e14237a 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -13,42 +13,15 @@ namespace MediaBrowser.Controller.Lyrics
///
/// Item helper.
///
- public class LyricInfo
+ public static class LyricInfo
{
- ///
- /// Opens lyrics file, converts to a List of Lyrics, and returns it.
- ///
- /// Collection of all registered interfaces.
- /// Requested Item.
- /// Collection of Lyrics.
- public static LyricResponse? GetLyricData(IEnumerable lyricProviders, BaseItem item)
- {
-
- foreach (var provider in lyricProviders)
- {
- var result = provider.GetLyrics(item);
- if (result is not null)
- {
- return result;
- }
- }
-
- return new LyricResponse
- {
- Lyrics = new List
- {
- new Lyric { Start = 0, Text = "Test" }
- }
- };
- }
-
///
/// Checks if requested item has a matching lyric file.
///
/// The current lyricProvider interface.
/// Path of requested item.
/// True if item has a matching lyrics file.
- public static string? GetLyricFilePath(ILyricsProvider lyricProvider, string itemPath)
+ public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath)
{
if (lyricProvider.SupportedMediaTypes.Any())
{
@@ -64,24 +37,5 @@ namespace MediaBrowser.Controller.Lyrics
return null;
}
-
- ///
- /// Checks if requested item has a matching local lyric file.
- ///
- /// Collection of all registered interfaces.
- /// Path of requested item.
- /// True if item has a matching lyrics file; otherwise false.
- public static bool HasLyricFile(IEnumerable lyricProviders, string itemPath)
- {
- foreach (var provider in lyricProviders)
- {
- if (GetLyricFilePath(provider, itemPath) is not null)
- {
- return true;
- }
- }
-
- return false;
- }
}
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricsProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
similarity index 93%
rename from MediaBrowser.Providers/Lyric/LrcLyricsProvider.cs
rename to MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index e30d563087..18a85c93ac 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricsProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -16,19 +16,26 @@ namespace MediaBrowser.Providers.Lyric
///
/// LRC File Lyric Provider.
///
- public class LrcLyricsProvider : ILyricsProvider
+ public class LrcLyricProvider : ILyricProvider
{
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- public LrcLyricsProvider()
+ public LrcLyricProvider()
{
+ Name = "LrcLyricProvider";
+
SupportedMediaTypes = new Collection
{
"lrc"
};
}
+ ///
+ /// Gets a value indicating the provider name.
+ ///
+ public string Name { get; }
+
///
/// Gets a value indicating the File Extenstions this provider works with.
///
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
new file mode 100644
index 0000000000..48572c63e4
--- /dev/null
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -0,0 +1,97 @@
+#nullable disable
+
+#pragma warning disable CS1591
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Jellyfin.Extensions;
+using MediaBrowser.Common.Extensions;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Movies;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Lyrics;
+using MediaBrowser.Controller.Persistence;
+using MediaBrowser.Controller.Providers;
+using MediaBrowser.Controller.Subtitles;
+using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Globalization;
+using MediaBrowser.Model.IO;
+using MediaBrowser.Model.Providers;
+using Microsoft.Extensions.Logging;
+
+namespace MediaBrowser.Providers.Lyric
+{
+ public class LyricManager : ILyricManager
+ {
+ private readonly ILogger _logger;
+ private readonly IFileSystem _fileSystem;
+ private readonly ILibraryMonitor _monitor;
+ private readonly IMediaSourceManager _mediaSourceManager;
+ private readonly ILocalizationManager _localization;
+
+ private ILyricProvider[] _lyricProviders;
+
+ public LyricManager(
+ ILogger logger,
+ IFileSystem fileSystem,
+ ILibraryMonitor monitor,
+ IMediaSourceManager mediaSourceManager,
+ ILocalizationManager localizationManager)
+ {
+ _logger = logger;
+ _fileSystem = fileSystem;
+ _monitor = monitor;
+ _mediaSourceManager = mediaSourceManager;
+ _localization = localizationManager;
+ }
+
+ ///
+ public void AddParts(IEnumerable lyricProviders)
+ {
+ _lyricProviders = lyricProviders
+ .OrderBy(i => i is IHasOrder hasOrder ? hasOrder.Order : 0)
+ .ToArray();
+ }
+
+ ///
+ public LyricResponse GetLyric(BaseItem item)
+ {
+ foreach (ILyricProvider provider in _lyricProviders)
+ {
+ var results = provider.GetLyrics(item);
+ if (results is not null)
+ {
+ return results;
+ }
+ }
+
+ return null;
+ }
+
+ ///
+ public bool HasLyricFile(BaseItem item)
+ {
+ foreach (ILyricProvider provider in _lyricProviders)
+ {
+ if (item is null)
+ {
+ continue;
+ }
+
+ if (LyricInfo.GetLyricFilePath(provider, item.Path) is not null)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricsProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
similarity index 88%
rename from MediaBrowser.Providers/Lyric/TxtLyricsProvider.cs
rename to MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 2a5da4e4d8..939d8708b2 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricsProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
+using System.Xml.Linq;
using Jellyfin.Api.Helpers;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
@@ -12,19 +13,26 @@ namespace MediaBrowser.Providers.Lyric
///
/// TXT File Lyric Provider.
///
- public class TxtLyricsProvider : ILyricsProvider
+ public class TxtLyricProvider : ILyricProvider
{
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- public TxtLyricsProvider()
+ public TxtLyricProvider()
{
+ Name = "TxtLyricProvider";
+
SupportedMediaTypes = new Collection
{
"lrc", "txt"
};
}
+ ///
+ /// Gets a value indicating the provider name.
+ ///
+ public string Name { get; }
+
///
/// Gets a value indicating the File Extenstions this provider works with.
///
From f740d1b9f00d91bfad970f56abed67d8c8c16c9c Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Fri, 16 Sep 2022 20:52:40 -0400
Subject: [PATCH 074/262] Remove use of AddParts. Cleanup use of Lyric vs
Lyrics.
---
.../ApplicationHost.cs | 2 +-
.../Controllers/UserLibraryController.cs | 6 ++---
Jellyfin.Server/CoreAppHost.cs | 6 +++++
.../Lyrics/ILyricManager.cs | 18 ++-----------
.../Lyrics/ILyricProvider.cs | 4 +--
MediaBrowser.Controller/Lyrics/Lyric.cs | 4 +--
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 8 +++---
.../Lyrics/LyricResponse.cs | 9 +++++++
.../Lyric/LrcLyricProvider.cs | 24 +++++++----------
MediaBrowser.Providers/Lyric/LyricManager.cs | 16 ++++--------
.../Lyric/TxtLyricProvider.cs | 26 +++++++------------
11 files changed, 53 insertions(+), 70 deletions(-)
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 409fc04b16..5edc25952d 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -789,7 +789,7 @@ namespace Emby.Server.Implementations
Resolve().AddParts(GetExports(), GetExports(), GetExports());
Resolve().AddParts(GetExports());
- Resolve().AddParts(GetExports());
+ //Resolve().AddParts(GetExports());
Resolve().AddParts(GetExports());
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 1421ab444a..2cb2e93284 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -394,10 +394,10 @@ namespace Jellyfin.Api.Controllers
/// Item id.
/// Lyrics returned.
/// Something went wrong. No Lyrics will be returned.
- /// An containing the intros to play.
+ /// An containing the item's lyrics.
[HttpGet("Users/{userId}/Items/{itemId}/Lyrics")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public ActionResult> GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
+ public ActionResult> GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
{
var user = _userManager.GetUserById(userId);
@@ -415,7 +415,7 @@ namespace Jellyfin.Api.Controllers
return NotFound();
}
- var result = _lyricManager.GetLyric(item);
+ var result = _lyricManager.GetLyrics(item);
if (result is not null)
{
return Ok(result);
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs
index 67e50b92d9..984711dc2d 100644
--- a/Jellyfin.Server/CoreAppHost.cs
+++ b/Jellyfin.Server/CoreAppHost.cs
@@ -19,6 +19,7 @@ using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Events;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Security;
using MediaBrowser.Model.Activity;
@@ -95,6 +96,11 @@ namespace Jellyfin.Server
serviceCollection.AddScoped();
+ foreach (var type in GetExportTypes())
+ {
+ serviceCollection.AddSingleton(typeof(ILyricProvider), type);
+ }
+
base.RegisterServices(serviceCollection);
}
diff --git a/MediaBrowser.Controller/Lyrics/ILyricManager.cs b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
index 4fd11b9e02..c0f78d177d 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricManager.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
@@ -1,37 +1,23 @@
-#nullable disable
-
#pragma warning disable CS1591
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
-using MediaBrowser.Model.Configuration;
-using MediaBrowser.Model.Providers;
namespace MediaBrowser.Controller.Lyrics
{
public interface ILyricManager
{
- ///
- /// Adds the parts.
- ///
- /// The lyric providers.
- void AddParts(IEnumerable lyricProviders);
-
///
/// Gets the lyrics.
///
/// The media item.
/// Lyrics for passed item.
- LyricResponse GetLyric(BaseItem item);
+ LyricResponse GetLyrics(BaseItem item);
///
/// Checks if requested item has a matching local lyric file.
///
/// The media item.
- /// True if item has a matching lyrics file; otherwise false.
+ /// True if item has a matching lyric file; otherwise false.
bool HasLyricFile(BaseItem item);
}
}
diff --git a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
index 691fed1fd2..5e677ab26f 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
@@ -22,8 +22,8 @@ namespace MediaBrowser.Controller.Lyrics
///
/// Gets the lyrics.
///
- /// The item to to process.
- /// Task{LyricResponse}.
+ /// The media item.
+ /// If found, returns lyrics for passed item; otherwise, null.
LyricResponse? GetLyrics(BaseItem item);
}
}
diff --git a/MediaBrowser.Controller/Lyrics/Lyric.cs b/MediaBrowser.Controller/Lyrics/Lyric.cs
index d44546dd39..56a0a8a72d 100644
--- a/MediaBrowser.Controller/Lyrics/Lyric.cs
+++ b/MediaBrowser.Controller/Lyrics/Lyric.cs
@@ -1,12 +1,12 @@
namespace MediaBrowser.Controller.Lyrics
{
///
- /// Lyric dto.
+ /// Lyric model.
///
public class Lyric
{
///
- /// Gets or sets the start time (ticks).
+ /// Gets or sets the start time in ticks.
///
public double? Start { get; set; }
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index d44e14237a..018f296b1a 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -11,16 +11,16 @@ using Microsoft.AspNetCore.Mvc;
namespace MediaBrowser.Controller.Lyrics
{
///
- /// Item helper.
+ /// Lyric helper methods.
///
public static class LyricInfo
{
///
- /// Checks if requested item has a matching lyric file.
+ /// Gets matching lyric file for a requested item.
///
- /// The current lyricProvider interface.
+ /// The lyricProvider interface to use.
/// Path of requested item.
- /// True if item has a matching lyrics file.
+ /// Lyric file path if passed lyric provider's supported media type is found; otherwise, null.
public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath)
{
if (lyricProvider.SupportedMediaTypes.Any())
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index e312638ecc..498eb873c7 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -6,10 +6,19 @@ using System.Collections.Generic;
namespace MediaBrowser.Controller.Lyrics
{
+ ///
+ /// LyricResponse model.
+ ///
public class LyricResponse
{
+ ///
+ /// Gets or sets MetaData.
+ ///
public IDictionary MetaData { get; set; }
+ ///
+ /// Gets or sets Lyrics.
+ ///
public IEnumerable Lyrics { get; set; }
}
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 18a85c93ac..10db10ac6f 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -14,7 +14,7 @@ using MediaBrowser.Controller.Lyrics;
namespace MediaBrowser.Providers.Lyric
{
///
- /// LRC File Lyric Provider.
+ /// LRC Lyric Provider.
///
public class LrcLyricProvider : ILyricProvider
{
@@ -37,21 +37,15 @@ namespace MediaBrowser.Providers.Lyric
public string Name { get; }
///
- /// Gets a value indicating the File Extenstions this provider works with.
+ /// Gets a value indicating the File Extenstions this provider supports.
///
public IEnumerable SupportedMediaTypes { get; }
///
- /// Gets or Sets Data object generated by Process() method.
- ///
- /// Object with data if no error occured; otherwise, null.
- public object? Data { get; set; }
-
- ///
- /// Opens lyric file for [the specified item], and processes it for API return.
+ /// Opens lyric file for the requested item, and processes it for API return.
///
/// The item to to process.
- /// A representing the asynchronous operation.
+ /// If provider can determine lyrics, returns a with or without metadata; otherwise, null.
public LyricResponse? GetLyrics(BaseItem item)
{
string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
@@ -61,9 +55,9 @@ namespace MediaBrowser.Providers.Lyric
return null;
}
- List lyricsList = new List();
-
+ List lyricList = new List();
List sortedLyricData = new List();
+
var metaData = new ExpandoObject() as IDictionary;
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
@@ -105,15 +99,15 @@ namespace MediaBrowser.Providers.Lyric
{
var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;
- lyricsList.Add(new MediaBrowser.Controller.Lyrics.Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
+ lyricList.Add(new Controller.Lyrics.Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
}
if (metaData.Any())
{
- return new LyricResponse { MetaData = metaData, Lyrics = lyricsList };
+ return new LyricResponse { MetaData = metaData, Lyrics = lyricList };
}
- return new LyricResponse { Lyrics = lyricsList };
+ return new LyricResponse { Lyrics = lyricList };
}
}
}
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index 48572c63e4..698da46867 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -36,32 +36,26 @@ namespace MediaBrowser.Providers.Lyric
private readonly IMediaSourceManager _mediaSourceManager;
private readonly ILocalizationManager _localization;
- private ILyricProvider[] _lyricProviders;
+ private IEnumerable _lyricProviders;
public LyricManager(
ILogger logger,
IFileSystem fileSystem,
ILibraryMonitor monitor,
IMediaSourceManager mediaSourceManager,
- ILocalizationManager localizationManager)
+ ILocalizationManager localizationManager,
+ IEnumerable lyricProviders)
{
_logger = logger;
_fileSystem = fileSystem;
_monitor = monitor;
_mediaSourceManager = mediaSourceManager;
_localization = localizationManager;
+ _lyricProviders = lyricProviders;
}
///
- public void AddParts(IEnumerable lyricProviders)
- {
- _lyricProviders = lyricProviders
- .OrderBy(i => i is IHasOrder hasOrder ? hasOrder.Order : 0)
- .ToArray();
- }
-
- ///
- public LyricResponse GetLyric(BaseItem item)
+ public LyricResponse GetLyrics(BaseItem item)
{
foreach (ILyricProvider provider in _lyricProviders)
{
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 939d8708b2..aa222ed97b 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -11,7 +11,7 @@ using MediaBrowser.Controller.Lyrics;
namespace MediaBrowser.Providers.Lyric
{
///
- /// TXT File Lyric Provider.
+ /// TXT Lyric Provider.
///
public class TxtLyricProvider : ILyricProvider
{
@@ -34,21 +34,15 @@ namespace MediaBrowser.Providers.Lyric
public string Name { get; }
///
- /// Gets a value indicating the File Extenstions this provider works with.
+ /// Gets a value indicating the File Extenstions this provider supports.
///
public IEnumerable SupportedMediaTypes { get; }
///
- /// Gets or Sets Data object generated by Process() method.
- ///
- /// Object with data if no error occured; otherwise, null.
- public object? Data { get; set; }
-
- ///
- /// Opens lyric file for [the specified item], and processes it for API return.
+ /// Opens lyric file for the requested item, and processes it for API return.
///
/// The item to to process.
- /// A representing the asynchronous operation.
+ /// If provider can determine lyrics, returns a ; otherwise, null.
public LyricResponse? GetLyrics(BaseItem item)
{
string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
@@ -58,25 +52,25 @@ namespace MediaBrowser.Providers.Lyric
return null;
}
- List lyricsList = new List();
+ List lyricList = new List();
string lyricData = System.IO.File.ReadAllText(lyricFilePath);
// Splitting on Environment.NewLine caused some new lines to be missed in Windows.
- char[] newLinedelims = new[] { '\r', '\n' };
- string[] lyricTextLines = lyricData.Split(newLinedelims, StringSplitOptions.RemoveEmptyEntries);
+ char[] newLineDelims = new[] { '\r', '\n' };
+ string[] lyricTextLines = lyricData.Split(newLineDelims, StringSplitOptions.RemoveEmptyEntries);
if (!lyricTextLines.Any())
{
return null;
}
- foreach (string lyricLine in lyricTextLines)
+ foreach (string lyricTextLine in lyricTextLines)
{
- lyricsList.Add(new MediaBrowser.Controller.Lyrics.Lyric { Text = lyricLine });
+ lyricList.Add(new Controller.Lyrics.Lyric { Text = lyricTextLine });
}
- return new LyricResponse { Lyrics = lyricsList };
+ return new LyricResponse { Lyrics = lyricList };
}
}
}
From 8912f618f59c1e798e406b8ed7fed4504e2c2de3 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Fri, 16 Sep 2022 21:11:28 -0400
Subject: [PATCH 075/262] Change API GetLyrics return type
---
Jellyfin.Api/Controllers/UserLibraryController.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 2cb2e93284..df91a8efc7 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -397,7 +397,7 @@ namespace Jellyfin.Api.Controllers
/// An containing the item's lyrics.
[HttpGet("Users/{userId}/Items/{itemId}/Lyrics")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public ActionResult> GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
+ public ActionResult GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
{
var user = _userManager.GetUserById(userId);
From 9350fa40bda4464a1a5f01fee7f2f72415b7f5d4 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 08:46:09 -0400
Subject: [PATCH 076/262] Convert _lyricProviders to an array.
---
MediaBrowser.Providers/Lyric/LyricManager.cs | 42 ++------------------
1 file changed, 3 insertions(+), 39 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index 698da46867..f5560b0542 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -2,56 +2,20 @@
#pragma warning disable CS1591
-using System;
using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using Jellyfin.Extensions;
-using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Entities.Movies;
-using MediaBrowser.Controller.Entities.TV;
-using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Lyrics;
-using MediaBrowser.Controller.Persistence;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Controller.Subtitles;
-using MediaBrowser.Model.Configuration;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Globalization;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Providers;
-using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Lyric
{
public class LyricManager : ILyricManager
{
- private readonly ILogger _logger;
- private readonly IFileSystem _fileSystem;
- private readonly ILibraryMonitor _monitor;
- private readonly IMediaSourceManager _mediaSourceManager;
- private readonly ILocalizationManager _localization;
+ private readonly ILyricProvider[] _lyricProviders;
- private IEnumerable _lyricProviders;
-
- public LyricManager(
- ILogger logger,
- IFileSystem fileSystem,
- ILibraryMonitor monitor,
- IMediaSourceManager mediaSourceManager,
- ILocalizationManager localizationManager,
- IEnumerable lyricProviders)
+ public LyricManager(IEnumerable lyricProviders)
{
- _logger = logger;
- _fileSystem = fileSystem;
- _monitor = monitor;
- _mediaSourceManager = mediaSourceManager;
- _localization = localizationManager;
- _lyricProviders = lyricProviders;
+ _lyricProviders = lyricProviders.ToArray();
}
///
From 823e2ec029d8708b71452afc7442524823d82acb Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 09:22:07 -0400
Subject: [PATCH 077/262] Removing unused lines
---
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 7 -------
MediaBrowser.Controller/Lyrics/LyricResponse.cs | 2 --
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 2 --
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs | 3 ---
4 files changed, 14 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index 018f296b1a..ae831b4d23 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -1,12 +1,5 @@
-using System;
-using System.Collections.Generic;
using System.IO;
using System.Linq;
-using System.Threading.Tasks;
-using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Lyrics;
-using MediaBrowser.Controller.Net;
-using Microsoft.AspNetCore.Mvc;
namespace MediaBrowser.Controller.Lyrics
{
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 498eb873c7..59ee5c7f2c 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -1,7 +1,5 @@
#nullable disable
-#pragma warning disable CS1591
-
using System.Collections.Generic;
namespace MediaBrowser.Controller.Lyrics
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 10db10ac6f..ea42d75255 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -4,8 +4,6 @@ using System.Collections.ObjectModel;
using System.Dynamic;
using System.Globalization;
using System.Linq;
-using System.Threading.Tasks;
-using Jellyfin.Api.Helpers;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index aa222ed97b..8a51d7277c 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -2,9 +2,6 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Jellyfin.Api.Helpers;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
From 7d886116fd3b617cae6884a33b8b545358fa6289 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 10:42:48 -0400
Subject: [PATCH 078/262] Var type refinements
---
MediaBrowser.Controller/Lyrics/Lyric.cs | 2 +-
MediaBrowser.Controller/Lyrics/LyricResponse.cs | 4 ++--
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 13 +++++++------
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/Lyric.cs b/MediaBrowser.Controller/Lyrics/Lyric.cs
index 56a0a8a72d..35cdabbb9b 100644
--- a/MediaBrowser.Controller/Lyrics/Lyric.cs
+++ b/MediaBrowser.Controller/Lyrics/Lyric.cs
@@ -8,7 +8,7 @@ namespace MediaBrowser.Controller.Lyrics
///
/// Gets or sets the start time in ticks.
///
- public double? Start { get; set; }
+ public long? Start { get; set; }
///
/// Gets or sets the text.
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 59ee5c7f2c..796ca3bc36 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.Lyrics
public class LyricResponse
{
///
- /// Gets or sets MetaData.
+ /// Gets or sets Metadata.
///
- public IDictionary MetaData { get; set; }
+ public IDictionary Metadata { get; set; }
///
/// Gets or sets Lyrics.
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index ea42d75255..59a172cee2 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -8,6 +8,7 @@ using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
+using Swashbuckle.AspNetCore.SwaggerGen;
namespace MediaBrowser.Providers.Lyric
{
@@ -56,7 +57,7 @@ namespace MediaBrowser.Providers.Lyric
List lyricList = new List();
List sortedLyricData = new List();
- var metaData = new ExpandoObject() as IDictionary;
+ IDictionary metaData = new Dictionary();
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
try
@@ -77,8 +78,8 @@ namespace MediaBrowser.Providers.Lyric
{
var metaDataField = metaDataRow.Split(":");
- string metaDataFieldName = metaDataField[0].Replace("[", string.Empty, StringComparison.Ordinal);
- string metaDataFieldValue = metaDataField[1].Replace("]", string.Empty, StringComparison.Ordinal);
+ string metaDataFieldName = metaDataField[0].Replace("[", string.Empty, StringComparison.Ordinal).Trim();
+ string metaDataFieldValue = metaDataField[1].Replace("]", string.Empty, StringComparison.Ordinal).Trim();
metaData.Add(metaDataFieldName, metaDataFieldValue);
}
@@ -96,13 +97,13 @@ namespace MediaBrowser.Providers.Lyric
for (int i = 0; i < sortedLyricData.Count; i++)
{
var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
- double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;
- lyricList.Add(new Controller.Lyrics.Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });
+ long ticks = Convert.ToInt64(timeData, new NumberFormatInfo()) * 10000;
+ lyricList.Add(new Controller.Lyrics.Lyric { Start = ticks, Text = sortedLyricData[i].Text });
}
if (metaData.Any())
{
- return new LyricResponse { MetaData = metaData, Lyrics = lyricList };
+ return new LyricResponse { Metadata = metaData, Lyrics = lyricList };
}
return new LyricResponse { Lyrics = lyricList };
From 29932466a9e75f9cf54332be9bb9d39dce238d07 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 10:55:04 -0400
Subject: [PATCH 079/262] Remove commented out code
---
Emby.Server.Implementations/ApplicationHost.cs | 1 -
1 file changed, 1 deletion(-)
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 5edc25952d..3c3c90e61e 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -789,7 +789,6 @@ namespace Emby.Server.Implementations
Resolve().AddParts(GetExports(), GetExports(), GetExports());
Resolve().AddParts(GetExports());
- //Resolve().AddParts(GetExports());
Resolve().AddParts(GetExports());
From c65819221d9a84ec0ae69a243fdcb17bce7aa65f Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 17:37:38 -0400
Subject: [PATCH 080/262] Code cleanups. Remove pragma commands
---
.../Lyrics/ILyricManager.cs | 38 ++--
.../Lyrics/ILyricProvider.cs | 39 ++--
MediaBrowser.Controller/Lyrics/Lyric.cs | 34 ++--
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 39 ++--
.../Lyrics/LyricResponse.cs | 27 ++-
.../Lyric/LrcLyricProvider.cs | 172 +++++++++---------
MediaBrowser.Providers/Lyric/LyricManager.cs | 72 ++++----
.../Lyric/TxtLyricProvider.cs | 96 ++++------
.../MediaBrowser.Providers.csproj | 1 -
9 files changed, 247 insertions(+), 271 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/ILyricManager.cs b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
index c0f78d177d..dad0250f6b 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricManager.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
@@ -1,23 +1,23 @@
-#pragma warning disable CS1591
-
using MediaBrowser.Controller.Entities;
-namespace MediaBrowser.Controller.Lyrics
-{
- public interface ILyricManager
- {
- ///
- /// Gets the lyrics.
- ///
- /// The media item.
- /// Lyrics for passed item.
- LyricResponse GetLyrics(BaseItem item);
+namespace MediaBrowser.Controller.Lyrics;
- ///
- /// Checks if requested item has a matching local lyric file.
- ///
- /// The media item.
- /// True if item has a matching lyric file; otherwise false.
- bool HasLyricFile(BaseItem item);
- }
+///
+/// Interface ILyricManager.
+///
+public interface ILyricManager
+{
+ ///
+ /// Gets the lyrics.
+ ///
+ /// The media item.
+ /// Lyrics for passed item.
+ LyricResponse GetLyrics(BaseItem item);
+
+ ///
+ /// Checks if requested item has a matching local lyric file.
+ ///
+ /// The media item.
+ /// True if item has a matching lyric file; otherwise false.
+ bool HasLyricFile(BaseItem item);
}
diff --git a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
index 5e677ab26f..1b52de255f 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
@@ -1,29 +1,28 @@
using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
-namespace MediaBrowser.Controller.Lyrics
+namespace MediaBrowser.Controller.Lyrics;
+
+///
+/// Interface ILyricsProvider.
+///
+public interface ILyricProvider
{
///
- /// Interface ILyricsProvider.
+ /// Gets a value indicating the provider name.
///
- public interface ILyricProvider
- {
- ///
- /// Gets a value indicating the provider name.
- ///
- string Name { get; }
+ string Name { get; }
- ///
- /// Gets the supported media types for this provider.
- ///
- /// The supported media types.
- IEnumerable SupportedMediaTypes { get; }
+ ///
+ /// Gets the supported media types for this provider.
+ ///
+ /// The supported media types.
+ IEnumerable SupportedMediaTypes { get; }
- ///
- /// Gets the lyrics.
- ///
- /// The media item.
- /// If found, returns lyrics for passed item; otherwise, null.
- LyricResponse? GetLyrics(BaseItem item);
- }
+ ///
+ /// Gets the lyrics.
+ ///
+ /// The media item.
+ /// If found, returns lyrics for passed item; otherwise, null.
+ LyricResponse? GetLyrics(BaseItem item);
}
diff --git a/MediaBrowser.Controller/Lyrics/Lyric.cs b/MediaBrowser.Controller/Lyrics/Lyric.cs
index 35cdabbb9b..f39fbb0221 100644
--- a/MediaBrowser.Controller/Lyrics/Lyric.cs
+++ b/MediaBrowser.Controller/Lyrics/Lyric.cs
@@ -1,18 +1,28 @@
-namespace MediaBrowser.Controller.Lyrics
+namespace MediaBrowser.Controller.Lyrics;
+
+///
+/// Lyric model.
+///
+public class Lyric
{
///
- /// Lyric model.
+ /// Initializes a new instance of the class.
///
- public class Lyric
+ /// The lyric start time in ticks.
+ /// The lyric text.
+ public Lyric(string text, long? start = null)
{
- ///
- /// Gets or sets the start time in ticks.
- ///
- public long? Start { get; set; }
-
- ///
- /// Gets or sets the text.
- ///
- public string Text { get; set; } = string.Empty;
+ Start = start;
+ Text = text;
}
+
+ ///
+ /// Gets the start time in ticks.
+ ///
+ public long? Start { get; }
+
+ ///
+ /// Gets the text.
+ ///
+ public string Text { get; }
}
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index ae831b4d23..61e205b6cc 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -1,34 +1,29 @@
using System.IO;
-using System.Linq;
-namespace MediaBrowser.Controller.Lyrics
+namespace MediaBrowser.Controller.Lyrics;
+
+///
+/// Lyric helper methods.
+///
+public static class LyricInfo
{
///
- /// Lyric helper methods.
+ /// Gets matching lyric file for a requested item.
///
- public static class LyricInfo
+ /// The lyricProvider interface to use.
+ /// Path of requested item.
+ /// Lyric file path if passed lyric provider's supported media type is found; otherwise, null.
+ public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath)
{
- ///
- /// Gets matching lyric file for a requested item.
- ///
- /// The lyricProvider interface to use.
- /// Path of requested item.
- /// Lyric file path if passed lyric provider's supported media type is found; otherwise, null.
- public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath)
+ foreach (string lyricFileExtension in lyricProvider.SupportedMediaTypes)
{
- if (lyricProvider.SupportedMediaTypes.Any())
+ var lyricFilePath = Path.ChangeExtension(itemPath, lyricFileExtension);
+ if (File.Exists(lyricFilePath))
{
- foreach (string lyricFileExtension in lyricProvider.SupportedMediaTypes)
- {
- string lyricFilePath = @Path.ChangeExtension(itemPath, lyricFileExtension);
- if (System.IO.File.Exists(lyricFilePath))
- {
- return lyricFilePath;
- }
- }
+ return lyricFilePath;
}
-
- return null;
}
+
+ return null;
}
}
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 796ca3bc36..e18cb1101e 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -1,22 +1,19 @@
-#nullable disable
-
using System.Collections.Generic;
-namespace MediaBrowser.Controller.Lyrics
+namespace MediaBrowser.Controller.Lyrics;
+
+///
+/// LyricResponse model.
+///
+public class LyricResponse
{
///
- /// LyricResponse model.
+ /// Gets or sets Metadata.
///
- public class LyricResponse
- {
- ///
- /// Gets or sets Metadata.
- ///
- public IDictionary Metadata { get; set; }
+ public IDictionary? Metadata { get; set; }
- ///
- /// Gets or sets Lyrics.
- ///
- public IEnumerable Lyrics { get; set; }
- }
+ ///
+ /// Gets or sets Lyrics.
+ ///
+ public IEnumerable? Lyrics { get; set; }
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 59a172cee2..9bacfc2964 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -1,112 +1,102 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Dynamic;
using System.Globalization;
using System.Linq;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
-using Swashbuckle.AspNetCore.SwaggerGen;
-namespace MediaBrowser.Providers.Lyric
+namespace MediaBrowser.Providers.Lyric;
+
+///
+/// LRC Lyric Provider.
+///
+public class LrcLyricProvider : ILyricProvider
{
- ///
- /// LRC Lyric Provider.
- ///
- public class LrcLyricProvider : ILyricProvider
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public LrcLyricProvider()
- {
- Name = "LrcLyricProvider";
+ ///
+ public string Name { get; } = "LrcLyricProvider";
- SupportedMediaTypes = new Collection
+ ///
+ public IEnumerable SupportedMediaTypes
+ {
+ get => new Collection
{
"lrc"
};
- }
+ }
- ///
- /// Gets a value indicating the provider name.
- ///
- public string Name { get; }
+ ///
+ /// Opens lyric file for the requested item, and processes it for API return.
+ ///
+ /// The item to to process.
+ /// If provider can determine lyrics, returns a with or without metadata; otherwise, null.
+ public LyricResponse? GetLyrics(BaseItem item)
+ {
+ string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
- ///
- /// Gets a value indicating the File Extenstions this provider supports.
- ///
- public IEnumerable SupportedMediaTypes { get; }
-
- ///
- /// Opens lyric file for the requested item, and processes it for API return.
- ///
- /// The item to to process.
- /// If provider can determine lyrics, returns a with or without metadata; otherwise, null.
- public LyricResponse? GetLyrics(BaseItem item)
+ if (string.IsNullOrEmpty(lyricFilePath))
{
- string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
-
- if (string.IsNullOrEmpty(lyricFilePath))
- {
- return null;
- }
-
- List lyricList = new List();
- List sortedLyricData = new List();
-
- IDictionary metaData = new Dictionary();
- string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
-
- try
- {
- // Parse and sort lyric rows
- LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
- Song lyricData = lrcLyricParser.Decode(lrcFileContent);
- sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.ToArray()[0].Value).ToList();
-
- // Parse metadata rows
- var metaDataRows = lyricData.Lyrics
- .Where(x => x.TimeTags.Count == 0)
- .Where(x => x.Text.StartsWith("[", StringComparison.Ordinal) && x.Text.EndsWith("]", StringComparison.Ordinal))
- .Select(x => x.Text)
- .ToList();
-
- foreach (string metaDataRow in metaDataRows)
- {
- var metaDataField = metaDataRow.Split(":");
-
- string metaDataFieldName = metaDataField[0].Replace("[", string.Empty, StringComparison.Ordinal).Trim();
- string metaDataFieldValue = metaDataField[1].Replace("]", string.Empty, StringComparison.Ordinal).Trim();
-
- metaData.Add(metaDataFieldName, metaDataFieldValue);
- }
- }
- catch
- {
- return null;
- }
-
- if (!sortedLyricData.Any())
- {
- return null;
- }
-
- for (int i = 0; i < sortedLyricData.Count; i++)
- {
- var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
- long ticks = Convert.ToInt64(timeData, new NumberFormatInfo()) * 10000;
- lyricList.Add(new Controller.Lyrics.Lyric { Start = ticks, Text = sortedLyricData[i].Text });
- }
-
- if (metaData.Any())
- {
- return new LyricResponse { Metadata = metaData, Lyrics = lyricList };
- }
-
- return new LyricResponse { Lyrics = lyricList };
+ return null;
}
+
+ List lyricList = new List();
+ List sortedLyricData = new List();
+
+ IDictionary metaData = new Dictionary();
+ string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
+
+ try
+ {
+ // Parse and sort lyric rows
+ LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
+ Song lyricData = lrcLyricParser.Decode(lrcFileContent);
+ sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.First().Value).ToList();
+
+ // Parse metadata rows
+ var metaDataRows = lyricData.Lyrics
+ .Where(x => x.TimeTags.Count == 0)
+ .Where(x => x.Text.StartsWith('[') && x.Text.EndsWith(']'))
+ .Select(x => x.Text)
+ .ToList();
+
+ foreach (string metaDataRow in metaDataRows)
+ {
+ var metaDataField = metaDataRow.Split(':');
+ if (metaDataField.Length != 2)
+ {
+ continue;
+ }
+
+ string metaDataFieldName = metaDataField[0][1..].Trim();
+ string metaDataFieldValue = metaDataField[1][..^1].Trim();
+
+ metaData.Add(metaDataFieldName, metaDataFieldValue);
+ }
+ }
+ catch
+ {
+ return null;
+ }
+
+ if (sortedLyricData.Count == 0)
+ {
+ return null;
+ }
+
+ for (int i = 0; i < sortedLyricData.Count; i++)
+ {
+ var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
+ long ticks = TimeSpan.FromMilliseconds((double)timeData).Ticks;
+ lyricList.Add(new Controller.Lyrics.Lyric(sortedLyricData[i].Text, ticks));
+ }
+
+ if (metaData.Any())
+ {
+ return new LyricResponse { Metadata = metaData, Lyrics = lyricList };
+ }
+
+ return new LyricResponse { Lyrics = lyricList };
}
}
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index f5560b0542..06f913d079 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -1,55 +1,57 @@
-#nullable disable
-
-#pragma warning disable CS1591
-
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
-namespace MediaBrowser.Providers.Lyric
+namespace MediaBrowser.Providers.Lyric;
+
+///
+/// Lyric Manager.
+///
+public class LyricManager : ILyricManager
{
- public class LyricManager : ILyricManager
+ private readonly ILyricProvider[] _lyricProviders;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// All found lyricProviders.
+ public LyricManager(IEnumerable lyricProviders)
{
- private readonly ILyricProvider[] _lyricProviders;
+ _lyricProviders = lyricProviders.ToArray();
+ }
- public LyricManager(IEnumerable lyricProviders)
+ ///
+ public LyricResponse GetLyrics(BaseItem item)
+ {
+ foreach (ILyricProvider provider in _lyricProviders)
{
- _lyricProviders = lyricProviders.ToArray();
+ var results = provider.GetLyrics(item);
+ if (results is not null)
+ {
+ return results;
+ }
}
- ///
- public LyricResponse GetLyrics(BaseItem item)
+ return null;
+ }
+
+ ///
+ public bool HasLyricFile(BaseItem item)
+ {
+ foreach (ILyricProvider provider in _lyricProviders)
{
- foreach (ILyricProvider provider in _lyricProviders)
+ if (item is null)
{
- var results = provider.GetLyrics(item);
- if (results is not null)
- {
- return results;
- }
+ continue;
}
- return null;
- }
-
- ///
- public bool HasLyricFile(BaseItem item)
- {
- foreach (ILyricProvider provider in _lyricProviders)
+ if (LyricInfo.GetLyricFilePath(provider, item.Path) is not null)
{
- if (item is null)
- {
- continue;
- }
-
- if (LyricInfo.GetLyricFilePath(provider, item.Path) is not null)
- {
- return true;
- }
+ return true;
}
-
- return false;
}
+
+ return false;
}
}
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 8a51d7277c..d417c85981 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -5,69 +5,53 @@ using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
-namespace MediaBrowser.Providers.Lyric
-{
- ///
- /// TXT Lyric Provider.
- ///
- public class TxtLyricProvider : ILyricProvider
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public TxtLyricProvider()
- {
- Name = "TxtLyricProvider";
+namespace MediaBrowser.Providers.Lyric;
- SupportedMediaTypes = new Collection
+///
+/// TXT Lyric Provider.
+///
+public class TxtLyricProvider : ILyricProvider
+{
+ ///
+ public string Name { get; } = "TxtLyricProvider";
+
+ ///
+ public IEnumerable SupportedMediaTypes
+ {
+ get => new Collection
{
"lrc", "txt"
};
- }
+ }
- ///
- /// Gets a value indicating the provider name.
- ///
- public string Name { get; }
+ ///
+ /// Opens lyric file for the requested item, and processes it for API return.
+ ///
+ /// The item to to process.
+ /// If provider can determine lyrics, returns a ; otherwise, null.
+ public LyricResponse? GetLyrics(BaseItem item)
+ {
+ string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
- ///
- /// Gets a value indicating the File Extenstions this provider supports.
- ///
- public IEnumerable SupportedMediaTypes { get; }
-
- ///
- /// Opens lyric file for the requested item, and processes it for API return.
- ///
- /// The item to to process.
- /// If provider can determine lyrics, returns a ; otherwise, null.
- public LyricResponse? GetLyrics(BaseItem item)
+ if (string.IsNullOrEmpty(lyricFilePath))
{
- string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
-
- if (string.IsNullOrEmpty(lyricFilePath))
- {
- return null;
- }
-
- List lyricList = new List();
-
- string lyricData = System.IO.File.ReadAllText(lyricFilePath);
-
- // Splitting on Environment.NewLine caused some new lines to be missed in Windows.
- char[] newLineDelims = new[] { '\r', '\n' };
- string[] lyricTextLines = lyricData.Split(newLineDelims, StringSplitOptions.RemoveEmptyEntries);
-
- if (!lyricTextLines.Any())
- {
- return null;
- }
-
- foreach (string lyricTextLine in lyricTextLines)
- {
- lyricList.Add(new Controller.Lyrics.Lyric { Text = lyricTextLine });
- }
-
- return new LyricResponse { Lyrics = lyricList };
+ return null;
}
+
+ string[] lyricTextLines = System.IO.File.ReadAllLines(lyricFilePath);
+
+ List lyricList = new List();
+
+ if (lyricTextLines.Length == 0)
+ {
+ return null;
+ }
+
+ foreach (string lyricTextLine in lyricTextLines)
+ {
+ lyricList.Add(new Controller.Lyrics.Lyric(lyricTextLine));
+ }
+
+ return new LyricResponse { Lyrics = lyricList };
}
}
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 8514489f8a..e12776ba05 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -6,7 +6,6 @@
-
From 64b013b121f472d2658e5f2b3a672c4c4ced342d Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 17:48:27 -0400
Subject: [PATCH 081/262] Resolve Azure build issues
---
MediaBrowser.Controller/Lyrics/ILyricManager.cs | 2 +-
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 7 ++++++-
MediaBrowser.Providers/Lyric/LyricManager.cs | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/ILyricManager.cs b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
index dad0250f6b..5920bcc628 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricManager.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
@@ -12,7 +12,7 @@ public interface ILyricManager
///
/// The media item.
/// Lyrics for passed item.
- LyricResponse GetLyrics(BaseItem item);
+ LyricResponse? GetLyrics(BaseItem item);
///
/// Checks if requested item has a matching local lyric file.
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 9bacfc2964..db87d92368 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -87,7 +87,12 @@ public class LrcLyricProvider : ILyricProvider
for (int i = 0; i < sortedLyricData.Count; i++)
{
- var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;
+ var timeData = sortedLyricData[i].TimeTags.First().Value;
+ if (timeData is null)
+ {
+ continue;
+ }
+
long ticks = TimeSpan.FromMilliseconds((double)timeData).Ticks;
lyricList.Add(new Controller.Lyrics.Lyric(sortedLyricData[i].Text, ticks));
}
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index 06f913d079..0de008db7f 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -22,7 +22,7 @@ public class LyricManager : ILyricManager
}
///
- public LyricResponse GetLyrics(BaseItem item)
+ public LyricResponse? GetLyrics(BaseItem item)
{
foreach (ILyricProvider provider in _lyricProviders)
{
From 0b86630be7737e28555f0132322ecd02915284c5 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sat, 17 Sep 2022 19:47:29 -0400
Subject: [PATCH 082/262] Use model properties for LRC metadata
---
.../Lyrics/LyricResponse.cs | 2 +-
MediaBrowser.Controller/Lyrics/Metadata.cs | 54 +++++++++++++++++++
.../MediaBrowser.Controller.csproj | 1 +
.../Lyric/LrcLyricProvider.cs | 11 ++--
4 files changed, 64 insertions(+), 4 deletions(-)
create mode 100644 MediaBrowser.Controller/Lyrics/Metadata.cs
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index e18cb1101e..adc13050ee 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -10,7 +10,7 @@ public class LyricResponse
///
/// Gets or sets Metadata.
///
- public IDictionary? Metadata { get; set; }
+ public Metadata? Metadata { get; set; }
///
/// Gets or sets Lyrics.
diff --git a/MediaBrowser.Controller/Lyrics/Metadata.cs b/MediaBrowser.Controller/Lyrics/Metadata.cs
new file mode 100644
index 0000000000..114b56777a
--- /dev/null
+++ b/MediaBrowser.Controller/Lyrics/Metadata.cs
@@ -0,0 +1,54 @@
+using System.Collections.Generic;
+
+namespace MediaBrowser.Controller.Lyrics;
+
+///
+/// Metadata model.
+///
+public class Metadata
+{
+ ///
+ /// Gets or sets Artist - [ar:The song artist].
+ ///
+ public string? Ar { get; set; }
+
+ ///
+ /// Gets or sets Album - [al:The album this song is on].
+ ///
+ public string? Al { get; set; }
+
+ ///
+ /// Gets or sets Title - [ti:The title of the song].
+ ///
+ public string? Ti { get; set; }
+
+ ///
+ /// Gets or sets Author - [au:Creator of the lyric data].
+ ///
+ public string? Au { get; set; }
+
+ ///
+ /// Gets or sets Length - [length:How long the song is].
+ ///
+ public string? Length { get; set; }
+
+ ///
+ /// Gets or sets By - [by:Creator of the LRC file].
+ ///
+ public string? By { get; set; }
+
+ ///
+ /// Gets or sets Offset - [offsec:+/- Timestamp adjustment in milliseconds].
+ ///
+ public string? Offset { get; set; }
+
+ ///
+ /// Gets or sets Creator - [re:The Software used to create the LRC file].
+ ///
+ public string? Re { get; set; }
+
+ ///
+ /// Gets or sets Version - [ve:The version of the Creator used].
+ ///
+ public string? Ve { get; set; }
+}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index d4e025a43e..c08e276dcf 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -18,6 +18,7 @@
+
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index db87d92368..b527c5303c 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
+using AutoMapper;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
@@ -44,7 +45,8 @@ public class LrcLyricProvider : ILyricProvider
List lyricList = new List();
List sortedLyricData = new List();
- IDictionary metaData = new Dictionary();
+ // Must be for automapper support
+ IDictionary metaData = new Dictionary();
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
try
@@ -69,7 +71,7 @@ public class LrcLyricProvider : ILyricProvider
continue;
}
- string metaDataFieldName = metaDataField[0][1..].Trim();
+ string metaDataFieldName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(metaDataField[0][1..].Trim().ToLowerInvariant());
string metaDataFieldValue = metaDataField[1][..^1].Trim();
metaData.Add(metaDataFieldName, metaDataFieldValue);
@@ -85,6 +87,9 @@ public class LrcLyricProvider : ILyricProvider
return null;
}
+ var config = new MapperConfiguration(cfg => { });
+ var mapper = config.CreateMapper();
+
for (int i = 0; i < sortedLyricData.Count; i++)
{
var timeData = sortedLyricData[i].TimeTags.First().Value;
@@ -99,7 +104,7 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.Any())
{
- return new LyricResponse { Metadata = metaData, Lyrics = lyricList };
+ return new LyricResponse { Metadata = mapper.Map(metaData), Lyrics = lyricList };
}
return new LyricResponse { Lyrics = lyricList };
From a52d108af6b8519715bc7005e7db3f1a116760bc Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 11:47:57 -0400
Subject: [PATCH 083/262] Remove automapper tool
---
.../Lyrics/LyricMetadata.cs | 52 +++++++++++++
.../Lyrics/LyricResponse.cs | 2 +-
MediaBrowser.Controller/Lyrics/Metadata.cs | 54 -------------
.../MediaBrowser.Controller.csproj | 1 -
.../Lyric/LrcLyricProvider.cs | 78 ++++++++++++++++---
5 files changed, 120 insertions(+), 67 deletions(-)
create mode 100644 MediaBrowser.Controller/Lyrics/LyricMetadata.cs
delete mode 100644 MediaBrowser.Controller/Lyrics/Metadata.cs
diff --git a/MediaBrowser.Controller/Lyrics/LyricMetadata.cs b/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
new file mode 100644
index 0000000000..36a833f85c
--- /dev/null
+++ b/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
@@ -0,0 +1,52 @@
+namespace MediaBrowser.Controller.Lyrics;
+
+///
+/// LyricMetadata model.
+///
+public class LyricMetadata
+{
+ ///
+ /// Gets or sets Artist - The song artist.
+ ///
+ public string? Artist { get; set; }
+
+ ///
+ /// Gets or sets Album - The album this song is on.
+ ///
+ public string? Album { get; set; }
+
+ ///
+ /// Gets or sets Title - The title of the song.
+ ///
+ public string? Title { get; set; }
+
+ ///
+ /// Gets or sets Author - Creator of the lyric data.
+ ///
+ public string? Author { get; set; }
+
+ ///
+ /// Gets or sets Length - How long the song is.
+ ///
+ public string? Length { get; set; }
+
+ ///
+ /// Gets or sets By - Creator of the LRC file.
+ ///
+ public string? By { get; set; }
+
+ ///
+ /// Gets or sets Offset - Offset:+/- Timestamp adjustment in milliseconds.
+ ///
+ public string? Offset { get; set; }
+
+ ///
+ /// Gets or sets Creator - The Software used to create the LRC file.
+ ///
+ public string? Creator { get; set; }
+
+ ///
+ /// Gets or sets Version - The version of the Creator used.
+ ///
+ public string? Version { get; set; }
+}
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index adc13050ee..9892483889 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -10,7 +10,7 @@ public class LyricResponse
///
/// Gets or sets Metadata.
///
- public Metadata? Metadata { get; set; }
+ public LyricMetadata? Metadata { get; set; }
///
/// Gets or sets Lyrics.
diff --git a/MediaBrowser.Controller/Lyrics/Metadata.cs b/MediaBrowser.Controller/Lyrics/Metadata.cs
deleted file mode 100644
index 114b56777a..0000000000
--- a/MediaBrowser.Controller/Lyrics/Metadata.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System.Collections.Generic;
-
-namespace MediaBrowser.Controller.Lyrics;
-
-///
-/// Metadata model.
-///
-public class Metadata
-{
- ///
- /// Gets or sets Artist - [ar:The song artist].
- ///
- public string? Ar { get; set; }
-
- ///
- /// Gets or sets Album - [al:The album this song is on].
- ///
- public string? Al { get; set; }
-
- ///
- /// Gets or sets Title - [ti:The title of the song].
- ///
- public string? Ti { get; set; }
-
- ///
- /// Gets or sets Author - [au:Creator of the lyric data].
- ///
- public string? Au { get; set; }
-
- ///
- /// Gets or sets Length - [length:How long the song is].
- ///
- public string? Length { get; set; }
-
- ///
- /// Gets or sets By - [by:Creator of the LRC file].
- ///
- public string? By { get; set; }
-
- ///
- /// Gets or sets Offset - [offsec:+/- Timestamp adjustment in milliseconds].
- ///
- public string? Offset { get; set; }
-
- ///
- /// Gets or sets Creator - [re:The Software used to create the LRC file].
- ///
- public string? Re { get; set; }
-
- ///
- /// Gets or sets Version - [ve:The version of the Creator used].
- ///
- public string? Ve { get; set; }
-}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index c08e276dcf..d4e025a43e 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -18,7 +18,6 @@
-
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index b527c5303c..4cc06dac8d 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Globalization;
using System.Linq;
-using AutoMapper;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
+using Newtonsoft.Json.Linq;
namespace MediaBrowser.Providers.Lyric;
@@ -45,8 +44,7 @@ public class LrcLyricProvider : ILyricProvider
List lyricList = new List();
List sortedLyricData = new List();
- // Must be for automapper support
- IDictionary metaData = new Dictionary();
+ IDictionary fileMetaData = new Dictionary();
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
try
@@ -71,10 +69,10 @@ public class LrcLyricProvider : ILyricProvider
continue;
}
- string metaDataFieldName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(metaDataField[0][1..].Trim().ToLowerInvariant());
+ string metaDataFieldName = metaDataField[0][1..].Trim().ToLowerInvariant();
string metaDataFieldValue = metaDataField[1][..^1].Trim();
- metaData.Add(metaDataFieldName, metaDataFieldValue);
+ fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
}
}
catch
@@ -87,9 +85,6 @@ public class LrcLyricProvider : ILyricProvider
return null;
}
- var config = new MapperConfiguration(cfg => { });
- var mapper = config.CreateMapper();
-
for (int i = 0; i < sortedLyricData.Count; i++)
{
var timeData = sortedLyricData[i].TimeTags.First().Value;
@@ -102,11 +97,72 @@ public class LrcLyricProvider : ILyricProvider
lyricList.Add(new Controller.Lyrics.Lyric(sortedLyricData[i].Text, ticks));
}
- if (metaData.Any())
+ if (fileMetaData.Any())
{
- return new LyricResponse { Metadata = mapper.Map(metaData), Lyrics = lyricList };
+ // Map metaData values from LRC file to LyricMetadata properties
+ LyricMetadata lyricMetadata = MapMetadataValues(fileMetaData);
+
+ return new LyricResponse { Metadata = lyricMetadata, Lyrics = lyricList };
}
return new LyricResponse { Lyrics = lyricList };
}
+
+ ///
+ /// Converts metadata from an LRC file to LyricMetadata properties.
+ ///
+ /// The metadata from the LRC file.
+ /// A lyricMetadata object with mapped property data.
+ private LyricMetadata MapMetadataValues(IDictionary metaData)
+ {
+ LyricMetadata lyricMetadata = new LyricMetadata();
+
+ if (metaData.TryGetValue("ar", out var artist) && artist is not null)
+ {
+ lyricMetadata.Artist = artist;
+ }
+
+ if (metaData.TryGetValue("al", out var album) && album is not null)
+ {
+ lyricMetadata.Album = album;
+ }
+
+ if (metaData.TryGetValue("ti", out var title) && title is not null)
+ {
+ lyricMetadata.Title = title;
+ }
+
+ if (metaData.TryGetValue("au", out var author) && author is not null)
+ {
+ lyricMetadata.Author = author;
+ }
+
+ if (metaData.TryGetValue("length", out var length) && length is not null)
+ {
+ lyricMetadata.Length = length;
+ }
+
+ if (metaData.TryGetValue("by", out var by) && by is not null)
+ {
+ lyricMetadata.By = by;
+ }
+
+ if (metaData.TryGetValue("offset", out var offset) && offset is not null)
+ {
+ lyricMetadata.Offset = offset;
+ }
+
+ if (metaData.TryGetValue("re", out var creator) && creator is not null)
+ {
+ lyricMetadata.Creator = creator;
+ }
+
+ if (metaData.TryGetValue("ve", out var version) && version is not null)
+ {
+ lyricMetadata.Version = version;
+ }
+
+ return lyricMetadata;
+
+ }
}
From db662eeb333ea4e5c7764c4738e8e88a5efc0e8c Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 12:38:01 -0400
Subject: [PATCH 084/262] Update
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
Co-authored-by: Cody Robibero
---
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index d417c85981..e48bc6963e 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -16,13 +16,7 @@ public class TxtLyricProvider : ILyricProvider
public string Name { get; } = "TxtLyricProvider";
///
- public IEnumerable SupportedMediaTypes
- {
- get => new Collection
- {
- "lrc", "txt"
- };
- }
+ public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc", "txt" };
///
/// Opens lyric file for the requested item, and processes it for API return.
From 1aa8b22b89ec320ff0b4215cc35e1bca60e782ba Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 12:38:10 -0400
Subject: [PATCH 085/262] Update
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
Co-authored-by: Cody Robibero
---
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index e48bc6963e..a2161c427f 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -13,7 +13,7 @@ namespace MediaBrowser.Providers.Lyric;
public class TxtLyricProvider : ILyricProvider
{
///
- public string Name { get; } = "TxtLyricProvider";
+ public string Name => "TxtLyricProvider";
///
public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc", "txt" };
From 636835f73a544a25c0ce2f7d35682df723cf3955 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 12:38:24 -0400
Subject: [PATCH 086/262] Update
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
Co-authored-by: Cody Robibero
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 4cc06dac8d..f862552667 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -16,7 +16,7 @@ namespace MediaBrowser.Providers.Lyric;
public class LrcLyricProvider : ILyricProvider
{
///
- public string Name { get; } = "LrcLyricProvider";
+ public string Name => "LrcLyricProvider";
///
public IEnumerable SupportedMediaTypes
From baf07ddbfe971a74af3802973832d621abf55681 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 12:39:07 -0400
Subject: [PATCH 087/262] Update
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
Co-authored-by: Cody Robibero
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index f862552667..e478700443 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -97,7 +97,7 @@ public class LrcLyricProvider : ILyricProvider
lyricList.Add(new Controller.Lyrics.Lyric(sortedLyricData[i].Text, ticks));
}
- if (fileMetaData.Any())
+ if (fileMetaData.Count != 0)
{
// Map metaData values from LRC file to LyricMetadata properties
LyricMetadata lyricMetadata = MapMetadataValues(fileMetaData);
From c85cbcced691faab5ce0c8864e23bfa2f5f2d696 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 12:39:19 -0400
Subject: [PATCH 088/262] Update
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
Co-authored-by: Cody Robibero
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index e478700443..311a8e21d8 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -93,7 +93,7 @@ public class LrcLyricProvider : ILyricProvider
continue;
}
- long ticks = TimeSpan.FromMilliseconds((double)timeData).Ticks;
+ long ticks = TimeSpan.FromMilliseconds(timeData.Value).Ticks;
lyricList.Add(new Controller.Lyrics.Lyric(sortedLyricData[i].Text, ticks));
}
From 10b07ed9a582a06d947f6fb7ec2ab9fd94215587 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 12:39:38 -0400
Subject: [PATCH 089/262] Update
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
Co-authored-by: Cody Robibero
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 311a8e21d8..90396e5532 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -19,13 +19,7 @@ public class LrcLyricProvider : ILyricProvider
public string Name => "LrcLyricProvider";
///
- public IEnumerable SupportedMediaTypes
- {
- get => new Collection
- {
- "lrc"
- };
- }
+ public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc" };
///
/// Opens lyric file for the requested item, and processes it for API return.
From f737581d49dd9f6ab0c68269f8be073df27fb0ba Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 13:13:01 -0400
Subject: [PATCH 090/262] Use providers in order of priority
---
.../Lyrics/ILyricProvider.cs | 7 +++
.../Lyric/LrcLyricProvider.cs | 48 ++++++++++++-------
MediaBrowser.Providers/Lyric/LyricManager.cs | 2 +-
.../Lyric/TxtLyricProvider.cs | 7 +++
4 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
index 1b52de255f..651fe507f9 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Resolvers;
namespace MediaBrowser.Controller.Lyrics;
@@ -13,6 +14,12 @@ public interface ILyricProvider
///
string Name { get; }
+ ///
+ /// Gets the priority.
+ ///
+ /// The priority.
+ ResolverPriority Priority { get; }
+
///
/// Gets the supported media types for this provider.
///
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 90396e5532..4690c3e209 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.Linq;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
-using Newtonsoft.Json.Linq;
+using MediaBrowser.Controller.Resolvers;
+using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Lyric;
@@ -15,9 +15,26 @@ namespace MediaBrowser.Providers.Lyric;
///
public class LrcLyricProvider : ILyricProvider
{
+ private readonly ILogger _logger;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the interface.
+ public LrcLyricProvider(ILogger logger)
+ {
+ _logger = logger;
+ }
+
///
public string Name => "LrcLyricProvider";
+ ///
+ /// Gets the priority.
+ ///
+ /// The priority.
+ public ResolverPriority Priority => ResolverPriority.First;
+
///
public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc" };
@@ -38,7 +55,7 @@ public class LrcLyricProvider : ILyricProvider
List lyricList = new List();
List sortedLyricData = new List();
- IDictionary fileMetaData = new Dictionary();
+ IDictionary fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
try
@@ -63,15 +80,15 @@ public class LrcLyricProvider : ILyricProvider
continue;
}
- string metaDataFieldName = metaDataField[0][1..].Trim().ToLowerInvariant();
+ string metaDataFieldName = metaDataField[0][1..].Trim();
string metaDataFieldValue = metaDataField[1][..^1].Trim();
fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
}
}
- catch
+ catch (Exception ex)
{
- return null;
+ _logger.LogError(ex, "Error parsing lyric data from {Provider}", Name);
}
if (sortedLyricData.Count == 0)
@@ -111,52 +128,51 @@ public class LrcLyricProvider : ILyricProvider
{
LyricMetadata lyricMetadata = new LyricMetadata();
- if (metaData.TryGetValue("ar", out var artist) && artist is not null)
+ if (metaData.TryGetValue("ar", out var artist) && !string.IsNullOrEmpty(artist))
{
lyricMetadata.Artist = artist;
}
- if (metaData.TryGetValue("al", out var album) && album is not null)
+ if (metaData.TryGetValue("al", out var album) && !string.IsNullOrEmpty(album))
{
lyricMetadata.Album = album;
}
- if (metaData.TryGetValue("ti", out var title) && title is not null)
+ if (metaData.TryGetValue("ti", out var title) && !string.IsNullOrEmpty(title))
{
lyricMetadata.Title = title;
}
- if (metaData.TryGetValue("au", out var author) && author is not null)
+ if (metaData.TryGetValue("au", out var author) && !string.IsNullOrEmpty(author))
{
lyricMetadata.Author = author;
}
- if (metaData.TryGetValue("length", out var length) && length is not null)
+ if (metaData.TryGetValue("length", out var length) && !string.IsNullOrEmpty(length))
{
lyricMetadata.Length = length;
}
- if (metaData.TryGetValue("by", out var by) && by is not null)
+ if (metaData.TryGetValue("by", out var by) && !string.IsNullOrEmpty(by))
{
lyricMetadata.By = by;
}
- if (metaData.TryGetValue("offset", out var offset) && offset is not null)
+ if (metaData.TryGetValue("offset", out var offset) && !string.IsNullOrEmpty(offset))
{
lyricMetadata.Offset = offset;
}
- if (metaData.TryGetValue("re", out var creator) && creator is not null)
+ if (metaData.TryGetValue("re", out var creator) && !string.IsNullOrEmpty(creator))
{
lyricMetadata.Creator = creator;
}
- if (metaData.TryGetValue("ve", out var version) && version is not null)
+ if (metaData.TryGetValue("ve", out var version) && !string.IsNullOrEmpty(version))
{
lyricMetadata.Version = version;
}
return lyricMetadata;
-
}
}
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index 0de008db7f..7487c68615 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -18,7 +18,7 @@ public class LyricManager : ILyricManager
/// All found lyricProviders.
public LyricManager(IEnumerable lyricProviders)
{
- _lyricProviders = lyricProviders.ToArray();
+ _lyricProviders = lyricProviders.OrderBy(i => i.Priority).ToArray();
}
///
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index a2161c427f..c690086862 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
+using MediaBrowser.Controller.Resolvers;
namespace MediaBrowser.Providers.Lyric;
@@ -15,6 +16,12 @@ public class TxtLyricProvider : ILyricProvider
///
public string Name => "TxtLyricProvider";
+ ///
+ /// Gets the priority.
+ ///
+ /// The priority.
+ public ResolverPriority Priority => ResolverPriority.Second;
+
///
public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc", "txt" };
From dce81d88182c90fdce90f2690b3adb22485fecd4 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 14:53:25 -0400
Subject: [PATCH 091/262] Update
MediaBrowser.Controller/Lyrics/LyricResponse.cs
Co-authored-by: Niels van Velzen
---
MediaBrowser.Controller/Lyrics/LyricResponse.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 9892483889..f3d8b07bc8 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -10,7 +10,7 @@ public class LyricResponse
///
/// Gets or sets Metadata.
///
- public LyricMetadata? Metadata { get; set; }
+ public LyricMetadata Metadata { get; set; }
///
/// Gets or sets Lyrics.
From dddebec794c72242952cb45e84fed452d828a641 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 14:53:36 -0400
Subject: [PATCH 092/262] Update
MediaBrowser.Controller/Lyrics/LyricResponse.cs
Co-authored-by: Niels van Velzen
---
MediaBrowser.Controller/Lyrics/LyricResponse.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index f3d8b07bc8..405e8cac18 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -15,5 +15,5 @@ public class LyricResponse
///
/// Gets or sets Lyrics.
///
- public IEnumerable? Lyrics { get; set; }
+ public IEnumerable Lyrics { get; set; }
}
From 7e923e268865d8c0933a22247424d205429a474b Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 16:05:50 -0400
Subject: [PATCH 093/262] Use numeric values for metadata values
---
.../Lyrics/ILyricProvider.cs | 2 +-
.../Lyrics/{Lyric.cs => LyricLine.cs} | 6 +--
.../Lyrics/LyricMetadata.cs | 6 ++-
.../Lyrics/LyricResponse.cs | 2 +-
.../Lyric/LrcLyricProvider.cs | 53 +++++++++++++++----
.../Lyric/TxtLyricProvider.cs | 9 ++--
6 files changed, 56 insertions(+), 22 deletions(-)
rename MediaBrowser.Controller/Lyrics/{Lyric.cs => LyricLine.cs} (77%)
diff --git a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
index 651fe507f9..c5b6252267 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
@@ -24,7 +24,7 @@ public interface ILyricProvider
/// Gets the supported media types for this provider.
///
/// The supported media types.
- IEnumerable SupportedMediaTypes { get; }
+ IReadOnlyCollection SupportedMediaTypes { get; }
///
/// Gets the lyrics.
diff --git a/MediaBrowser.Controller/Lyrics/Lyric.cs b/MediaBrowser.Controller/Lyrics/LyricLine.cs
similarity index 77%
rename from MediaBrowser.Controller/Lyrics/Lyric.cs
rename to MediaBrowser.Controller/Lyrics/LyricLine.cs
index f39fbb0221..43997f6564 100644
--- a/MediaBrowser.Controller/Lyrics/Lyric.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricLine.cs
@@ -3,14 +3,14 @@ namespace MediaBrowser.Controller.Lyrics;
///
/// Lyric model.
///
-public class Lyric
+public class LyricLine
{
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// The lyric start time in ticks.
/// The lyric text.
- public Lyric(string text, long? start = null)
+ public LyricLine(string text, long? start = null)
{
Start = start;
Text = text;
diff --git a/MediaBrowser.Controller/Lyrics/LyricMetadata.cs b/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
index 36a833f85c..0ba7779750 100644
--- a/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
@@ -1,3 +1,5 @@
+using System;
+
namespace MediaBrowser.Controller.Lyrics;
///
@@ -28,7 +30,7 @@ public class LyricMetadata
///
/// Gets or sets Length - How long the song is.
///
- public string? Length { get; set; }
+ public long? Length { get; set; }
///
/// Gets or sets By - Creator of the LRC file.
@@ -38,7 +40,7 @@ public class LyricMetadata
///
/// Gets or sets Offset - Offset:+/- Timestamp adjustment in milliseconds.
///
- public string? Offset { get; set; }
+ public long? Offset { get; set; }
///
/// Gets or sets Creator - The Software used to create the LRC file.
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 405e8cac18..b3c65ac8c0 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -15,5 +15,5 @@ public class LyricResponse
///
/// Gets or sets Lyrics.
///
- public IEnumerable Lyrics { get; set; }
+ public IEnumerable Lyrics { get; set; }
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 4690c3e209..50fa519b3e 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Resolvers;
+using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Lyric;
@@ -36,7 +38,7 @@ public class LrcLyricProvider : ILyricProvider
public ResolverPriority Priority => ResolverPriority.First;
///
- public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc" };
+ public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc" };
///
/// Opens lyric file for the requested item, and processes it for API return.
@@ -52,7 +54,7 @@ public class LrcLyricProvider : ILyricProvider
return null;
}
- List lyricList = new List();
+ List lyricList = new List();
List sortedLyricData = new List();
IDictionary fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
@@ -74,14 +76,28 @@ public class LrcLyricProvider : ILyricProvider
foreach (string metaDataRow in metaDataRows)
{
- var metaDataField = metaDataRow.Split(':');
- if (metaDataField.Length != 2)
+ int colonCount = metaDataRow.Count(f => (f == ':'));
+ if (colonCount == 0)
{
continue;
}
- string metaDataFieldName = metaDataField[0][1..].Trim();
- string metaDataFieldValue = metaDataField[1][..^1].Trim();
+ string[] metaDataField;
+ string metaDataFieldName;
+ string metaDataFieldValue;
+
+ if (colonCount == 1)
+ {
+ metaDataField = metaDataRow.Split(':');
+ metaDataFieldName = metaDataField[0][1..].Trim();
+ metaDataFieldValue = metaDataField[1][..^1].Trim();
+ }
+ else
+ {
+ int colonIndex = metaDataRow.IndexOf(':', StringComparison.OrdinalIgnoreCase);
+ metaDataFieldName = metaDataRow[..colonIndex][1..].Trim();
+ metaDataFieldValue = metaDataRow[(colonIndex + 1)..][..^1].Trim();
+ }
fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
}
@@ -105,7 +121,7 @@ public class LrcLyricProvider : ILyricProvider
}
long ticks = TimeSpan.FromMilliseconds(timeData.Value).Ticks;
- lyricList.Add(new Controller.Lyrics.Lyric(sortedLyricData[i].Text, ticks));
+ lyricList.Add(new LyricLine(sortedLyricData[i].Text, ticks));
}
if (fileMetaData.Count != 0)
@@ -150,7 +166,23 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.TryGetValue("length", out var length) && !string.IsNullOrEmpty(length))
{
- lyricMetadata.Length = length;
+ // Ensure minutes include leading zero
+ var lengthData = length.Split(':');
+ if (lengthData[0].Length == 1)
+ {
+ length = "0" + length;
+ }
+
+ // If only Minutes and Seconds were provided, prepend zeros for hours
+ if (lengthData.Length == 2)
+ {
+ length = "00:" + length;
+ }
+
+ if (DateTime.TryParseExact(length, "HH:mm:ss", null, DateTimeStyles.None, out var value))
+ {
+ lyricMetadata.Length = value.TimeOfDay.Ticks;
+ }
}
if (metaData.TryGetValue("by", out var by) && !string.IsNullOrEmpty(by))
@@ -160,7 +192,10 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.TryGetValue("offset", out var offset) && !string.IsNullOrEmpty(offset))
{
- lyricMetadata.Offset = offset;
+ if (int.TryParse(offset, out var value))
+ {
+ lyricMetadata.Offset = TimeSpan.FromMilliseconds(value).Ticks;
+ }
}
if (metaData.TryGetValue("re", out var creator) && !string.IsNullOrEmpty(creator))
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index c690086862..cd0e1599e7 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -1,7 +1,4 @@
-using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Resolvers;
@@ -23,7 +20,7 @@ public class TxtLyricProvider : ILyricProvider
public ResolverPriority Priority => ResolverPriority.Second;
///
- public IEnumerable SupportedMediaTypes { get; } = new[] { "lrc", "txt" };
+ public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "txt" };
///
/// Opens lyric file for the requested item, and processes it for API return.
@@ -41,7 +38,7 @@ public class TxtLyricProvider : ILyricProvider
string[] lyricTextLines = System.IO.File.ReadAllLines(lyricFilePath);
- List lyricList = new List();
+ List lyricList = new List();
if (lyricTextLines.Length == 0)
{
@@ -50,7 +47,7 @@ public class TxtLyricProvider : ILyricProvider
foreach (string lyricTextLine in lyricTextLines)
{
- lyricList.Add(new Controller.Lyrics.Lyric(lyricTextLine));
+ lyricList.Add(new LyricLine(lyricTextLine));
}
return new LyricResponse { Lyrics = lyricList };
From 552b6aceae94bd8079a027407d15acf6d46f9b6e Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 16:17:26 -0400
Subject: [PATCH 094/262] Add default values to LyricResponse
---
MediaBrowser.Controller/Lyrics/LyricResponse.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index b3c65ac8c0..ded3ca10e2 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -10,10 +10,10 @@ public class LyricResponse
///
/// Gets or sets Metadata.
///
- public LyricMetadata Metadata { get; set; }
+ public LyricMetadata Metadata { get; set; } = new LyricMetadata();
///
/// Gets or sets Lyrics.
///
- public IEnumerable Lyrics { get; set; }
+ public IReadOnlyCollection Lyrics { get; set; } = new List();
}
From 28d017865b7f51babc7c13dbfaf71a660d834d46 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Sun, 18 Sep 2022 21:17:53 -0400
Subject: [PATCH 095/262] Code Cleanup
---
MediaBrowser.Controller/Lyrics/LyricLine.cs | 2 +-
.../Lyrics/LyricResponse.cs | 4 +-
.../Lyric/LrcLyricProvider.cs | 39 +++++--------------
.../Lyric/TxtLyricProvider.cs | 4 +-
4 files changed, 14 insertions(+), 35 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricLine.cs b/MediaBrowser.Controller/Lyrics/LyricLine.cs
index 43997f6564..eb5ff9972e 100644
--- a/MediaBrowser.Controller/Lyrics/LyricLine.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricLine.cs
@@ -8,8 +8,8 @@ public class LyricLine
///
/// Initializes a new instance of the class.
///
- /// The lyric start time in ticks.
/// The lyric text.
+ /// The lyric start time in ticks.
public LyricLine(string text, long? start = null)
{
Start = start;
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index ded3ca10e2..64c3b3c28b 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -10,10 +10,10 @@ public class LyricResponse
///
/// Gets or sets Metadata.
///
- public LyricMetadata Metadata { get; set; } = new LyricMetadata();
+ public LyricMetadata Metadata { get; set; } = new();
///
/// Gets or sets Lyrics.
///
- public IReadOnlyCollection Lyrics { get; set; } = new List();
+ public IReadOnlyList Lyrics { get; set; } = new List();
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 50fa519b3e..9d622a1cdf 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -38,7 +38,7 @@ public class LrcLyricProvider : ILyricProvider
public ResolverPriority Priority => ResolverPriority.First;
///
- public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc" };
+ public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "elrc" };
///
/// Opens lyric file for the requested item, and processes it for API return.
@@ -54,8 +54,8 @@ public class LrcLyricProvider : ILyricProvider
return null;
}
- List lyricList = new List();
- List sortedLyricData = new List();
+ List lyricList = new();
+ List sortedLyricData = new();
IDictionary fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
@@ -85,19 +85,11 @@ public class LrcLyricProvider : ILyricProvider
string[] metaDataField;
string metaDataFieldName;
string metaDataFieldValue;
+ string[] test;
- if (colonCount == 1)
- {
- metaDataField = metaDataRow.Split(':');
- metaDataFieldName = metaDataField[0][1..].Trim();
- metaDataFieldValue = metaDataField[1][..^1].Trim();
- }
- else
- {
- int colonIndex = metaDataRow.IndexOf(':', StringComparison.OrdinalIgnoreCase);
- metaDataFieldName = metaDataRow[..colonIndex][1..].Trim();
- metaDataFieldValue = metaDataRow[(colonIndex + 1)..][..^1].Trim();
- }
+ metaDataField = metaDataRow.Split(':', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
+ metaDataFieldName = metaDataField[0][1..].Trim();
+ metaDataFieldValue = metaDataField[1][..^1].Trim();
fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
}
@@ -142,7 +134,7 @@ public class LrcLyricProvider : ILyricProvider
/// A lyricMetadata object with mapped property data.
private LyricMetadata MapMetadataValues(IDictionary metaData)
{
- LyricMetadata lyricMetadata = new LyricMetadata();
+ LyricMetadata lyricMetadata = new();
if (metaData.TryGetValue("ar", out var artist) && !string.IsNullOrEmpty(artist))
{
@@ -166,20 +158,7 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.TryGetValue("length", out var length) && !string.IsNullOrEmpty(length))
{
- // Ensure minutes include leading zero
- var lengthData = length.Split(':');
- if (lengthData[0].Length == 1)
- {
- length = "0" + length;
- }
-
- // If only Minutes and Seconds were provided, prepend zeros for hours
- if (lengthData.Length == 2)
- {
- length = "00:" + length;
- }
-
- if (DateTime.TryParseExact(length, "HH:mm:ss", null, DateTimeStyles.None, out var value))
+ if (DateTime.TryParseExact(length, new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" }, null, DateTimeStyles.None, out var value))
{
lyricMetadata.Length = value.TimeOfDay.Ticks;
}
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index cd0e1599e7..542df13873 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -20,7 +20,7 @@ public class TxtLyricProvider : ILyricProvider
public ResolverPriority Priority => ResolverPriority.Second;
///
- public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "txt" };
+ public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "elrc", "txt" };
///
/// Opens lyric file for the requested item, and processes it for API return.
@@ -38,7 +38,7 @@ public class TxtLyricProvider : ILyricProvider
string[] lyricTextLines = System.IO.File.ReadAllLines(lyricFilePath);
- List lyricList = new List();
+ List lyricList = new();
if (lyricTextLines.Length == 0)
{
From 4b8d41cbe70ee5d9d820a3159b209be17fa44335 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 19 Sep 2022 12:01:02 +0000
Subject: [PATCH 096/262] Bump SQLitePCLRaw.bundle_e_sqlite3 from 2.1.1 to
2.1.2
Bumps [SQLitePCLRaw.bundle_e_sqlite3](https://github.com/ericsink/SQLitePCL.raw) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/ericsink/SQLitePCL.raw/releases)
- [Commits](https://github.com/ericsink/SQLitePCL.raw/compare/v2.1.1...v2.1.2)
---
updated-dependencies:
- dependency-name: SQLitePCLRaw.bundle_e_sqlite3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Server/Jellyfin.Server.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index a0845a0a8a..8ce432b8fa 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -48,7 +48,7 @@
-
+
From 98003143dad108e7e1a9d468e4260f6682140eb8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 19 Sep 2022 12:01:27 +0000
Subject: [PATCH 097/262] Bump Serilog.Settings.Configuration from 3.3.0 to
3.4.0
Bumps [Serilog.Settings.Configuration](https://github.com/serilog/serilog-settings-configuration) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/serilog/serilog-settings-configuration/releases)
- [Changelog](https://github.com/serilog/serilog-settings-configuration/blob/dev/CHANGES.md)
- [Commits](https://github.com/serilog/serilog-settings-configuration/commits/v3.4.0)
---
updated-dependencies:
- dependency-name: Serilog.Settings.Configuration
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
Jellyfin.Server/Jellyfin.Server.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index a0845a0a8a..ab13e314e9 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -43,7 +43,7 @@
-
+
From d7fedf35128a4400dfd4c4e72bbfee3f362d565d Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 19 Sep 2022 16:26:38 -0400
Subject: [PATCH 098/262] Variable declaration cleanup
---
.../Lyric/LrcLyricProvider.cs | 65 +++++++++----------
.../Lyric/TxtLyricProvider.cs | 4 +-
2 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 9d622a1cdf..ea10749b95 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -7,7 +7,6 @@ using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Resolvers;
-using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Lyric;
@@ -54,49 +53,45 @@ public class LrcLyricProvider : ILyricProvider
return null;
}
- List lyricList = new();
- List sortedLyricData = new();
-
IDictionary fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
+ Song lyricData;
+
try
{
// Parse and sort lyric rows
LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
- Song lyricData = lrcLyricParser.Decode(lrcFileContent);
- sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.First().Value).ToList();
-
- // Parse metadata rows
- var metaDataRows = lyricData.Lyrics
- .Where(x => x.TimeTags.Count == 0)
- .Where(x => x.Text.StartsWith('[') && x.Text.EndsWith(']'))
- .Select(x => x.Text)
- .ToList();
-
- foreach (string metaDataRow in metaDataRows)
- {
- int colonCount = metaDataRow.Count(f => (f == ':'));
- if (colonCount == 0)
- {
- continue;
- }
-
- string[] metaDataField;
- string metaDataFieldName;
- string metaDataFieldValue;
- string[] test;
-
- metaDataField = metaDataRow.Split(':', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
- metaDataFieldName = metaDataField[0][1..].Trim();
- metaDataFieldValue = metaDataField[1][..^1].Trim();
-
- fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
- }
+ lyricData = lrcLyricParser.Decode(lrcFileContent);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error parsing lyric data from {Provider}", Name);
+ return null;
+ }
+
+ List sortedLyricData = lyricData.Lyrics.Where(x => x.TimeTags.Count > 0).OrderBy(x => x.TimeTags.First().Value).ToList();
+
+ // Parse metadata rows
+ var metaDataRows = lyricData.Lyrics
+ .Where(x => x.TimeTags.Count == 0)
+ .Where(x => x.Text.StartsWith('[') && x.Text.EndsWith(']'))
+ .Select(x => x.Text)
+ .ToList();
+
+ foreach (string metaDataRow in metaDataRows)
+ {
+ int colonCount = metaDataRow.Count(f => (f == ':'));
+ if (colonCount == 0)
+ {
+ continue;
+ }
+
+ string[] metaDataField = metaDataRow.Split(':', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
+ string metaDataFieldName = metaDataField[0][1..].Trim();
+ string metaDataFieldValue = metaDataField[1][..^1].Trim();
+
+ fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
}
if (sortedLyricData.Count == 0)
@@ -104,6 +99,8 @@ public class LrcLyricProvider : ILyricProvider
return null;
}
+ List lyricList = new();
+
for (int i = 0; i < sortedLyricData.Count; i++)
{
var timeData = sortedLyricData[i].TimeTags.First().Value;
@@ -132,7 +129,7 @@ public class LrcLyricProvider : ILyricProvider
///
/// The metadata from the LRC file.
/// A lyricMetadata object with mapped property data.
- private LyricMetadata MapMetadataValues(IDictionary metaData)
+ private static LyricMetadata MapMetadataValues(IDictionary metaData)
{
LyricMetadata lyricMetadata = new();
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 542df13873..6a189e132e 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -38,13 +38,13 @@ public class TxtLyricProvider : ILyricProvider
string[] lyricTextLines = System.IO.File.ReadAllLines(lyricFilePath);
- List lyricList = new();
-
if (lyricTextLines.Length == 0)
{
return null;
}
+ List lyricList = new(lyricTextLines.Length);
+
foreach (string lyricTextLine in lyricTextLines)
{
lyricList.Add(new LyricLine(lyricTextLine));
From 5d2364f0646ba4f4b6866115ad82fd8fac0733de Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 19 Sep 2022 16:59:16 -0400
Subject: [PATCH 099/262] Move AcceptedTimeFormats to class level variable
---
MediaBrowser.Controller/Lyrics/LyricResponse.cs | 3 ++-
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 8 +++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 64c3b3c28b..56a5696450 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Lyrics;
@@ -15,5 +16,5 @@ public class LyricResponse
///
/// Gets or sets Lyrics.
///
- public IReadOnlyList Lyrics { get; set; } = new List();
+ public IReadOnlyList Lyrics { get; set; } = Array.Empty();
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index ea10749b95..b67b8c5d39 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -39,6 +39,8 @@ public class LrcLyricProvider : ILyricProvider
///
public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "elrc" };
+ private static string[] AcceptedTimeFormats => new[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
+
///
/// Opens lyric file for the requested item, and processes it for API return.
///
@@ -88,8 +90,8 @@ public class LrcLyricProvider : ILyricProvider
}
string[] metaDataField = metaDataRow.Split(':', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
- string metaDataFieldName = metaDataField[0][1..].Trim();
- string metaDataFieldValue = metaDataField[1][..^1].Trim();
+ string metaDataFieldName = metaDataField[0][1..];
+ string metaDataFieldValue = metaDataField[1][..^1];
fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
}
@@ -155,7 +157,7 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.TryGetValue("length", out var length) && !string.IsNullOrEmpty(length))
{
- if (DateTime.TryParseExact(length, new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" }, null, DateTimeStyles.None, out var value))
+ if (DateTime.TryParseExact(length, AcceptedTimeFormats, null, DateTimeStyles.None, out var value))
{
lyricMetadata.Length = value.TimeOfDay.Ticks;
}
From 838334b322e7d8781c1514bcbf33df85e94b797c Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 19 Sep 2022 17:02:42 -0400
Subject: [PATCH 100/262] Add missing summary to AcceptedTimeFormats
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index b67b8c5d39..0422549ff4 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -39,6 +39,10 @@ public class LrcLyricProvider : ILyricProvider
///
public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "elrc" };
+ ///
+ /// Gets the Accepted Time Formats for the metadata numeric values.
+ ///
+ /// The AcceptedTimeFormats.
private static string[] AcceptedTimeFormats => new[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
///
From df85b2fe651ce060cf3b7c4a20c5254c9c80f3aa Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 19 Sep 2022 17:46:29 -0400
Subject: [PATCH 101/262] Update
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
Co-authored-by: Claus Vium
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 0422549ff4..debf982cba 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -39,11 +39,7 @@ public class LrcLyricProvider : ILyricProvider
///
public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "elrc" };
- ///
- /// Gets the Accepted Time Formats for the metadata numeric values.
- ///
- /// The AcceptedTimeFormats.
- private static string[] AcceptedTimeFormats => new[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
+ private static readonly IReadOnlyList _acceptedTimeFormats = new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
///
/// Opens lyric file for the requested item, and processes it for API return.
From 3ba8218e45899c7d3622092ed92dc60b4c28803e Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 19 Sep 2022 17:57:03 -0400
Subject: [PATCH 102/262] Use field instead of property
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index debf982cba..3657cf8943 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -18,6 +18,8 @@ public class LrcLyricProvider : ILyricProvider
{
private readonly ILogger _logger;
+ private static readonly IReadOnlyList _acceptedTimeFormats = new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
+
///
/// Initializes a new instance of the class.
///
@@ -39,8 +41,6 @@ public class LrcLyricProvider : ILyricProvider
///
public IReadOnlyCollection SupportedMediaTypes { get; } = new[] { "lrc", "elrc" };
- private static readonly IReadOnlyList _acceptedTimeFormats = new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
-
///
/// Opens lyric file for the requested item, and processes it for API return.
///
@@ -83,8 +83,7 @@ public class LrcLyricProvider : ILyricProvider
foreach (string metaDataRow in metaDataRows)
{
- int colonCount = metaDataRow.Count(f => (f == ':'));
- if (colonCount == 0)
+ if (!metaDataRow.Contains(':', StringComparison.OrdinalIgnoreCase))
{
continue;
}
@@ -157,7 +156,7 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.TryGetValue("length", out var length) && !string.IsNullOrEmpty(length))
{
- if (DateTime.TryParseExact(length, AcceptedTimeFormats, null, DateTimeStyles.None, out var value))
+ if (DateTime.TryParseExact(length, _acceptedTimeFormats.ToArray(), null, DateTimeStyles.None, out var value))
{
lyricMetadata.Length = value.TimeOfDay.Ticks;
}
From b442c79e620d2bdbb9007038371b75fe41b7cd8a Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 19 Sep 2022 20:24:05 -0400
Subject: [PATCH 103/262] Make LyricParser a field
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 3657cf8943..3177abb963 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -18,6 +18,8 @@ public class LrcLyricProvider : ILyricProvider
{
private readonly ILogger _logger;
+ private readonly LyricParser _lrcLyricParser;
+
private static readonly IReadOnlyList _acceptedTimeFormats = new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
///
@@ -27,6 +29,7 @@ public class LrcLyricProvider : ILyricProvider
public LrcLyricProvider(ILogger logger)
{
_logger = logger;
+ _lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
}
///
@@ -62,13 +65,11 @@ public class LrcLyricProvider : ILyricProvider
try
{
- // Parse and sort lyric rows
- LyricParser lrcLyricParser = new LrcParser.Parser.Lrc.LrcParser();
- lyricData = lrcLyricParser.Decode(lrcFileContent);
+ lyricData = _lrcLyricParser.Decode(lrcFileContent);
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error parsing lyric data from {Provider}", Name);
+ _logger.LogError(ex, "Error parsing lyric file {LyricFilePath} from {Provider}", lyricFilePath, Name);
return null;
}
@@ -92,7 +93,12 @@ public class LrcLyricProvider : ILyricProvider
string metaDataFieldName = metaDataField[0][1..];
string metaDataFieldValue = metaDataField[1][..^1];
- fileMetaData.Add(metaDataFieldName, metaDataFieldValue);
+ if (string.IsNullOrEmpty(metaDataFieldName) || string.IsNullOrEmpty(metaDataFieldValue))
+ {
+ continue;
+ }
+
+ fileMetaData[metaDataFieldName] = metaDataFieldValue;
}
if (sortedLyricData.Count == 0)
From 6f0d33b1caafdf5c8c0413bf3fdcddc822a08f51 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Tue, 20 Sep 2022 08:36:43 -0400
Subject: [PATCH 104/262] Use Directory GetFiles to find lyric files
---
.../ApplicationHost.cs | 1 -
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 20 +++++++++++++++----
.../Lyric/LrcLyricProvider.cs | 12 +++++++----
MediaBrowser.Providers/Lyric/LyricManager.cs | 2 +-
.../Lyric/TxtLyricProvider.cs | 2 +-
5 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 3c3c90e61e..67c63bb599 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -46,7 +46,6 @@ using Emby.Server.Implementations.SyncPlay;
using Emby.Server.Implementations.TV;
using Emby.Server.Implementations.Updates;
using Jellyfin.Api.Helpers;
-using Jellyfin.Api.Models.UserDtos;
using Jellyfin.MediaEncoding.Hls.Playlist;
using Jellyfin.Networking.Configuration;
using Jellyfin.Networking.Manager;
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index 61e205b6cc..a063a4cc55 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -1,4 +1,7 @@
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using Jellyfin.Extensions;
namespace MediaBrowser.Controller.Lyrics;
@@ -13,12 +16,21 @@ public static class LyricInfo
/// The lyricProvider interface to use.
/// Path of requested item.
/// Lyric file path if passed lyric provider's supported media type is found; otherwise, null.
- public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath)
+ public static string? GetLyricFilePath(this ILyricProvider lyricProvider, string itemPath)
{
- foreach (string lyricFileExtension in lyricProvider.SupportedMediaTypes)
+ if (lyricProvider is null)
{
- var lyricFilePath = Path.ChangeExtension(itemPath, lyricFileExtension);
- if (File.Exists(lyricFilePath))
+ return null;
+ }
+
+ if (!Directory.Exists(Path.GetDirectoryName(itemPath)))
+ {
+ return null;
+ }
+
+ foreach (var lyricFilePath in Directory.GetFiles(Path.GetDirectoryName(itemPath), $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
+ {
+ if (lyricProvider.SupportedMediaTypes.Contains(Path.GetExtension(lyricFilePath)[1..]))
{
return lyricFilePath;
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 3177abb963..8ed0552cc2 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -20,7 +20,7 @@ public class LrcLyricProvider : ILyricProvider
private readonly LyricParser _lrcLyricParser;
- private static readonly IReadOnlyList _acceptedTimeFormats = new string[] { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
+ private static readonly string[] _acceptedTimeFormats = { "HH:mm:ss", "H:mm:ss", "mm:ss", "m:ss" };
///
/// Initializes a new instance of the class.
@@ -51,14 +51,14 @@ public class LrcLyricProvider : ILyricProvider
/// If provider can determine lyrics, returns a with or without metadata; otherwise, null.
public LyricResponse? GetLyrics(BaseItem item)
{
- string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
+ string? lyricFilePath = this.GetLyricFilePath(item.Path);
if (string.IsNullOrEmpty(lyricFilePath))
{
return null;
}
- IDictionary fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
+ var fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
Song lyricData;
@@ -90,6 +90,10 @@ public class LrcLyricProvider : ILyricProvider
}
string[] metaDataField = metaDataRow.Split(':', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
+
+ // Remove square bracket before field name, and after field value
+ // Example 1: [au: 1hitsong]
+ // Example 2: [ar: Calabrese]
string metaDataFieldName = metaDataField[0][1..];
string metaDataFieldValue = metaDataField[1][..^1];
@@ -162,7 +166,7 @@ public class LrcLyricProvider : ILyricProvider
if (metaData.TryGetValue("length", out var length) && !string.IsNullOrEmpty(length))
{
- if (DateTime.TryParseExact(length, _acceptedTimeFormats.ToArray(), null, DateTimeStyles.None, out var value))
+ if (DateTime.TryParseExact(length, _acceptedTimeFormats, null, DateTimeStyles.None, out var value))
{
lyricMetadata.Length = value.TimeOfDay.Ticks;
}
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index 7487c68615..336b324a7f 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -46,7 +46,7 @@ public class LyricManager : ILyricManager
continue;
}
- if (LyricInfo.GetLyricFilePath(provider, item.Path) is not null)
+ if (provider.GetLyricFilePath(item.Path) is not null)
{
return true;
}
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 6a189e132e..df6d526301 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -29,7 +29,7 @@ public class TxtLyricProvider : ILyricProvider
/// If provider can determine lyrics, returns a ; otherwise, null.
public LyricResponse? GetLyrics(BaseItem item)
{
- string? lyricFilePath = LyricInfo.GetLyricFilePath(this, item.Path);
+ string? lyricFilePath = this.GetLyricFilePath(item.Path);
if (string.IsNullOrEmpty(lyricFilePath))
{
From 0d5bd85d6d292b0876f60bf0654e243f595ec9f9 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Tue, 20 Sep 2022 08:48:08 -0400
Subject: [PATCH 105/262] Resolve Azure build error
---
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index a063a4cc55..57964eee51 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -18,18 +18,29 @@ public static class LyricInfo
/// Lyric file path if passed lyric provider's supported media type is found; otherwise, null.
public static string? GetLyricFilePath(this ILyricProvider lyricProvider, string itemPath)
{
+ // Ensure we have a provider
if (lyricProvider is null)
{
return null;
}
- if (!Directory.Exists(Path.GetDirectoryName(itemPath)))
+ // Ensure the path to the item is not null
+ string? itemDirectoryPath = Path.GetDirectoryName(itemPath);
+ if (itemDirectoryPath is null)
{
return null;
}
- foreach (var lyricFilePath in Directory.GetFiles(Path.GetDirectoryName(itemPath), $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
+ // Ensure the directory path exists
+ if (!Directory.Exists(itemDirectoryPath))
{
+ return null;
+ }
+
+ foreach (var lyricFilePath in Directory.GetFiles(itemDirectoryPath, $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
+ {
+ if (lyricFilePath is null) { continue; }
+
if (lyricProvider.SupportedMediaTypes.Contains(Path.GetExtension(lyricFilePath)[1..]))
{
return lyricFilePath;
From b1771f07e92dd47f8e49c7f96f61b731d4a6065c Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Tue, 20 Sep 2022 13:34:46 -0400
Subject: [PATCH 106/262] Use Span in SupportedMediaTypes comparison
---
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index 57964eee51..6ebb83d125 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -1,6 +1,5 @@
-using System.Collections.Generic;
+using System;
using System.IO;
-using System.Linq;
using Jellyfin.Extensions;
namespace MediaBrowser.Controller.Lyrics;
@@ -39,9 +38,7 @@ public static class LyricInfo
foreach (var lyricFilePath in Directory.GetFiles(itemDirectoryPath, $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
{
- if (lyricFilePath is null) { continue; }
-
- if (lyricProvider.SupportedMediaTypes.Contains(Path.GetExtension(lyricFilePath)[1..]))
+ if (EnumerableExtensions.Contains(lyricProvider.SupportedMediaTypes, Path.GetExtension(lyricFilePath.AsSpan())[1..], StringComparison.OrdinalIgnoreCase))
{
return lyricFilePath;
}
From 35399ce8fef0559f65bee4f519c582d192a04e52 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Wed, 21 Sep 2022 17:49:28 -0400
Subject: [PATCH 107/262] Update summaries, Use spans
---
MediaBrowser.Controller/Lyrics/LyricLine.cs | 12 ++++++------
.../Lyrics/LyricMetadata.cs | 18 +++++++++---------
.../Lyrics/LyricResponse.cs | 4 ++--
.../Lyric/LrcLyricProvider.cs | 16 ++++++++--------
.../Lyric/TxtLyricProvider.cs | 10 ++++++----
5 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricLine.cs b/MediaBrowser.Controller/Lyrics/LyricLine.cs
index eb5ff9972e..c406f92fcc 100644
--- a/MediaBrowser.Controller/Lyrics/LyricLine.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricLine.cs
@@ -12,17 +12,17 @@ public class LyricLine
/// The lyric start time in ticks.
public LyricLine(string text, long? start = null)
{
- Start = start;
Text = text;
+ Start = start;
}
+ ///
+ /// Gets the text of this lyric line.
+ ///
+ public string Text { get; }
+
///
/// Gets the start time in ticks.
///
public long? Start { get; }
-
- ///
- /// Gets the text.
- ///
- public string Text { get; }
}
diff --git a/MediaBrowser.Controller/Lyrics/LyricMetadata.cs b/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
index 0ba7779750..6091ede52a 100644
--- a/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricMetadata.cs
@@ -8,47 +8,47 @@ namespace MediaBrowser.Controller.Lyrics;
public class LyricMetadata
{
///
- /// Gets or sets Artist - The song artist.
+ /// Gets or sets the song artist.
///
public string? Artist { get; set; }
///
- /// Gets or sets Album - The album this song is on.
+ /// Gets or sets the album this song is on.
///
public string? Album { get; set; }
///
- /// Gets or sets Title - The title of the song.
+ /// Gets or sets the title of the song.
///
public string? Title { get; set; }
///
- /// Gets or sets Author - Creator of the lyric data.
+ /// Gets or sets the author of the lyric data.
///
public string? Author { get; set; }
///
- /// Gets or sets Length - How long the song is.
+ /// Gets or sets the length of the song in ticks.
///
public long? Length { get; set; }
///
- /// Gets or sets By - Creator of the LRC file.
+ /// Gets or sets who the LRC file was created by.
///
public string? By { get; set; }
///
- /// Gets or sets Offset - Offset:+/- Timestamp adjustment in milliseconds.
+ /// Gets or sets the lyric offset compared to audio in ticks.
///
public long? Offset { get; set; }
///
- /// Gets or sets Creator - The Software used to create the LRC file.
+ /// Gets or sets the software used to create the LRC file.
///
public string? Creator { get; set; }
///
- /// Gets or sets Version - The version of the Creator used.
+ /// Gets or sets the version of the creator used.
///
public string? Version { get; set; }
}
diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
index 56a5696450..0d52b5ec50 100644
--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs
@@ -9,12 +9,12 @@ namespace MediaBrowser.Controller.Lyrics;
public class LyricResponse
{
///
- /// Gets or sets Metadata.
+ /// Gets or sets Metadata for the lyrics.
///
public LyricMetadata Metadata { get; set; } = new();
///
- /// Gets or sets Lyrics.
+ /// Gets or sets a collection of individual lyric lines.
///
public IReadOnlyList Lyrics { get; set; } = Array.Empty();
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 8ed0552cc2..1dbe5958e8 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.IO;
using System.Linq;
using LrcParser.Model;
using LrcParser.Parser;
@@ -59,7 +60,7 @@ public class LrcLyricProvider : ILyricProvider
}
var fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
- string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);
+ string lrcFileContent = File.ReadAllText(lyricFilePath);
Song lyricData;
@@ -84,25 +85,24 @@ public class LrcLyricProvider : ILyricProvider
foreach (string metaDataRow in metaDataRows)
{
- if (!metaDataRow.Contains(':', StringComparison.OrdinalIgnoreCase))
+ var index = metaDataRow.IndexOf(':', StringComparison.OrdinalIgnoreCase);
+ if (index == -1)
{
continue;
}
- string[] metaDataField = metaDataRow.Split(':', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
-
// Remove square bracket before field name, and after field value
// Example 1: [au: 1hitsong]
// Example 2: [ar: Calabrese]
- string metaDataFieldName = metaDataField[0][1..];
- string metaDataFieldValue = metaDataField[1][..^1];
+ var metaDataFieldNameSpan = metaDataRow.AsSpan(1, index - 1).Trim();
+ var metaDataFieldValueSpan = metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim();
- if (string.IsNullOrEmpty(metaDataFieldName) || string.IsNullOrEmpty(metaDataFieldValue))
+ if (metaDataFieldValueSpan.IsEmpty || metaDataFieldValueSpan.IsEmpty)
{
continue;
}
- fileMetaData[metaDataFieldName] = metaDataFieldValue;
+ fileMetaData[metaDataFieldNameSpan.ToString()] = metaDataFieldValueSpan.ToString();
}
if (sortedLyricData.Count == 0)
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index df6d526301..bce8810545 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -1,4 +1,6 @@
using System.Collections.Generic;
+using System.IO;
+using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Resolvers;
@@ -36,18 +38,18 @@ public class TxtLyricProvider : ILyricProvider
return null;
}
- string[] lyricTextLines = System.IO.File.ReadAllLines(lyricFilePath);
+ string[] lyricTextLines = File.ReadAllLines(lyricFilePath);
if (lyricTextLines.Length == 0)
{
return null;
}
- List lyricList = new(lyricTextLines.Length);
+ LyricLine[] lyricList = new LyricLine[lyricTextLines.Length];
- foreach (string lyricTextLine in lyricTextLines)
+ for (int lyricLine = 0; lyricLine < lyricTextLines.Length; lyricLine++)
{
- lyricList.Add(new LyricLine(lyricTextLine));
+ lyricList[lyricLine] = new LyricLine(lyricTextLines[lyricLine]);
}
return new LyricResponse { Lyrics = lyricList };
From d3b016aae6edc6dbc18d3dbecbaa488eb7058c23 Mon Sep 17 00:00:00 2001
From: SaddFox
Date: Wed, 21 Sep 2022 08:46:01 +0000
Subject: [PATCH 108/262] Translated using Weblate (Slovenian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sl/
---
Emby.Server.Implementations/Localization/Core/sl-SI.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/sl-SI.json b/Emby.Server.Implementations/Localization/Core/sl-SI.json
index b2d7ce11df..d845accac2 100644
--- a/Emby.Server.Implementations/Localization/Core/sl-SI.json
+++ b/Emby.Server.Implementations/Localization/Core/sl-SI.json
@@ -90,7 +90,7 @@
"UserStartedPlayingItemWithValues": "{0} predvaja {1} na {2}",
"UserStoppedPlayingItemWithValues": "{0} je nehal predvajati {1} na {2}",
"ValueHasBeenAddedToLibrary": "{0} je bil dodan vaši knjižnici",
- "ValueSpecialEpisodeName": "Bonus - {0}",
+ "ValueSpecialEpisodeName": "Posebna epizoda - {0}",
"VersionNumber": "Različica {0}",
"TaskDownloadMissingSubtitles": "Prenesi manjkajoče podnapise",
"TaskRefreshChannelsDescription": "Osveži podatke spletnih kanalov.",
From a50bdb47709be0412b3abb2729f8c657b5d0c779 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Thu, 22 Sep 2022 08:13:53 -0400
Subject: [PATCH 109/262] Use async functions
---
.../Controllers/UserLibraryController.cs | 4 ++--
.../Lyrics/ILyricManager.cs | 5 ++--
.../Lyrics/ILyricProvider.cs | 5 ++--
.../Lyric/LrcLyricProvider.cs | 23 ++++++++++++++-----
MediaBrowser.Providers/Lyric/LyricManager.cs | 5 ++--
.../Lyric/TxtLyricProvider.cs | 5 ++--
6 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index df91a8efc7..682a6e832d 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -397,7 +397,7 @@ namespace Jellyfin.Api.Controllers
/// An containing the item's lyrics.
[HttpGet("Users/{userId}/Items/{itemId}/Lyrics")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public ActionResult GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
+ public async Task> GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
{
var user = _userManager.GetUserById(userId);
@@ -415,7 +415,7 @@ namespace Jellyfin.Api.Controllers
return NotFound();
}
- var result = _lyricManager.GetLyrics(item);
+ var result = await _lyricManager.GetLyrics(item).ConfigureAwait(false);
if (result is not null)
{
return Ok(result);
diff --git a/MediaBrowser.Controller/Lyrics/ILyricManager.cs b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
index 5920bcc628..bb93e1e4c6 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricManager.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricManager.cs
@@ -1,3 +1,4 @@
+using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Lyrics;
@@ -11,8 +12,8 @@ public interface ILyricManager
/// Gets the lyrics.
///
/// The media item.
- /// Lyrics for passed item.
- LyricResponse? GetLyrics(BaseItem item);
+ /// A task representing found lyrics the passed item.
+ Task GetLyrics(BaseItem item);
///
/// Checks if requested item has a matching local lyric file.
diff --git a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
index c5b6252267..2a04c61520 100644
--- a/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
+++ b/MediaBrowser.Controller/Lyrics/ILyricProvider.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Resolvers;
@@ -30,6 +31,6 @@ public interface ILyricProvider
/// Gets the lyrics.
///
/// The media item.
- /// If found, returns lyrics for passed item; otherwise, null.
- LyricResponse? GetLyrics(BaseItem item);
+ /// A task representing found lyrics.
+ Task GetLyrics(BaseItem item);
}
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 1dbe5958e8..d06db3afc6 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Threading.Tasks;
using LrcParser.Model;
using LrcParser.Parser;
using MediaBrowser.Controller.Entities;
@@ -50,7 +51,7 @@ public class LrcLyricProvider : ILyricProvider
///
/// The item to to process.
/// If provider can determine lyrics, returns a with or without metadata; otherwise, null.
- public LyricResponse? GetLyrics(BaseItem item)
+ public async Task GetLyrics(BaseItem item)
{
string? lyricFilePath = this.GetLyricFilePath(item.Path);
@@ -60,7 +61,7 @@ public class LrcLyricProvider : ILyricProvider
}
var fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
- string lrcFileContent = File.ReadAllText(lyricFilePath);
+ string lrcFileContent = await Task.FromResult(File.ReadAllText(lyricFilePath)).ConfigureAwait(false);
Song lyricData;
@@ -94,15 +95,15 @@ public class LrcLyricProvider : ILyricProvider
// Remove square bracket before field name, and after field value
// Example 1: [au: 1hitsong]
// Example 2: [ar: Calabrese]
- var metaDataFieldNameSpan = metaDataRow.AsSpan(1, index - 1).Trim();
- var metaDataFieldValueSpan = metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim();
+ var metaDataFieldName = GetMetadataFieldName(metaDataRow, index);
+ var metaDataFieldValue = GetMetadataValue(metaDataRow, index);
- if (metaDataFieldValueSpan.IsEmpty || metaDataFieldValueSpan.IsEmpty)
+ if (string.IsNullOrEmpty(metaDataFieldName) || string.IsNullOrEmpty(metaDataFieldValue))
{
continue;
}
- fileMetaData[metaDataFieldNameSpan.ToString()] = metaDataFieldValueSpan.ToString();
+ fileMetaData[metaDataFieldName.ToString()] = metaDataFieldValue.ToString();
}
if (sortedLyricData.Count == 0)
@@ -197,4 +198,14 @@ public class LrcLyricProvider : ILyricProvider
return lyricMetadata;
}
+
+ private static string GetMetadataFieldName(string metaDataRow, int index)
+ {
+ return metaDataRow.AsSpan(1, index - 1).Trim().ToString();
+ }
+
+ private static string GetMetadataValue(string metaDataRow, int index)
+ {
+ return metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim().ToString();
+ }
}
diff --git a/MediaBrowser.Providers/Lyric/LyricManager.cs b/MediaBrowser.Providers/Lyric/LyricManager.cs
index 336b324a7f..f9547e0f05 100644
--- a/MediaBrowser.Providers/Lyric/LyricManager.cs
+++ b/MediaBrowser.Providers/Lyric/LyricManager.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
@@ -22,11 +23,11 @@ public class LyricManager : ILyricManager
}
///
- public LyricResponse? GetLyrics(BaseItem item)
+ public async Task GetLyrics(BaseItem item)
{
foreach (ILyricProvider provider in _lyricProviders)
{
- var results = provider.GetLyrics(item);
+ var results = await provider.GetLyrics(item).ConfigureAwait(false);
if (results is not null)
{
return results;
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index bce8810545..9df4ec83e7 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Lyrics;
using MediaBrowser.Controller.Resolvers;
@@ -29,7 +30,7 @@ public class TxtLyricProvider : ILyricProvider
///
/// The item to to process.
/// If provider can determine lyrics, returns a ; otherwise, null.
- public LyricResponse? GetLyrics(BaseItem item)
+ public async Task GetLyrics(BaseItem item)
{
string? lyricFilePath = this.GetLyricFilePath(item.Path);
@@ -38,7 +39,7 @@ public class TxtLyricProvider : ILyricProvider
return null;
}
- string[] lyricTextLines = File.ReadAllLines(lyricFilePath);
+ string[] lyricTextLines = await Task.FromResult(File.ReadAllLines(lyricFilePath)).ConfigureAwait(false);
if (lyricTextLines.Length == 0)
{
From 97409adb45e84916fbd0b4b140ab794ac4279d56 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Thu, 22 Sep 2022 09:00:07 -0400
Subject: [PATCH 110/262] Adjust file read async functions
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 2 +-
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index d06db3afc6..05d8f26744 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -61,7 +61,7 @@ public class LrcLyricProvider : ILyricProvider
}
var fileMetaData = new Dictionary(StringComparer.OrdinalIgnoreCase);
- string lrcFileContent = await Task.FromResult(File.ReadAllText(lyricFilePath)).ConfigureAwait(false);
+ string lrcFileContent = await File.ReadAllTextAsync(lyricFilePath).ConfigureAwait(false);
Song lyricData;
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 9df4ec83e7..9d4f2f00ed 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -39,7 +39,7 @@ public class TxtLyricProvider : ILyricProvider
return null;
}
- string[] lyricTextLines = await Task.FromResult(File.ReadAllLines(lyricFilePath)).ConfigureAwait(false);
+ string[] lyricTextLines = await File.ReadAllLinesAsync(lyricFilePath).ConfigureAwait(false);
if (lyricTextLines.Length == 0)
{
From 563d5fb5d9c349555227a9e3e7d265a55d589c31 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Thu, 22 Sep 2022 17:38:46 -0400
Subject: [PATCH 111/262] Return string.Empty is span IsEmpty
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 6 ++++--
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 05d8f26744..5844db0788 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -201,11 +201,13 @@ public class LrcLyricProvider : ILyricProvider
private static string GetMetadataFieldName(string metaDataRow, int index)
{
- return metaDataRow.AsSpan(1, index - 1).Trim().ToString();
+ var metadataFieldName = metaDataRow.AsSpan(1, index - 1).Trim();
+ return metadataFieldName.IsEmpty ? string.Empty : metadataFieldName.ToString();
}
private static string GetMetadataValue(string metaDataRow, int index)
{
- return metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim().ToString();
+ var metadataValue = metaDataRow.AsSpan(index + 1, metaDataRow.Length - index - 2).Trim();
+ return metadataValue.IsEmpty ? string.Empty : metadataValue.ToString();
}
}
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 9d4f2f00ed..85f792d098 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -48,9 +48,9 @@ public class TxtLyricProvider : ILyricProvider
LyricLine[] lyricList = new LyricLine[lyricTextLines.Length];
- for (int lyricLine = 0; lyricLine < lyricTextLines.Length; lyricLine++)
+ for (int lyricLineIndex = 0; lyricLineIndex < lyricTextLines.Length; lyricLineIndex++)
{
- lyricList[lyricLine] = new LyricLine(lyricTextLines[lyricLine]);
+ lyricList[lyricLineIndex] = new LyricLine(lyricTextLines[lyricLineIndex]);
}
return new LyricResponse { Lyrics = lyricList };
From 1ae5c83aa7a7c84ab487e8abc1da6f8aabcdd39c Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Fri, 23 Sep 2022 07:59:46 -0400
Subject: [PATCH 112/262] Update
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
Co-authored-by: Claus Vium
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 5844db0788..4d4e35a4e1 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -103,7 +103,7 @@ public class LrcLyricProvider : ILyricProvider
continue;
}
- fileMetaData[metaDataFieldName.ToString()] = metaDataFieldValue.ToString();
+ fileMetaData[metaDataFieldName] = metaDataFieldValue;
}
if (sortedLyricData.Count == 0)
From e579b4d42d4fa934488c29f4feb442d68a677721 Mon Sep 17 00:00:00 2001
From: Luke F <283772+lukefor@users.noreply.github.com>
Date: Fri, 23 Sep 2022 23:09:34 -0400
Subject: [PATCH 113/262] Backport pull request #8189 from
jellyfin/release-10.8.z
Fix GetItems IndexOutOfRangeException when IDs do not exist
Original-merge: 527ed0607d5f31a232293b39daac19018518b1a0
Merged-by: Claus Vium
Backported-by: Joshua M. Boniface
---
MediaBrowser.Controller/Entities/Folder.cs | 24 +---------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 1860da4c79..92d12a86ca 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -892,29 +892,7 @@ namespace MediaBrowser.Controller.Entities
private static BaseItem[] SortItemsByRequest(InternalItemsQuery query, IReadOnlyList items)
{
- var ids = query.ItemIds;
- int size = items.Count;
-
- // ids can potentially contain non-unique guids, but query result cannot,
- // so we include only first occurrence of each guid
- var positions = new Dictionary(size);
- int index = 0;
- for (int i = 0; i < ids.Length; i++)
- {
- if (positions.TryAdd(ids[i], index))
- {
- index++;
- }
- }
-
- var newItems = new BaseItem[size];
- for (int i = 0; i < size; i++)
- {
- var item = items[i];
- newItems[positions[item.Id]] = item;
- }
-
- return newItems;
+ return items.OrderBy(i => Array.IndexOf(query.ItemIds, i.Id)).ToArray();
}
public QueryResult GetItems(InternalItemsQuery query)
From 0309c5622e31df7593a07880e2669bd623b71f88 Mon Sep 17 00:00:00 2001
From: nyanmisaka
Date: Fri, 23 Sep 2022 23:09:35 -0400
Subject: [PATCH 114/262] Backport pull request #8213 from
jellyfin/release-10.8.z
Fix high single thread usage in throttler
Original-merge: ba026716c1609941ec50a26e50ef5e68cc84d0c0
Merged-by: Claus Vium
Backported-by: Joshua M. Boniface
---
Jellyfin.Api/Helpers/TranscodingJobHelper.cs | 2 +-
.../PlaybackDtos/TranscodingThrottler.cs | 15 +++++--
.../MediaEncoding/IMediaEncoder.cs | 6 +++
.../Encoder/EncoderValidator.cs | 43 +++++++++++++++----
.../Encoder/MediaEncoder.cs | 6 +++
5 files changed, 59 insertions(+), 13 deletions(-)
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
index 13dc878c1b..2adb006e48 100644
--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
@@ -654,7 +654,7 @@ namespace Jellyfin.Api.Helpers
{
if (EnableThrottling(state))
{
- transcodingJob.TranscodingThrottler = new TranscodingThrottler(transcodingJob, new Logger(new LoggerFactory()), _serverConfigurationManager, _fileSystem);
+ transcodingJob.TranscodingThrottler = new TranscodingThrottler(transcodingJob, new Logger(new LoggerFactory()), _serverConfigurationManager, _fileSystem, _mediaEncoder);
transcodingJob.TranscodingThrottler.Start();
}
}
diff --git a/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs b/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs
index 7a1ca252cf..99376873c0 100644
--- a/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs
+++ b/Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs
@@ -2,6 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Configuration;
+using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
@@ -17,6 +18,7 @@ namespace Jellyfin.Api.Models.PlaybackDtos
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IFileSystem _fileSystem;
+ private readonly IMediaEncoder _mediaEncoder;
private Timer? _timer;
private bool _isPaused;
@@ -27,12 +29,14 @@ namespace Jellyfin.Api.Models.PlaybackDtos
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- public TranscodingThrottler(TranscodingJobDto job, ILogger logger, IConfigurationManager config, IFileSystem fileSystem)
+ /// Instance of the interface.
+ public TranscodingThrottler(TranscodingJobDto job, ILogger logger, IConfigurationManager config, IFileSystem fileSystem, IMediaEncoder mediaEncoder)
{
_job = job;
_logger = logger;
_config = config;
_fileSystem = fileSystem;
+ _mediaEncoder = mediaEncoder;
}
///
@@ -55,7 +59,8 @@ namespace Jellyfin.Api.Models.PlaybackDtos
try
{
- await _job.Process!.StandardInput.WriteLineAsync().ConfigureAwait(false);
+ var resumeKey = _mediaEncoder.IsPkeyPauseSupported ? "u" : Environment.NewLine;
+ await _job.Process!.StandardInput.WriteAsync(resumeKey).ConfigureAwait(false);
_isPaused = false;
}
catch (Exception ex)
@@ -125,11 +130,13 @@ namespace Jellyfin.Api.Models.PlaybackDtos
{
if (!_isPaused)
{
- _logger.LogDebug("Sending pause command to ffmpeg");
+ var pauseKey = _mediaEncoder.IsPkeyPauseSupported ? "p" : "c";
+
+ _logger.LogDebug("Sending pause command [{Key}] to ffmpeg", pauseKey);
try
{
- await _job.Process!.StandardInput.WriteAsync("c").ConfigureAwait(false);
+ await _job.Process!.StandardInput.WriteAsync(pauseKey).ConfigureAwait(false);
_isPaused = true;
}
catch (Exception ex)
diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
index dae30cd8b3..69d0bf45cc 100644
--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
@@ -37,6 +37,12 @@ namespace MediaBrowser.Controller.MediaEncoding
/// The version of encoder.
Version EncoderVersion { get; }
+ ///
+ /// Whether p key pausing is supported.
+ ///
+ /// true if p key pausing is supported, false otherwise.
+ bool IsPkeyPauseSupported { get; }
+
///
/// Gets a value indicating whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver).
///
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
index d378c6e134..9b4b1db947 100644
--- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
@@ -153,7 +153,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string output;
try
{
- output = GetProcessOutput(_encoderPath, "-version", false);
+ output = GetProcessOutput(_encoderPath, "-version", false, null);
}
catch (Exception ex)
{
@@ -234,7 +234,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string output;
try
{
- output = GetProcessOutput(_encoderPath, "-version", false);
+ output = GetProcessOutput(_encoderPath, "-version", false, null);
}
catch (Exception ex)
{
@@ -341,7 +341,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
try
{
- var output = GetProcessOutput(_encoderPath, "-v verbose -hide_banner -init_hw_device vaapi=va:" + renderNodePath, true);
+ var output = GetProcessOutput(_encoderPath, "-v verbose -hide_banner -init_hw_device vaapi=va:" + renderNodePath, true, null);
return output.Contains(driverName, StringComparison.Ordinal);
}
catch (Exception ex)
@@ -356,7 +356,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string? output = null;
try
{
- output = GetProcessOutput(_encoderPath, "-hwaccels", false);
+ output = GetProcessOutput(_encoderPath, "-hwaccels", false, null);
}
catch (Exception ex)
{
@@ -384,7 +384,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string output;
try
{
- output = GetProcessOutput(_encoderPath, "-h filter=" + filter, false);
+ output = GetProcessOutput(_encoderPath, "-h filter=" + filter, false, null);
}
catch (Exception ex)
{
@@ -402,13 +402,34 @@ namespace MediaBrowser.MediaEncoding.Encoder
return false;
}
+ public bool CheckSupportedRuntimeKey(string keyDesc)
+ {
+ if (string.IsNullOrEmpty(keyDesc))
+ {
+ return false;
+ }
+
+ string output;
+ try
+ {
+ output = GetProcessOutput(_encoderPath, "-hide_banner -f lavfi -i nullsrc=s=1x1:d=500 -f null -", true, "?");
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error checking supported runtime key");
+ return false;
+ }
+
+ return output.Contains(keyDesc, StringComparison.Ordinal);
+ }
+
private IEnumerable GetCodecs(Codec codec)
{
string codecstr = codec == Codec.Encoder ? "encoders" : "decoders";
string output;
try
{
- output = GetProcessOutput(_encoderPath, "-" + codecstr, false);
+ output = GetProcessOutput(_encoderPath, "-" + codecstr, false, null);
}
catch (Exception ex)
{
@@ -439,7 +460,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string output;
try
{
- output = GetProcessOutput(_encoderPath, "-filters", false);
+ output = GetProcessOutput(_encoderPath, "-filters", false, null);
}
catch (Exception ex)
{
@@ -477,7 +498,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
return dict;
}
- private string GetProcessOutput(string path, string arguments, bool readStdErr)
+ private string GetProcessOutput(string path, string arguments, bool readStdErr, string? testKey)
{
using (var process = new Process()
{
@@ -487,6 +508,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
UseShellExecute = false,
WindowStyle = ProcessWindowStyle.Hidden,
ErrorDialog = false,
+ RedirectStandardInput = !string.IsNullOrEmpty(testKey),
RedirectStandardOutput = true,
RedirectStandardError = true
}
@@ -496,6 +518,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
process.Start();
+ if (!string.IsNullOrEmpty(testKey))
+ {
+ process.StandardInput.Write(testKey);
+ }
+
return readStdErr ? process.StandardError.ReadToEnd() : process.StandardOutput.ReadToEnd();
}
}
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 7f301a9d8b..4e9f33bd92 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -67,6 +67,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
private List _filters = new List();
private IDictionary _filtersWithOption = new Dictionary();
+ private bool _isPkeyPauseSupported = false;
+
private bool _isVaapiDeviceAmd = false;
private bool _isVaapiDeviceInteliHD = false;
private bool _isVaapiDeviceInteli965 = false;
@@ -100,6 +102,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
public Version EncoderVersion => _ffmpegVersion;
+ public bool IsPkeyPauseSupported => _isPkeyPauseSupported;
+
public bool IsVaapiDeviceAmd => _isVaapiDeviceAmd;
public bool IsVaapiDeviceInteliHD => _isVaapiDeviceInteliHD;
@@ -154,6 +158,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
_threads = EncodingHelper.GetNumberOfThreads(null, options, null);
+ _isPkeyPauseSupported = validator.CheckSupportedRuntimeKey("p pause transcoding");
+
// Check the Vaapi device vendor
if (OperatingSystem.IsLinux()
&& SupportsHwaccel("vaapi")
From 1e72ba4c09eddf92c5a30f225505825b93336b6f Mon Sep 17 00:00:00 2001
From: Niels van Velzen
Date: Fri, 23 Sep 2022 23:09:35 -0400
Subject: [PATCH 115/262] Backport pull request #8214 from
jellyfin/release-10.8.z
Make userId truly optional in UniversalAudioController
Original-merge: af877063795469ac3d94d356b2787e296606f571
Merged-by: Bond-009
Backported-by: Joshua M. Boniface
---
Jellyfin.Api/Controllers/UniversalAudioController.cs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Jellyfin.Api/Controllers/UniversalAudioController.cs b/Jellyfin.Api/Controllers/UniversalAudioController.cs
index 43b8e2414d..c463fb08aa 100644
--- a/Jellyfin.Api/Controllers/UniversalAudioController.cs
+++ b/Jellyfin.Api/Controllers/UniversalAudioController.cs
@@ -111,7 +111,13 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableRedirection = true)
{
var deviceProfile = GetDeviceProfile(container, transcodingContainer, audioCodec, transcodingProtocol, breakOnNonKeyFrames, transcodingAudioChannels, maxAudioSampleRate, maxAudioBitDepth, maxAudioChannels);
- (await _authorizationContext.GetAuthorizationInfo(Request).ConfigureAwait(false)).DeviceId = deviceId;
+ var authorizationInfo = await _authorizationContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
+ authorizationInfo.DeviceId = deviceId;
+
+ if (!userId.HasValue || userId.Value.Equals(Guid.Empty))
+ {
+ userId = authorizationInfo.UserId;
+ }
var authInfo = await _authorizationContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
From e8c12e5078448b3ca8cd6a043cd529b70053b0c5 Mon Sep 17 00:00:00 2001
From: Bill Thornton
Date: Fri, 23 Sep 2022 23:09:36 -0400
Subject: [PATCH 116/262] Backport pull request #8280 from
jellyfin/release-10.8.z
Fix ffmpeg analyze duration env var taking priority over media source
Original-merge: 632fb05f467a935da5765fccd1595dfd501247d0
Merged-by: Claus Vium
Backported-by: Joshua M. Boniface
---
.../MediaEncoding/EncodingHelper.cs | 10 +++++-----
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 1d10777168..42c5517f9d 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -4991,14 +4991,14 @@ namespace MediaBrowser.Controller.MediaEncoding
// The default value of -probesize is more than enough, so leave it as is.
var ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
- if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
- {
- analyzeDurationArgument = "-analyzeduration " + ffmpegAnalyzeDuration;
- }
- else if (state.MediaSource.AnalyzeDurationMs.HasValue)
+ if (state.MediaSource.AnalyzeDurationMs > 0)
{
analyzeDurationArgument = "-analyzeduration " + (state.MediaSource.AnalyzeDurationMs.Value * 1000).ToString(CultureInfo.InvariantCulture);
}
+ else if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
+ {
+ analyzeDurationArgument = "-analyzeduration " + ffmpegAnalyzeDuration;
+ }
if (!string.IsNullOrEmpty(analyzeDurationArgument))
{
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 4e9f33bd92..757a01715a 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -382,15 +382,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
string analyzeDuration = string.Empty;
string ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
- if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
- {
- analyzeDuration = "-analyzeduration " + ffmpegAnalyzeDuration;
- }
- else if (request.MediaSource.AnalyzeDurationMs > 0)
+ if (request.MediaSource.AnalyzeDurationMs > 0)
{
analyzeDuration = "-analyzeduration " +
(request.MediaSource.AnalyzeDurationMs * 1000).ToString();
}
+ else if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
+ {
+ analyzeDuration = "-analyzeduration " + ffmpegAnalyzeDuration;
+ }
var forceEnableLogging = request.MediaSource.Protocol != MediaProtocol.File;
From c9f3c7b11a9ef60ac11f931595c198f9fc53e5f2 Mon Sep 17 00:00:00 2001
From: AJ Jordan
Date: Fri, 23 Sep 2022 23:09:37 -0400
Subject: [PATCH 117/262] Backport pull request #8321 from
jellyfin/release-10.8.z
Fix systemd not breaking whitespace in env vars
Original-merge: 125ee883117af3ad5c7e2369f8be84089a782b57
Merged-by: Joshua M. Boniface
Backported-by: Joshua M. Boniface
---
debian/jellyfin.service | 2 +-
fedora/jellyfin.service | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/debian/jellyfin.service b/debian/jellyfin.service
index 2f97c46549..1150924a08 100644
--- a/debian/jellyfin.service
+++ b/debian/jellyfin.service
@@ -8,7 +8,7 @@ EnvironmentFile = /etc/default/jellyfin
User = jellyfin
Group = jellyfin
WorkingDirectory = /var/lib/jellyfin
-ExecStart = /usr/bin/jellyfin ${JELLYFIN_WEB_OPT} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} ${JELLYFIN_ADDITIONAL_OPTS}
+ExecStart = /usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS
Restart = on-failure
TimeoutSec = 15
SuccessExitStatus=0 143
diff --git a/fedora/jellyfin.service b/fedora/jellyfin.service
index eb0d640871..2fb9f30e00 100644
--- a/fedora/jellyfin.service
+++ b/fedora/jellyfin.service
@@ -8,7 +8,7 @@ EnvironmentFile = /etc/sysconfig/jellyfin
User = jellyfin
Group = jellyfin
WorkingDirectory = /var/lib/jellyfin
-ExecStart = /usr/bin/jellyfin ${JELLYFIN_WEB_OPT} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} ${JELLYFIN_ADDITIONAL_OPTS}
+ExecStart = /usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS
Restart = on-failure
TimeoutSec = 15
SuccessExitStatus=0 143
From 4a261a3ec05bcd114885a66def4a6212411491d8 Mon Sep 17 00:00:00 2001
From: Claus Vium
Date: Fri, 23 Sep 2022 23:09:37 -0400
Subject: [PATCH 118/262] Backport pull request #8348 from
jellyfin/release-10.8.z
Revert "Revert "refactor: use season number and episode number for NextUp ordering instead of SortName""
Original-merge: 88d5230babbc9498a6142ef56b1c0a9731936a40
Merged-by: Bond-009
Backported-by: Joshua M. Boniface
---
.../TV/TVSeriesManager.cs | 43 +++++++------------
1 file changed, 16 insertions(+), 27 deletions(-)
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs
index d7ab9c021e..6005896ad9 100644
--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs
+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs
@@ -135,20 +135,15 @@ namespace Emby.Server.Implementations.TV
return GetResult(episodes, request);
}
- public IEnumerable GetNextUpEpisodes(NextUpQuery request, User user, IReadOnlyList seriesKeys, DtoOptions dtoOptions)
+ private IEnumerable GetNextUpEpisodes(NextUpQuery request, User user, IReadOnlyList seriesKeys, DtoOptions dtoOptions)
{
- // Avoid implicitly captured closure
- var currentUser = user;
-
- var allNextUp = seriesKeys
- .Select(i => GetNextUp(i, currentUser, dtoOptions, false));
+ var allNextUp = seriesKeys.Select(i => GetNextUp(i, user, dtoOptions, false));
if (request.EnableRewatching)
{
allNextUp = allNextUp.Concat(
- seriesKeys.Select(i => GetNextUp(i, currentUser, dtoOptions, true))
- )
- .OrderByDescending(i => i.Item1);
+ seriesKeys.Select(i => GetNextUp(i, user, dtoOptions, true)))
+ .OrderByDescending(i => i.LastWatchedDate);
}
// If viewing all next up for all series, remove first episodes
@@ -161,23 +156,18 @@ namespace Emby.Server.Implementations.TV
{
if (request.DisableFirstEpisode)
{
- return i.Item1 != DateTime.MinValue;
+ return i.LastWatchedDate != DateTime.MinValue;
}
- if (alwaysEnableFirstEpisode || (i.Item1 != DateTime.MinValue && i.Item1.Date >= request.NextUpDateCutoff))
+ if (alwaysEnableFirstEpisode || (i.LastWatchedDate != DateTime.MinValue && i.LastWatchedDate.Date >= request.NextUpDateCutoff))
{
anyFound = true;
return true;
}
- if (!anyFound && i.Item1 == DateTime.MinValue)
- {
- return true;
- }
-
- return false;
+ return !anyFound && i.LastWatchedDate == DateTime.MinValue;
})
- .Select(i => i.Item2())
+ .Select(i => i.GetEpisodeFunction())
.Where(i => i != null);
}
@@ -195,14 +185,14 @@ namespace Emby.Server.Implementations.TV
/// Gets the next up.
///
/// Task{Episode}.
- private Tuple> GetNextUp(string seriesKey, User user, DtoOptions dtoOptions, bool rewatching)
+ private (DateTime LastWatchedDate, Func GetEpisodeFunction) GetNextUp(string seriesKey, User user, DtoOptions dtoOptions, bool rewatching)
{
var lastQuery = new InternalItemsQuery(user)
{
AncestorWithPresentationUniqueKey = null,
SeriesPresentationUniqueKey = seriesKey,
IncludeItemTypes = new[] { BaseItemKind.Episode },
- OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Descending) },
+ OrderBy = new[] { (ItemSortBy.ParentIndexNumber, SortOrder.Descending), (ItemSortBy.IndexNumber, SortOrder.Descending) },
IsPlayed = true,
Limit = 1,
ParentIndexNumberNotEquals = 0,
@@ -216,24 +206,23 @@ namespace Emby.Server.Implementations.TV
if (rewatching)
{
// find last watched by date played, not by newest episode watched
- lastQuery.OrderBy = new[] { (ItemSortBy.DatePlayed, SortOrder.Descending) };
+ lastQuery.OrderBy = new[] { (ItemSortBy.DatePlayed, SortOrder.Descending), (ItemSortBy.ParentIndexNumber, SortOrder.Descending), (ItemSortBy.IndexNumber, SortOrder.Descending) };
}
var lastWatchedEpisode = _libraryManager.GetItemList(lastQuery).Cast().FirstOrDefault();
- Func getEpisode = () =>
+ Episode GetEpisode()
{
var nextQuery = new InternalItemsQuery(user)
{
AncestorWithPresentationUniqueKey = null,
SeriesPresentationUniqueKey = seriesKey,
IncludeItemTypes = new[] { BaseItemKind.Episode },
- OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
+ OrderBy = new[] { (ItemSortBy.ParentIndexNumber, SortOrder.Ascending), (ItemSortBy.IndexNumber, SortOrder.Ascending) },
Limit = 1,
IsPlayed = rewatching,
IsVirtualItem = false,
ParentIndexNumberNotEquals = 0,
- MinSortName = lastWatchedEpisode?.SortName,
DtoOptions = dtoOptions
};
@@ -297,7 +286,7 @@ namespace Emby.Server.Implementations.TV
}
return nextEpisode;
- };
+ }
if (lastWatchedEpisode != null)
{
@@ -305,11 +294,11 @@ namespace Emby.Server.Implementations.TV
var lastWatchedDate = userData.LastPlayedDate ?? DateTime.MinValue.AddDays(1);
- return new Tuple>(lastWatchedDate, getEpisode);
+ return (lastWatchedDate, GetEpisode);
}
// Return the first episode
- return new Tuple>(DateTime.MinValue, getEpisode);
+ return (DateTime.MinValue, GetEpisode);
}
private static QueryResult GetResult(IEnumerable items, NextUpQuery query)
From e8893f3d416c7eab96fef2fb8330fc20d29efafc Mon Sep 17 00:00:00 2001
From: LogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com>
Date: Fri, 23 Sep 2022 23:09:38 -0400
Subject: [PATCH 119/262] Backport pull request #8399 from
jellyfin/release-10.8.z
Respect visibility for people items (rebased)
Original-merge: e6124bc154c9f95fdd491f309623def6b3df0171
Merged-by: Bond-009
Backported-by: Joshua M. Boniface
---
Emby.Server.Implementations/Dto/DtoService.cs | 8 ++++++--
Emby.Server.Implementations/Library/LibraryManager.cs | 10 ++++++++--
Jellyfin.Api/Controllers/PersonsController.cs | 5 ++++-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index 09ba368514..3d2b8f7f63 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -182,7 +182,7 @@ namespace Emby.Server.Implementations.Dto
if (options.ContainsField(ItemFields.People))
{
- AttachPeople(dto, item);
+ AttachPeople(dto, item, user);
}
if (options.ContainsField(ItemFields.PrimaryImageAspectRatio))
@@ -503,7 +503,8 @@ namespace Emby.Server.Implementations.Dto
///
/// The dto.
/// The item.
- private void AttachPeople(BaseItemDto dto, BaseItem item)
+ /// The requesting user.
+ private void AttachPeople(BaseItemDto dto, BaseItem item, User user = null)
{
// Ordering by person type to ensure actors and artists are at the front.
// This is taking advantage of the fact that they both begin with A
@@ -560,6 +561,9 @@ namespace Emby.Server.Implementations.Dto
return null;
}
}).Where(i => i != null)
+ .Where(i => user == null ?
+ true :
+ i.IsVisible(user))
.GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.Select(x => x.First())
.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 6796845525..250e7619fb 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -2766,7 +2766,8 @@ namespace Emby.Server.Implementations.Library
public List GetPeopleItems(InternalPeopleQuery query)
{
- return _itemRepository.GetPeopleNames(query).Select(i =>
+ return _itemRepository.GetPeopleNames(query)
+ .Select(i =>
{
try
{
@@ -2777,7 +2778,12 @@ namespace Emby.Server.Implementations.Library
_logger.LogError(ex, "Error getting person");
return null;
}
- }).Where(i => i != null).ToList();
+ })
+ .Where(i => i != null)
+ .Where(i => query.User == null ?
+ true :
+ i.IsVisible(query.User))
+ .ToList();
}
public List GetPeopleNames(InternalPeopleQuery query)
diff --git a/Jellyfin.Api/Controllers/PersonsController.cs b/Jellyfin.Api/Controllers/PersonsController.cs
index be4b9eded5..33f1aea394 100644
--- a/Jellyfin.Api/Controllers/PersonsController.cs
+++ b/Jellyfin.Api/Controllers/PersonsController.cs
@@ -98,7 +98,10 @@ namespace Jellyfin.Api.Controllers
Limit = limit ?? 0
});
- return new QueryResult(peopleItems.Select(person => _dtoService.GetItemByNameDto(person, dtoOptions, null, user)).ToArray());
+ return new QueryResult(
+ peopleItems
+ .Select(person => _dtoService.GetItemByNameDto(person, dtoOptions, null, user))
+ .ToArray());
}
///
From 37160774958772b9e5b91320fd936301736c7fa5 Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Fri, 23 Sep 2022 23:12:50 -0400
Subject: [PATCH 120/262] Backport pull request #8433 from
jellyfin/release-10.8.z
Update to dotnet 6.0.9
Original-merge: 4ec82ec662834867742a08dff680c938c4a5542a
Merged-by: Joshua M. Boniface
Backported-by: Joshua M. Boniface
---
.../Emby.Server.Implementations.csproj | 2 +-
Jellyfin.Api/Jellyfin.Api.csproj | 2 +-
.../Jellyfin.Server.Implementations.csproj | 8 ++++----
Jellyfin.Server/Jellyfin.Server.csproj | 4 ++--
MediaBrowser.Model/MediaBrowser.Model.csproj | 4 ++--
deployment/Dockerfile.centos.amd64 | 2 +-
deployment/Dockerfile.fedora.amd64 | 2 +-
deployment/Dockerfile.ubuntu.amd64 | 2 +-
deployment/Dockerfile.ubuntu.arm64 | 2 +-
deployment/Dockerfile.ubuntu.armhf | 2 +-
.../Jellyfin.MediaEncoding.Keyframes.csproj | 2 +-
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
14 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index 24395a1933..2792a4c7c5 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -29,7 +29,7 @@
-
+
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index ce01b415bb..7e64cf645b 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
index 678f960839..83b2262782 100644
--- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
+++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
@@ -27,13 +27,13 @@
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index a0845a0a8a..25e38b7d3f 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -37,8 +37,8 @@
-
-
+
+
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 4f511f9960..ad2ff1ba29 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -34,13 +34,13 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/deployment/Dockerfile.centos.amd64 b/deployment/Dockerfile.centos.amd64
index 81d75c1aae..0bae42bc85 100644
--- a/deployment/Dockerfile.centos.amd64
+++ b/deployment/Dockerfile.centos.amd64
@@ -13,7 +13,7 @@ RUN yum update -yq \
&& yum install -yq @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git wget
# Install DotNET SDK
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/cd0d0a4d-2a6a-4d0d-b42e-dfd3b880e222/008a93f83aba6d1acf75ded3d2cfba24/dotnet-sdk-6.0.400-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-6.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.fedora.amd64 b/deployment/Dockerfile.fedora.amd64
index 4139ed96d3..20aa777b69 100644
--- a/deployment/Dockerfile.fedora.amd64
+++ b/deployment/Dockerfile.fedora.amd64
@@ -12,7 +12,7 @@ RUN dnf update -yq \
&& dnf install -yq @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel systemd wget make
# Install DotNET SDK
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/cd0d0a4d-2a6a-4d0d-b42e-dfd3b880e222/008a93f83aba6d1acf75ded3d2cfba24/dotnet-sdk-6.0.400-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-6.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64
index 7863d13131..ccc0f76cdc 100644
--- a/deployment/Dockerfile.ubuntu.amd64
+++ b/deployment/Dockerfile.ubuntu.amd64
@@ -17,7 +17,7 @@ RUN apt-get update -yqq \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/cd0d0a4d-2a6a-4d0d-b42e-dfd3b880e222/008a93f83aba6d1acf75ded3d2cfba24/dotnet-sdk-6.0.400-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-6.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64
index 206caea110..8931809746 100644
--- a/deployment/Dockerfile.ubuntu.arm64
+++ b/deployment/Dockerfile.ubuntu.arm64
@@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/cd0d0a4d-2a6a-4d0d-b42e-dfd3b880e222/008a93f83aba6d1acf75ded3d2cfba24/dotnet-sdk-6.0.400-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-6.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf
index 5bd1a5638e..bf1edf7777 100644
--- a/deployment/Dockerfile.ubuntu.armhf
+++ b/deployment/Dockerfile.ubuntu.armhf
@@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/cd0d0a4d-2a6a-4d0d-b42e-dfd3b880e222/008a93f83aba6d1acf75ded3d2cfba24/dotnet-sdk-6.0.400-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-6.0.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/src/Jellyfin.MediaEncoding.Keyframes/Jellyfin.MediaEncoding.Keyframes.csproj b/src/Jellyfin.MediaEncoding.Keyframes/Jellyfin.MediaEncoding.Keyframes.csproj
index 29cdf561f7..9585cb60c6 100644
--- a/src/Jellyfin.MediaEncoding.Keyframes/Jellyfin.MediaEncoding.Keyframes.csproj
+++ b/src/Jellyfin.MediaEncoding.Keyframes/Jellyfin.MediaEncoding.Keyframes.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index 97a549943d..a742029b65 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index 2be523a808..c2ab03e258 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index e69f1f0e0d..88686b7dfd 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -10,7 +10,7 @@
-
+
From 266fb2f81c33d193898d5865de4ab150da34ef70 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 26 Sep 2022 12:01:34 +0000
Subject: [PATCH 121/262] Bump Microsoft.NET.Test.Sdk from 17.3.1 to 17.3.2
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.3.1 to 17.3.2.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v17.3.1...v17.3.2)
---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj | 2 +-
.../Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj | 2 +-
tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj | 2 +-
.../Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Hls.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Keyframes.Tests.csproj | 2 +-
.../Jellyfin.MediaEncoding.Tests.csproj | 2 +-
tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj | 2 +-
tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj | 2 +-
.../Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj | 2 +-
tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj | 2 +-
.../Jellyfin.Server.Implementations.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
.../Jellyfin.XbmcMetadata.Tests.csproj | 2 +-
16 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index a742029b65..a20c9690f0 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -17,7 +17,7 @@
-
+
all
diff --git a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
index 77cdcfadab..95fc1d9176 100644
--- a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
+++ b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
diff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
index 1496bc80c9..d95747206d 100644
--- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
+++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
index f450936f2f..1444d6faf7 100644
--- a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
+++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj
index dfe7655837..9e3bef8818 100644
--- a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj
+++ b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj
@@ -7,7 +7,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
index dae7722c34..83ea1907c0 100644
--- a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj
@@ -7,7 +7,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
index ea4788cb87..84a069424e 100644
--- a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj
@@ -8,7 +8,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
index 5914eea47e..4cff2143c4 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
index cef719cbd5..fbcaa66f4b 100644
--- a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
+++ b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
index a630ace154..da0e9f5b1d 100644
--- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
+++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
index 75f0e688c6..8ec0262bd5 100644
--- a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
+++ b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
diff --git a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
index 465ea6b944..1942297376 100644
--- a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
+++ b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
index 27390c9379..918802d77a 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
+++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index c2ab03e258..659737392d 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -11,7 +11,7 @@
-
+
all
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index 88686b7dfd..b2653b28b3 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
index 53921cb6ed..f03448eed8 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj
@@ -13,7 +13,7 @@
-
+
From cf6658c5464f6a21d50b24e98ad5838f8e21b8f8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 26 Sep 2022 12:06:24 +0000
Subject: [PATCH 122/262] Bump actions/stale from 5 to 6
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v6)
---
updated-dependencies:
- dependency-name: actions/stale
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/repo-stale.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/repo-stale.yaml b/.github/workflows/repo-stale.yaml
index 0504b1c50d..2578f82cfe 100644
--- a/.github/workflows/repo-stale.yaml
+++ b/.github/workflows/repo-stale.yaml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ contains(github.repository, 'jellyfin/') }}
steps:
- - uses: actions/stale@v5
+ - uses: actions/stale@v6
with:
repo-token: ${{ secrets.JF_BOT_TOKEN }}
days-before-stale: 120
From 5efa138c221fddf86696ed6b1c58409ad8527bd3 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 26 Sep 2022 16:24:21 -0400
Subject: [PATCH 123/262] Update MediaBrowser.Controller/Lyrics/LyricInfo.cs
Co-authored-by: Bond-009
---
MediaBrowser.Controller/Lyrics/LyricInfo.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MediaBrowser.Controller/Lyrics/LyricInfo.cs b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
index 6ebb83d125..6ec6df5825 100644
--- a/MediaBrowser.Controller/Lyrics/LyricInfo.cs
+++ b/MediaBrowser.Controller/Lyrics/LyricInfo.cs
@@ -38,7 +38,7 @@ public static class LyricInfo
foreach (var lyricFilePath in Directory.GetFiles(itemDirectoryPath, $"{Path.GetFileNameWithoutExtension(itemPath)}.*"))
{
- if (EnumerableExtensions.Contains(lyricProvider.SupportedMediaTypes, Path.GetExtension(lyricFilePath.AsSpan())[1..], StringComparison.OrdinalIgnoreCase))
+ if (lyricProvider.SupportedMediaTypes.Contains(Path.GetExtension(lyricFilePath.AsSpan())[1..], StringComparison.OrdinalIgnoreCase))
{
return lyricFilePath;
}
From c36785724444f651c1c24a72fed750e42a4d7b68 Mon Sep 17 00:00:00 2001
From: 1hitsong <3330318+1hitsong@users.noreply.github.com>
Date: Mon, 26 Sep 2022 16:27:55 -0400
Subject: [PATCH 124/262] Format returns
---
MediaBrowser.Providers/Lyric/LrcLyricProvider.cs | 11 +++++++++--
MediaBrowser.Providers/Lyric/TxtLyricProvider.cs | 5 ++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
index 4d4e35a4e1..7b108921b3 100644
--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs
@@ -130,10 +130,17 @@ public class LrcLyricProvider : ILyricProvider
// Map metaData values from LRC file to LyricMetadata properties
LyricMetadata lyricMetadata = MapMetadataValues(fileMetaData);
- return new LyricResponse { Metadata = lyricMetadata, Lyrics = lyricList };
+ return new LyricResponse
+ {
+ Metadata = lyricMetadata,
+ Lyrics = lyricList
+ };
}
- return new LyricResponse { Lyrics = lyricList };
+ return new LyricResponse
+ {
+ Lyrics = lyricList
+ };
}
///
diff --git a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
index 85f792d098..96a9e9dcf3 100644
--- a/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
+++ b/MediaBrowser.Providers/Lyric/TxtLyricProvider.cs
@@ -53,6 +53,9 @@ public class TxtLyricProvider : ILyricProvider
lyricList[lyricLineIndex] = new LyricLine(lyricTextLines[lyricLineIndex]);
}
- return new LyricResponse { Lyrics = lyricList };
+ return new LyricResponse
+ {
+ Lyrics = lyricList
+ };
}
}
From 4edeccc5e0ff391a5f8c35f5f9b81a5ca0e228de Mon Sep 17 00:00:00 2001
From: Hannes Braun
Date: Wed, 28 Sep 2022 16:17:08 +0200
Subject: [PATCH 125/262] Remove redundant using directives
---
.../HttpServer/Security/SessionContext.cs | 1 -
Emby.Server.Implementations/HttpServer/WebSocketConnection.cs | 1 -
Emby.Server.Implementations/Library/LibraryManager.cs | 1 -
Emby.Server.Implementations/Session/SessionWebSocketListener.cs | 1 -
Emby.Server.Implementations/Sorting/StudioComparer.cs | 1 -
MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs | 1 -
MediaBrowser.Controller/Net/IWebSocketConnection.cs | 1 -
MediaBrowser.Controller/Playlists/Playlist.cs | 1 -
MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs | 1 -
MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs | 2 --
MediaBrowser.Model/Branding/BrandingOptions.cs | 1 -
MediaBrowser.Model/Configuration/EncodingOptions.cs | 2 --
MediaBrowser.Model/Dlna/StreamInfo.cs | 1 -
src/Jellyfin.Extensions/StringExtensions.cs | 1 -
src/Jellyfin.MediaEncoding.Hls/Extractors/IKeyframeExtractor.cs | 1 -
tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs | 1 -
tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs | 1 -
tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs | 1 -
tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs | 1 -
tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs | 1 -
.../Sorting/ParentIndexNumberComparerTests.cs | 1 -
.../JellyfinApplicationFactory.cs | 1 -
.../Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs | 1 -
23 files changed, 25 deletions(-)
diff --git a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs b/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
index 15ab363fe6..e0d20e2100 100644
--- a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
+++ b/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
@@ -1,6 +1,5 @@
#pragma warning disable CS1591
-using System;
using System.Threading.Tasks;
using Jellyfin.Data.Entities;
using MediaBrowser.Common.Extensions;
diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
index 818ccbb1b8..d095248fab 100644
--- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
+++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
@@ -11,7 +11,6 @@ using Jellyfin.Extensions.Json;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Session;
-using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.HttpServer
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 250e7619fb..67f9c57658 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -46,7 +46,6 @@ using MediaBrowser.Model.Library;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Caching.Memory;
-using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Episode = MediaBrowser.Controller.Entities.TV.Episode;
using EpisodeInfo = Emby.Naming.TV.EpisodeInfo;
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
index fccf50f60f..35fd5caae7 100644
--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -6,7 +6,6 @@ using System.Linq;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Net;
diff --git a/Emby.Server.Implementations/Sorting/StudioComparer.cs b/Emby.Server.Implementations/Sorting/StudioComparer.cs
index 4d89cfa8b2..c917daaad1 100644
--- a/Emby.Server.Implementations/Sorting/StudioComparer.cs
+++ b/Emby.Server.Implementations/Sorting/StudioComparer.cs
@@ -3,7 +3,6 @@
#pragma warning disable CS1591
using System;
-using System.Linq;
using Jellyfin.Extensions;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 491662861f..c9625cf1da 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -6,7 +6,6 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
-using System.Text.Json.Serialization;
using Jellyfin.Data.Entities;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
diff --git a/MediaBrowser.Controller/Net/IWebSocketConnection.cs b/MediaBrowser.Controller/Net/IWebSocketConnection.cs
index 43c7ce3708..4f2492b891 100644
--- a/MediaBrowser.Controller/Net/IWebSocketConnection.cs
+++ b/MediaBrowser.Controller/Net/IWebSocketConnection.cs
@@ -6,7 +6,6 @@ using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Net;
-using Microsoft.AspNetCore.Http;
namespace MediaBrowser.Controller.Net
{
diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs
index 828ecb2c51..7ae9ff7463 100644
--- a/MediaBrowser.Controller/Playlists/Playlist.cs
+++ b/MediaBrowser.Controller/Playlists/Playlist.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
-using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json.Serialization;
diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
index 095757bef7..5dbc438e44 100644
--- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
+++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
@@ -1,4 +1,3 @@
-using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace MediaBrowser.MediaEncoding.Probing
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
index eb8ff96246..0d4489517e 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
@@ -3,12 +3,10 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
-using System.Reflection;
using Jellyfin.Extensions;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging;
using Nikse.SubtitleEdit.Core.Common;
-using Nikse.SubtitleEdit.Core.SubtitleFormats;
using SubtitleFormat = Nikse.SubtitleEdit.Core.SubtitleFormats.SubtitleFormat;
namespace MediaBrowser.MediaEncoding.Subtitles
diff --git a/MediaBrowser.Model/Branding/BrandingOptions.cs b/MediaBrowser.Model/Branding/BrandingOptions.cs
index a0adb56ef7..695267d46d 100644
--- a/MediaBrowser.Model/Branding/BrandingOptions.cs
+++ b/MediaBrowser.Model/Branding/BrandingOptions.cs
@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
-using System.Xml.Serialization;
namespace MediaBrowser.Model.Branding;
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
index 73ebfba70e..f4cd2f0065 100644
--- a/MediaBrowser.Model/Configuration/EncodingOptions.cs
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -1,5 +1,3 @@
-using System;
-
#nullable disable
#pragma warning disable CS1591
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index 0c66351c70..5cfa2e7e3c 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
-using System.Linq;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
diff --git a/src/Jellyfin.Extensions/StringExtensions.cs b/src/Jellyfin.Extensions/StringExtensions.cs
index 59fb038a75..b19be071bf 100644
--- a/src/Jellyfin.Extensions/StringExtensions.cs
+++ b/src/Jellyfin.Extensions/StringExtensions.cs
@@ -1,5 +1,4 @@
using System;
-using System.Diagnostics;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
diff --git a/src/Jellyfin.MediaEncoding.Hls/Extractors/IKeyframeExtractor.cs b/src/Jellyfin.MediaEncoding.Hls/Extractors/IKeyframeExtractor.cs
index 497210f417..083e93de1a 100644
--- a/src/Jellyfin.MediaEncoding.Hls/Extractors/IKeyframeExtractor.cs
+++ b/src/Jellyfin.MediaEncoding.Hls/Extractors/IKeyframeExtractor.cs
@@ -1,4 +1,3 @@
-using System;
using System.Diagnostics.CodeAnalysis;
using Jellyfin.MediaEncoding.Keyframes;
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs
index e14850eed7..fe0d7fc90f 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs
@@ -1,7 +1,6 @@
using System;
using System.Globalization;
using System.IO;
-using System.Threading;
using MediaBrowser.MediaEncoding.Subtitles;
using Microsoft.Extensions.Logging.Abstractions;
using Xunit;
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs
index 0038b18736..2aebee5562 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs
@@ -1,7 +1,6 @@
using System;
using System.Globalization;
using System.IO;
-using System.Threading;
using MediaBrowser.MediaEncoding.Subtitles;
using Microsoft.Extensions.Logging.Abstractions;
using Xunit;
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs
index 3b9a71690c..6abf2d26cb 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
-using System.Threading;
using MediaBrowser.MediaEncoding.Subtitles;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging.Abstractions;
diff --git a/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs b/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs
index 9a9a57be47..79f2366b89 100644
--- a/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs
@@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Linq;
using Emby.Naming.Common;
using Emby.Naming.Video;
-using MediaBrowser.Model.IO;
using Xunit;
namespace Jellyfin.Naming.Tests.Video
diff --git a/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs b/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs
index b761878426..cc9cfdd7dd 100644
--- a/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs
@@ -3,7 +3,6 @@ using System.Linq;
using Emby.Naming.Common;
using Emby.Naming.Video;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.IO;
using Xunit;
namespace Jellyfin.Naming.Tests.Video
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Sorting/ParentIndexNumberComparerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Sorting/ParentIndexNumberComparerTests.cs
index 40f271d61b..261092e019 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Sorting/ParentIndexNumberComparerTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Sorting/ParentIndexNumberComparerTests.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using Emby.Server.Implementations.Sorting;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
diff --git a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs
index adaf624a91..48c49bf848 100644
--- a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs
@@ -11,7 +11,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Extensions.Logging;
-using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
namespace Jellyfin.Server.Integration.Tests
{
diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs
index 7c99520308..988abce812 100644
--- a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs
+++ b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Jellyfin.Data.Entities;
From 167863cdf4e33dd122108a82b9934a00adbe3f1d Mon Sep 17 00:00:00 2001
From: Cota Fainado <20hvoby5pb@protonmail.com>
Date: Sun, 25 Sep 2022 22:10:23 +0000
Subject: [PATCH 126/262] Translated using Weblate (Portuguese (Portugal))
Translation: Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt_PT/
---
Emby.Server.Implementations/Localization/Core/pt-PT.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/pt-PT.json b/Emby.Server.Implementations/Localization/Core/pt-PT.json
index 44600374b1..7047f1c282 100644
--- a/Emby.Server.Implementations/Localization/Core/pt-PT.json
+++ b/Emby.Server.Implementations/Localization/Core/pt-PT.json
@@ -8,15 +8,15 @@
"CameraImageUploadedFrom": "Uma nova imagem de câmara foi enviada a partir de {0}",
"Channels": "Canais",
"ChapterNameValue": "Capítulo {0}",
- "Collections": "Coleções",
+ "Collections": "Colecções",
"DeviceOfflineWithName": "{0} desligou-se",
"DeviceOnlineWithName": "{0} ligou-se",
"FailedLoginAttemptWithUserName": "Tentativa de login falhada a partir de {0}",
"Favorites": "Favoritos",
"Folders": "Pastas",
"Genres": "Géneros",
- "HeaderAlbumArtists": "Artistas do Álbum",
- "HeaderContinueWatching": "Continuar a Ver",
+ "HeaderAlbumArtists": "Artistas do álbum",
+ "HeaderContinueWatching": "Continuar a ver",
"HeaderFavoriteAlbums": "Álbuns Favoritos",
"HeaderFavoriteArtists": "Artistas Favoritos",
"HeaderFavoriteEpisodes": "Episódios Favoritos",
From b3c349ce90020930e5475be169770a6af0ffbb63 Mon Sep 17 00:00:00 2001
From: dynamic-core
Date: Mon, 26 Sep 2022 21:19:45 +0000
Subject: [PATCH 127/262] Translated using Weblate (Portuguese) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pt/
---
.../Localization/Core/pt.json | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/pt.json b/Emby.Server.Implementations/Localization/Core/pt.json
index 69bc4c90f7..c2c77ccab1 100644
--- a/Emby.Server.Implementations/Localization/Core/pt.json
+++ b/Emby.Server.Implementations/Localization/Core/pt.json
@@ -1,5 +1,5 @@
{
- "HeaderLiveTV": "TV Ao Vivo",
+ "HeaderLiveTV": "TV Em Direto",
"Collections": "Coleções",
"Books": "Livros",
"Artists": "Artistas",
@@ -10,9 +10,9 @@
"HeaderFavoriteAlbums": "Álbuns Favoritos",
"HeaderFavoriteEpisodes": "Episódios Favoritos",
"HeaderFavoriteShows": "Séries Favoritas",
- "HeaderContinueWatching": "Continuar assistindo",
+ "HeaderContinueWatching": "Continuar a ver",
"HeaderAlbumArtists": "Artistas do Álbum",
- "Genres": "Gêneros",
+ "Genres": "Géneros",
"Folders": "Diretórios",
"Favorites": "Favoritos",
"Channels": "Canais",
@@ -74,7 +74,7 @@
"ItemRemovedWithName": "{0} foi removido da biblioteca",
"ItemAddedWithName": "{0} foi adicionado à biblioteca",
"Inherit": "Herdar",
- "HomeVideos": "Vídeos principais",
+ "HomeVideos": "Vídeos Caseiros",
"HeaderRecordingGroups": "Grupos de Gravação",
"ValueSpecialEpisodeName": "Episódio Especial - {0}",
"Sync": "Sincronização",
@@ -83,14 +83,14 @@
"Playlists": "Listas de Reprodução",
"Photos": "Fotografias",
"Movies": "Filmes",
- "FailedLoginAttemptWithUserName": "Tentativa falha de login a partir de {0}",
- "DeviceOnlineWithName": "{0} está conectado",
- "DeviceOfflineWithName": "{0} desconectou-se",
+ "FailedLoginAttemptWithUserName": "Tentativa de início de sessão falhada a partir de {0}",
+ "DeviceOnlineWithName": "{0} está ligado",
+ "DeviceOfflineWithName": "{0} desligou-se",
"ChapterNameValue": "Capítulo {0}",
"CameraImageUploadedFrom": "Uma nova imagem da câmara foi enviada a partir de {0}",
"AuthenticationSucceededWithUserName": "{0} autenticado com sucesso",
- "Application": "Aplicativo",
- "AppDeviceValues": "Aplicativo {0}, Dispositivo: {1}",
+ "Application": "Aplicação",
+ "AppDeviceValues": "Aplicação: {0}, Dispositivo: {1}",
"TaskCleanCache": "Limpar Diretório de Cache",
"TasksApplicationCategory": "Aplicativo",
"TasksLibraryCategory": "Biblioteca",
From 85f7e94ab5757397ced93d75751efb69edc10db8 Mon Sep 17 00:00:00 2001
From: radiogalva
Date: Mon, 26 Sep 2022 13:10:12 +0000
Subject: [PATCH 128/262] Translated using Weblate (Latvian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/lv/
---
Emby.Server.Implementations/Localization/Core/lv.json | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/lv.json b/Emby.Server.Implementations/Localization/Core/lv.json
index 443a74a10f..e460fd7197 100644
--- a/Emby.Server.Implementations/Localization/Core/lv.json
+++ b/Emby.Server.Implementations/Localization/Core/lv.json
@@ -84,7 +84,7 @@
"CameraImageUploadedFrom": "Jauns kameras attēls ir ticis augšupielādēts no {0}",
"Books": "Grāmatas",
"Artists": "Izpildītāji",
- "Albums": "Albumi",
+ "Albums": "Albūmi",
"ProviderValue": "Provider: {0}",
"HeaderFavoriteSongs": "Dziesmu Favorīti",
"HeaderFavoriteShows": "Raidījumu Favorīti",
@@ -117,7 +117,8 @@
"TaskCleanActivityLogDescription": "Nodzēš darbību žurnāla ierakstus, kuri ir vecāki par doto vecumu.",
"TaskCleanActivityLog": "Notīrīt Darbību Žurnālu",
"Undefined": "Nenoteikts",
- "Default": "Noklusējums",
+ "Default": "Noklusējuma",
"TaskOptimizeDatabaseDescription": "Saspiež datubāzi un atbrīvo atmiņu. Uzdevum palaišana pēc bibliotēku skenēšanas vai citām, ar datubāzi saistītām, izmaiņām iespējams uzlabos ātrdarbību.",
- "TaskOptimizeDatabase": "Optimizēt datubāzi"
+ "TaskOptimizeDatabase": "Optimizēt datubāzi",
+ "External": "Ārējais"
}
From 9904e38c722a159baf9a3e642827ba8e60558257 Mon Sep 17 00:00:00 2001
From: rimasx
Date: Tue, 27 Sep 2022 04:11:05 +0000
Subject: [PATCH 129/262] Translated using Weblate (Estonian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/et/
---
Emby.Server.Implementations/Localization/Core/et.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/et.json b/Emby.Server.Implementations/Localization/Core/et.json
index 8db6a0b388..da44e53d00 100644
--- a/Emby.Server.Implementations/Localization/Core/et.json
+++ b/Emby.Server.Implementations/Localization/Core/et.json
@@ -119,5 +119,6 @@
"SubtitleDownloadFailureFromForItem": "Subtiitrite allalaadimine {0} > {1} nurjus",
"UserPolicyUpdatedWithName": "Kasutaja {0} õigusi värskendati",
"UserStoppedPlayingItemWithValues": "{0} lõpetas {1} taasesituse seadmes {2}",
- "UserOnlineFromDevice": "{0} on ühendatud seadmest {1}"
+ "UserOnlineFromDevice": "{0} on ühendatud seadmest {1}",
+ "External": "Väline"
}
From a6ebcc8c585798745ccfdd2ea3e22484c685f9a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D9=8A=D8=A7=D8=AF=D9=89=D9=83=D8=A7=D8=B1=20=D9=8A=D8=A7?=
=?UTF-8?q?=D9=82=DB=87=D9=BE?=
Date: Tue, 27 Sep 2022 18:56:46 +0000
Subject: [PATCH 130/262] Translated using Weblate (Uyghur) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ug/
---
.../Localization/Core/ug.json | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/ug.json b/Emby.Server.Implementations/Localization/Core/ug.json
index aea93c7fa4..509a6fc8d9 100644
--- a/Emby.Server.Implementations/Localization/Core/ug.json
+++ b/Emby.Server.Implementations/Localization/Core/ug.json
@@ -3,7 +3,16 @@
"Channels": "قانال",
"CameraImageUploadedFrom": "{0} ئورۇندىن يېڭى سۈرەت چىقىرىلدى",
"Books": "كىتاب",
- "AuthenticationSucceededWithUserName": "تىزىملىتىش مۇۋەپپەقىيەتلىك بول",
+ "AuthenticationSucceededWithUserName": "{0} تەستىقلاش مۇۋاپىقىيەتلىك بولدى",
"Artists": "سەنئەتكار",
- "Albums": "پىلاستىنكا"
+ "Albums": "پىلاستىنكا",
+ "DeviceOnlineWithName": "{0} ئۇلاندى",
+ "DeviceOfflineWithName": "{0} ئۈزۈلدى",
+ "Collections": "توپلام",
+ "Application": "ئەپ",
+ "AppDeviceValues": "ئەپ: {0}، ئۈسكۈنە: {1}",
+ "HeaderLiveTV": "تور تېلېۋىزىيەسى",
+ "Default": "سۈكۈتتىكى",
+ "Folders": "ھۆججەت خالتىسى",
+ "Favorites": "ساقلىغۇچ"
}
From b9abc004a7f86af8df4d0e6599611eafdc5800bc Mon Sep 17 00:00:00 2001
From: jgriff6 <74262798+jgriff6@users.noreply.github.com>
Date: Wed, 28 Sep 2022 22:26:42 +0100
Subject: [PATCH 131/262] Fix subtitle selection behaviour
---
.../Library/MediaStreamSelector.cs | 30 +++++++++----------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/Emby.Server.Implementations/Library/MediaStreamSelector.cs b/Emby.Server.Implementations/Library/MediaStreamSelector.cs
index 20a2edb05a..1e6a7c51eb 100644
--- a/Emby.Server.Implementations/Library/MediaStreamSelector.cs
+++ b/Emby.Server.Implementations/Library/MediaStreamSelector.cs
@@ -45,42 +45,40 @@ namespace Emby.Server.Implementations.Library
.ThenByDescending(x => x.IsForced && string.Equals(x.Language, audioTrackLanguage, StringComparison.OrdinalIgnoreCase))
.ThenByDescending(x => x.IsForced)
.ThenByDescending(x => x.IsDefault)
+ .ThenByDescending(x => preferredLanguages.Contains(x.Language, StringComparison.OrdinalIgnoreCase))
.ToList();
MediaStream? stream = null;
if (mode == SubtitlePlaybackMode.Default)
{
- // Prefer embedded metadata over smart logic
- stream = sortedStreams.FirstOrDefault(s => s.IsExternal || s.IsForced || s.IsDefault);
-
- // if the audio language is not understood by the user, load their preferred subs, if there are any
- if (stream == null && !preferredLanguages.Contains(audioTrackLanguage, StringComparison.OrdinalIgnoreCase))
- {
- stream = sortedStreams.FirstOrDefault(s => !s.IsForced && preferredLanguages.Contains(s.Language, StringComparison.OrdinalIgnoreCase));
- }
+ // Load subtitles according to external, forced and default flags.
+ stream = sortedStreams.FirstOrDefault(x => x.IsExternal || x.IsForced || x.IsDefault);
}
else if (mode == SubtitlePlaybackMode.Smart)
{
- // if the audio language is not understood by the user, load their preferred subs, if there are any
+ // Respect forced flag.
+ stream = sortedStreams.FirstOrDefault(x => x.IsForced);
+
+ // Only attempt to load subtitles if the audio language is not one of the user's preferred subtitle languages.
+ // If no subtitles of preferred language available, use default behaviour.
if (!preferredLanguages.Contains(audioTrackLanguage, StringComparison.OrdinalIgnoreCase))
{
- stream = streams.FirstOrDefault(s => !s.IsForced && preferredLanguages.Contains(s.Language, StringComparison.OrdinalIgnoreCase)) ??
- streams.FirstOrDefault(s => preferredLanguages.Contains(s.Language, StringComparison.OrdinalIgnoreCase));
+ stream = sortedStreams.FirstOrDefault(x => preferredLanguages.Contains(x.Language, StringComparison.OrdinalIgnoreCase)) ??
+ sortedStreams.FirstOrDefault(x => x.IsExternal || x.IsForced || x.IsDefault);
}
}
else if (mode == SubtitlePlaybackMode.Always)
{
- // always load the most suitable full subtitles
- stream = sortedStreams.FirstOrDefault(s => !s.IsForced);
+ // Always load subtitles of the user's preferred subtitle language if possible, otherwise default behaviour.
+ stream = sortedStreams.FirstOrDefault(x => preferredLanguages.Contains(x.Language, StringComparison.OrdinalIgnoreCase)) ??
+ sortedStreams.FirstOrDefault(x => x.IsExternal || x.IsForced || x.IsDefault);
}
else if (mode == SubtitlePlaybackMode.OnlyForced)
{
- // always load the most suitable full subtitles
+ // Only load subtitles that are flagged forced.
stream = sortedStreams.FirstOrDefault(x => x.IsForced);
}
- // load forced subs if we have found no suitable full subtitles
- stream ??= sortedStreams.FirstOrDefault(s => s.IsForced && string.Equals(s.Language, audioTrackLanguage, StringComparison.OrdinalIgnoreCase));
return stream?.Index;
}
From 55b0ebbbf300421479d2c0dcf6be45e667a8ac9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stjepan=20Mrgnai=C4=87?=
Date: Thu, 29 Sep 2022 09:27:43 +0000
Subject: [PATCH 132/262] Translated using Weblate (Croatian) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hr/
---
Emby.Server.Implementations/Localization/Core/hr.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/hr.json b/Emby.Server.Implementations/Localization/Core/hr.json
index d2b5122b26..c63cd2b94f 100644
--- a/Emby.Server.Implementations/Localization/Core/hr.json
+++ b/Emby.Server.Implementations/Localization/Core/hr.json
@@ -122,5 +122,6 @@
"TaskOptimizeDatabase": "Optimiziraj bazu podataka",
"External": "Vanjski",
"TaskKeyframeExtractorDescription": "Izvlačenje ključnih okvira iz videozapisa za stvaranje objektivnije HLS liste za reprodukciju. Pokretanje ovog zadatka može potrajati.",
- "TaskKeyframeExtractor": "Izvoditelj ključnog okvira"
+ "TaskKeyframeExtractor": "Izvoditelj ključnog okvira",
+ "TaskOptimizeDatabaseDescription": "Sažima bazu podataka i uklanja prazan prostor. Pokretanje ovog zadatka, može poboljšati performanse nakon provođenja indeksiranja biblioteke ili provođenja drugih promjena koje utječu na bazu podataka."
}
From 647f435f6e393c3fad393d3fe94b0d6412756215 Mon Sep 17 00:00:00 2001
From: Shadowghost
Date: Wed, 14 Sep 2022 15:13:34 +0200
Subject: [PATCH 133/262] Redirect natively if no baseurl is set
---
.../BaseUrlRedirectionMiddleware.cs | 48 ++++++++++---------
1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs
index e0c112d60d..61b9c6f06e 100644
--- a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs
+++ b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs
@@ -45,36 +45,40 @@ namespace Jellyfin.Server.Middleware
var localPath = httpContext.Request.Path.ToString();
var baseUrlPrefix = serverConfigurationManager.GetNetworkConfiguration().BaseUrl;
- if (!string.IsNullOrEmpty(baseUrlPrefix))
+ if (string.IsNullOrEmpty(localPath)
+ || string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, "/web", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, "/web/", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, baseUrlPrefix, StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, baseUrlPrefix + "/", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, baseUrlPrefix + "/web", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, baseUrlPrefix + "/web/", StringComparison.OrdinalIgnoreCase)
+ || !localPath.StartsWith(baseUrlPrefix, StringComparison.OrdinalIgnoreCase)
+ )
{
- var startsWithBaseUrl = localPath.StartsWith(baseUrlPrefix, StringComparison.OrdinalIgnoreCase);
-
- if (!startsWithBaseUrl
- && (localPath.Equals("/health", StringComparison.OrdinalIgnoreCase)
- || localPath.Equals("/health/", StringComparison.OrdinalIgnoreCase)))
+ // Redirect health endpoint
+ if (string.Equals(localPath, "/health", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(localPath, "/health/", StringComparison.OrdinalIgnoreCase))
{
_logger.LogDebug("Redirecting /health check");
httpContext.Response.Redirect(baseUrlPrefix + "/health");
return;
}
- if (!startsWithBaseUrl
- || localPath.Length == baseUrlPrefix.Length
- // Local path is /baseUrl/
- || (localPath.Length == baseUrlPrefix.Length + 1 && localPath[^1] == '/'))
- {
- // Always redirect back to the default path if the base prefix is invalid, missing, or is the full path.
- _logger.LogDebug("Normalizing an URL at {LocalPath}", localPath);
- httpContext.Response.Redirect(baseUrlPrefix + "/" + _configuration[DefaultRedirectKey]);
- return;
- }
- }
- else if (string.IsNullOrEmpty(localPath)
- || localPath.Equals("/", StringComparison.Ordinal))
- {
- // Always redirect back to the default path if root is requested.
+ // Always redirect back to the default path if the base prefix is invalid or missing
_logger.LogDebug("Normalizing an URL at {LocalPath}", localPath);
- httpContext.Response.Redirect("/" + _configuration[DefaultRedirectKey]);
+
+ if (string.IsNullOrWhiteSpace(baseUrlPrefix) || baseUrlPrefix[^1] != '/')
+ {
+ baseUrlPrefix += "/";
+ }
+
+ var uri = new Uri(localPath);
+ var redirectUri = new Uri(baseUrlPrefix + _configuration[DefaultRedirectKey]);
+ var target = uri.MakeRelativeUri(redirectUri).ToString();
+ _logger.LogDebug("Redirecting to {Target}", target);
+
+ httpContext.Response.Redirect(target);
return;
}
From 0a1563455063abbd4560438b203b0e2b0e8a4430 Mon Sep 17 00:00:00 2001
From: markus
Date: Sat, 1 Oct 2022 08:53:54 -0600
Subject: [PATCH 134/262] Streams with CodecType "data" (like "epg" streams in
DVB recordings) get ignored. This results in wrong stream specifiers for all
subsequent streams. This fix correctly handles "data" streams without any
further processing.
---
.../Probing/ProbeResultNormalizer.cs | 5 +++++
MediaBrowser.Model/Entities/MediaStreamType.cs | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 6cae7f5582..b33b45ab2f 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -875,8 +875,13 @@ namespace MediaBrowser.MediaEncoding.Probing
}
}
}
+ else if (string.Equals(streamInfo.CodecType, "data", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.Type = MediaStreamType.Data;
+ }
else
{
+ _logger.LogError("Codec Type {CodecType} unknown. The stream (index: {Index}) will be ignored. Warning: Subsequential streams will have a wrong stream specifier!", streamInfo.CodecType, streamInfo.Index);
return null;
}
diff --git a/MediaBrowser.Model/Entities/MediaStreamType.cs b/MediaBrowser.Model/Entities/MediaStreamType.cs
index e09aaf6d05..83751a6a7d 100644
--- a/MediaBrowser.Model/Entities/MediaStreamType.cs
+++ b/MediaBrowser.Model/Entities/MediaStreamType.cs
@@ -23,6 +23,11 @@ namespace MediaBrowser.Model.Entities
///
/// The embedded image.
///
- EmbeddedImage
+ EmbeddedImage,
+
+ ///
+ /// The data.
+ ///
+ Data
}
}
From 12cf98b4e3625a69000a24a27e7117d2d31ad4bc Mon Sep 17 00:00:00 2001
From: Shadowghost
Date: Sat, 1 Oct 2022 20:18:14 +0200
Subject: [PATCH 135/262] Update taglibsharp, add audible tag parsing
---
MediaBrowser.Providers/MediaBrowser.Providers.csproj | 2 +-
MediaBrowser.Providers/MediaInfo/AudioFileProber.cs | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 459045dffc..dd43ba9cb0 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
index 2b26b31379..cc41af5822 100644
--- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
+++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
@@ -134,6 +134,10 @@ namespace MediaBrowser.Providers.MediaInfo
{
tags = file.GetTag(TagTypes.FlacMetadata);
}
+ else if (tagTypes.HasFlag(TagTypes.AudibleMetadata))
+ {
+ tags = file.GetTag(TagTypes.AudibleMetadata);
+ }
else if (tagTypes.HasFlag(TagTypes.Id3v1))
{
tags = file.GetTag(TagTypes.Id3v1);
From 9589194a94b5d6326460f9d267581044a69bcf87 Mon Sep 17 00:00:00 2001
From: kimpig
Date: Sun, 2 Oct 2022 08:00:41 +0000
Subject: [PATCH 136/262] Translated using Weblate (Korean) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ko/
---
Emby.Server.Implementations/Localization/Core/ko.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Emby.Server.Implementations/Localization/Core/ko.json b/Emby.Server.Implementations/Localization/Core/ko.json
index 186ec44d24..a4b2e75b30 100644
--- a/Emby.Server.Implementations/Localization/Core/ko.json
+++ b/Emby.Server.Implementations/Localization/Core/ko.json
@@ -3,14 +3,14 @@
"AppDeviceValues": "앱: {0}, 장치: {1}",
"Application": "애플리케이션",
"Artists": "아티스트",
- "AuthenticationSucceededWithUserName": "{0}이 성공적으로 인증됨",
+ "AuthenticationSucceededWithUserName": "{0}이(가) 성공적으로 인증됨",
"Books": "도서",
"CameraImageUploadedFrom": "{0}에서 새로운 카메라 이미지가 업로드됨",
"Channels": "채널",
"ChapterNameValue": "챕터 {0}",
"Collections": "컬렉션",
"DeviceOfflineWithName": "{0}의 연결 끊김",
- "DeviceOnlineWithName": "{0}이 연결됨",
+ "DeviceOnlineWithName": "{0}이(가) 연결됨",
"FailedLoginAttemptWithUserName": "{0}에서 로그인 실패",
"Favorites": "즐겨찾기",
"Folders": "폴더",
From fa9820b1fd50c8df87771980bb0365988b877406 Mon Sep 17 00:00:00 2001
From: Shadowghost
Date: Mon, 3 Oct 2022 13:05:57 +0200
Subject: [PATCH 137/262] Add apple tag parsing
---
MediaBrowser.Providers/MediaInfo/AudioFileProber.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
index cc41af5822..e0c3bde8e1 100644
--- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
+++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
@@ -134,6 +134,10 @@ namespace MediaBrowser.Providers.MediaInfo
{
tags = file.GetTag(TagTypes.FlacMetadata);
}
+ else if (tagTypes.HasFlag(TagTypes.Apple))
+ {
+ tags = file.GetTag(TagTypes.Apple);
+ }
else if (tagTypes.HasFlag(TagTypes.AudibleMetadata))
{
tags = file.GetTag(TagTypes.AudibleMetadata);
From 4649e0e425e5ab37f3a0f62b720d671604f73f4e Mon Sep 17 00:00:00 2001
From: Shadowghost
Date: Mon, 3 Oct 2022 13:16:13 +0200
Subject: [PATCH 138/262] Add xiph tag parsing
---
MediaBrowser.Providers/MediaInfo/AudioFileProber.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
index e0c3bde8e1..42d85bb0cf 100644
--- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
+++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
@@ -138,6 +138,10 @@ namespace MediaBrowser.Providers.MediaInfo
{
tags = file.GetTag(TagTypes.Apple);
}
+ else if (tagTypes.HasFlag(TagTypes.Xiph))
+ {
+ tags = file.GetTag(TagTypes.Xiph);
+ }
else if (tagTypes.HasFlag(TagTypes.AudibleMetadata))
{
tags = file.GetTag(TagTypes.AudibleMetadata);
From 692dac5694cc87bafa1d9a5d7de6477f144a54da Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 3 Oct 2022 12:05:51 +0000
Subject: [PATCH 139/262] Bump actions/setup-dotnet from 2 to 3
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 2 to 3.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v2...v3)
---
updated-dependencies:
- dependency-name: actions/setup-dotnet
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/codeql-analysis.yml | 2 +-
.github/workflows/openapi.yml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 97ec4b30ed..1dbd7fa367 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -22,7 +22,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET Core
- uses: actions/setup-dotnet@v2
+ uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml
index 7739a5fa66..ceb4e8cdff 100644
--- a/.github/workflows/openapi.yml
+++ b/.github/workflows/openapi.yml
@@ -17,7 +17,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup .NET Core
- uses: actions/setup-dotnet@v2
+ uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Generate openapi.json
@@ -41,7 +41,7 @@ jobs:
with:
ref: ${{ github.base_ref }}
- name: Setup .NET Core
- uses: actions/setup-dotnet@v2
+ uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Generate openapi.json
From 927fe33d3a0ec7f9e0fb568cfd423c6e8b966c9d Mon Sep 17 00:00:00 2001
From: YusanTayir <208060627@qq.com>
Date: Thu, 6 Oct 2022 07:48:02 +0000
Subject: [PATCH 140/262] Translated using Weblate (Uyghur) Translation:
Jellyfin/Jellyfin Translate-URL:
https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ug/
---
.../Localization/Core/ug.json | 108 +++++++++++++++++-
1 file changed, 107 insertions(+), 1 deletion(-)
diff --git a/Emby.Server.Implementations/Localization/Core/ug.json b/Emby.Server.Implementations/Localization/Core/ug.json
index 509a6fc8d9..0bcbffb41a 100644
--- a/Emby.Server.Implementations/Localization/Core/ug.json
+++ b/Emby.Server.Implementations/Localization/Core/ug.json
@@ -14,5 +14,111 @@
"HeaderLiveTV": "تور تېلېۋىزىيەسى",
"Default": "سۈكۈتتىكى",
"Folders": "ھۆججەت خالتىسى",
- "Favorites": "ساقلىغۇچ"
+ "Favorites": "ساقلىغۇچ",
+ "LabelRunningTimeValue": "ئىجرا بولغان ۋاقتى:{0}",
+ "HeaderRecordingGroups": "خاتىرلەش گۇرۇپىسى",
+ "Forced": "ئەڭ",
+ "TaskKeyframeExtractor": "ھالقىلىق رامكا ئاجراتقۇچ",
+ "TaskKeyframeExtractorDescription": "سىن ھۆججەتلىرىدىن رامكا ئاجرىتىپ، تېخىمۇ ئېنىق بولغان HLS قويۇلۇش تىزىملىكىنى قۇرۇلىدۇ. بۇ ۋەزىپە ئۇزۇن داۋام قىلىشى مۇمكىن.",
+ "TaskOptimizeDatabase": "سانداننى ئەلالاشتۇرۇش",
+ "TaskDownloadMissingSubtitlesDescription": "ئامىللار تەڭشىكىگە ئاساسەن توردىن كەم بولغان فىلىم خېتىنى ئىزدەش.",
+ "TaskDownloadMissingSubtitles": "كەم بولغان فىلىم خەتلىرىنى چۈشۈرۈش",
+ "TasksChannelsCategory": "ئىنتېرنېت قاناللىرى",
+ "TaskRefreshChannelsDescription": "ئىنتېرنېت قانىلى ئۇچۇرىنى يېڭىلاش.",
+ "TaskRefreshChannels": "قانالنى يېڭىلاش",
+ "TaskCleanTranscodeDescription": "بىر كۈندىن ئاشقان ئالماشتۇرۇش ھۆججەتلىرىنى ئۆچۈرۈش.",
+ "TaskCleanTranscode": "ئايلاندۇرۇش ھۆججەت قىسقۇچىنى تازىلاش",
+ "TaskUpdatePluginsDescription": "ئاپتوماتىك يېڭىلاشقا بېكىتىلگەن قىستۇرمىلارنىڭ يېڭىلانمىسىنى چۈشۈرۈش ۋە قاچىلاش.",
+ "TaskUpdatePlugins": "قىستۇرمىلارنى يېڭىلاش",
+ "TaskRefreshPeopleDescription": "مېدىيا ئامبىرىدىكى ئارتىس ۋە رېژىسسورلارنىڭ ئۇچۇرىنى يېڭىلاش.",
+ "TaskRefreshPeople": "ئابونتلارنى يېڭىلاش",
+ "TaskCleanLogsDescription": "{0} كۈندىن ئاشقان Log ھۆججىتىنى ئۆچۈرۈش.",
+ "TaskCleanLogs": "Log ھۆججەت قسقۇچىنى تازىلاش",
+ "TaskRefreshLibraryDescription": "مېدىيا ئامبىرىغا قوشۇلغان يېڭى ھۆججەتلەرنى ئىزدەش ۋە مېدىيا ئۇچۇرلىرىنى يېڭىلاش.",
+ "TaskRefreshLibrary": "مېدىيا ئامبىرىنى سىكاننېرلاش",
+ "TaskRefreshChapterImagesDescription": "ۋېدىئو بۆلەكلىرى ئۈچۈن كىچىك سۈرەت ياساش.",
+ "TaskRefreshChapterImages": "بۆلەكلەر رەسىملىرىنى چىقىرىۋېلىش",
+ "TaskCleanCacheDescription": "سىستېما ئىھتىياجى يوق بولغان ۋاقىتلىق ھۆججەتلەرنى ئۆچۈرۈش.",
+ "TaskCleanCache": "ۋاقىتلىق ھۆججەت قىسقۇچنى تازىلاش",
+ "TaskCleanActivityLogDescription": "ۋاقىت تەڭشىكىدىن بۇرۇنقى پائالىيەت خاتىرىسى خاتىرىسىنى ئۆچۈرۈش.",
+ "TaskCleanActivityLog": "پروگرامما خاتىرىسىنى تازىلاش",
+ "TasksApplicationCategory": "پروگرامما",
+ "TasksLibraryCategory": "مېدىيا ئامبىرى",
+ "TasksMaintenanceCategory": "ئاسراش",
+ "VersionNumber": "نەشرى {0}",
+ "ValueSpecialEpisodeName": "خاسلىق - {0}",
+ "ValueHasBeenAddedToLibrary": "{0} مېدىيا ئامبىرىڭىزغا قوشۇلدى",
+ "UserStoppedPlayingItemWithValues": "{0}،{1} نى {2} دە قويۇنشتىن توختىدى",
+ "UserStartedPlayingItemWithValues": "{0}،{1} نى {2} دە قويۇۋاتىدۇ",
+ "UserPolicyUpdatedWithName": "ئابونتلار سىياسىتى {0} غا يېڭىلاندى",
+ "UserPasswordChangedWithName": "ئابونت{0} ئۈچۈن پارول ئۆزگەرتىلدى",
+ "UserOfflineFromDevice": "{0} بىلەن {1} نىڭ ئالاقىسى ئۈزۈلدى",
+ "UserLockedOutWithName": "ئابونت {0} قۇلۇپلاندى",
+ "UserDownloadingItemWithValues": "{0} چۈشۈرۈۋاتىدۇ {1}",
+ "UserDeletedWithName": "{0} ئابونت ئۆچۈرۈلدى",
+ "UserCreatedWithName": "{0} ئابونت يېڭىدىن قوشۇلدى",
+ "User": "ئابونت",
+ "Undefined": "بېكىتىلمىگەن",
+ "TvShows": "تىياتىرلار",
+ "System": "سىستېما",
+ "Sync": "ماس قەدەمدەش",
+ "SubtitleDownloadFailureFromForItem": "{0} دىن {0} نىڭ فىلىم خېتىنى چۈشۈرگىلى بولمىدى",
+ "StartupEmbyServerIsLoading": "Jellyfin مۇلازىمىتېرى يۈكلىنىۋاتىدۇ. سەل تۇرۇپ قايتا سىناڭ.",
+ "Songs": "ناخشىلار",
+ "Shows": "پروگراممىلار",
+ "ServerNameNeedsToBeRestarted": "{0} قايتا قوزغىتىلىشى كېرەك",
+ "ScheduledTaskStartedWithName": "{0} باشلاندى",
+ "ScheduledTaskFailedWithName": "{0} مەغلۇپ بولدى",
+ "ProviderValue": "تەمىنلىگۈچى: {0}",
+ "PluginUpdatedWithName": "{0} يېڭىلاندى",
+ "PluginUninstalledWithName": "{0} ئۆچۈرۈلدى",
+ "PluginInstalledWithName": "{0} قاچىلاندى",
+ "Plugin": "قىستۇرما",
+ "Playlists": "قويۇش تىزىملىكى",
+ "Photos": "رەسىملەر",
+ "NotificationOptionVideoPlaybackStopped": "سىن قويۇلۇش توختىدى",
+ "NotificationOptionVideoPlayback": "سىن قويۇلدى",
+ "NotificationOptionUserLockedOut": "ئابونت قۇلۇپلاندى",
+ "NotificationOptionTaskFailed": "بەلگىلەنگەن ۋەزىپە مەغلۇپ بولدى",
+ "NotificationOptionServerRestartRequired": "مۇلازىمىتېر قايتا قوزغىتىلىشى كېرەك",
+ "NotificationOptionPluginUpdateInstalled": "قىستۇرما يېڭىلانمىسى قاچىلاندى",
+ "NotificationOptionPluginInstalled": "قىستۇرما قاچىلاندى",
+ "NotificationOptionPluginUninstalled": "قىستۇرما ئۆچۈرۈلدى",
+ "NotificationOptionPluginError": "قىستۇرما خاتالىقى",
+ "NotificationOptionNewLibraryContent": "يېڭى مەزمۇن قوشۇلدى",
+ "NotificationOptionInstallationFailed": "قاچىلاش مەغلۇب بولدى",
+ "NotificationOptionCameraImageUploaded": "كامىكامېرا سۈرىتى يوللاندى",
+ "NotificationOptionAudioPlayback": "ئاۋاز قويۇش باشلاندى",
+ "NotificationOptionAudioPlaybackStopped": "ئاۋاز قويۇش توختىدى",
+ "NotificationOptionApplicationUpdateInstalled": "ئەپ يېڭىلانمىسى ئورنىتىلدى",
+ "NotificationOptionApplicationUpdateAvailable": "ئەپنىڭ نەشرىنى يېڭىلىغىلى بولۇدۇ",
+ "NewVersionIsAvailable": "Jellyfin Server نىڭ يېڭى نۇسخىسىنى چۈشۈرگىلى بولىدۇ.",
+ "NameSeasonUnknown": "نامەمۇم بۆلۈم",
+ "NameSeasonNumber": "{0}-بۆلۈم",
+ "NameInstallFailed": "{0} قاچىلاش مەغلۇپ بولدى",
+ "MusicVideos": "سىنلىق مۇزىكا",
+ "Music": "مۇزىكا",
+ "Movies": "فىلىملەر",
+ "MixedContent": "ئارىلاشما مەزمۇن",
+ "MessageNamedServerConfigurationUpdatedWithValue": "مۇلازىمىتېر تەڭشىكىنىڭ {0} قىسمى يېڭىلىنىپ بولدى",
+ "MessageServerConfigurationUpdated": "مۇلازىمىتېر يېڭىلىنىپ بولدى",
+ "MessageApplicationUpdated": "Jellyfin مۇلازىمىتېرى يېڭىلاندى",
+ "MessageApplicationUpdatedTo": "Jellyfin مۇلازىمىتېر نەشرى {0} گە يېڭىلاندى",
+ "Latest": "ئەڭ يېڭى",
+ "LabelIpAddressValue": "{0}: IP ئادرىسى",
+ "ItemRemovedWithName": "{0} ئامباردىن چىقىرىلدى",
+ "ItemAddedWithName": "{0} ئامبارغا قوشۇلدى",
+ "Inherit": "داۋاملاشتۇرۇش",
+ "HomeVideos": "ئائىلە سىنلىرى",
+ "HeaderNextUp": "كېيىنكىسى",
+ "HeaderFavoriteSongs": "ئەڭ ياقتۇرىدىغان ناخشىلار",
+ "HeaderFavoriteShows": "ئەڭ ياقتۇرىدىغان پروگراممىلار",
+ "HeaderFavoriteEpisodes": "ئەڭ ياقتۇرىدىغان تىياتېرلار",
+ "HeaderFavoriteArtists": "ئەڭ ياقتۇرىدىغان سەنئەتكارلار",
+ "HeaderFavoriteAlbums": "ياقتۇرىدىغان پىلاستىنكىلار",
+ "HeaderContinueWatching": "داۋاملىق كۆرۈش",
+ "HeaderAlbumArtists": "پىلاستىنكا سەنئەتكارلىرى",
+ "Genres": "ئۇسلۇبلار",
+ "FailedLoginAttemptWithUserName": "{0} كىرىش ئوڭۇشلۇق بولمىدى",
+ "External": "سىرتقى"
}
From 5dc30c6a6d8af9a758fd730c9da69c13847c21c3 Mon Sep 17 00:00:00 2001
From: cvium
Date: Thu, 6 Oct 2022 13:57:47 +0200
Subject: [PATCH 141/262] fix: use HttpContext and ClaimsPrincipal instead of
IAuthorizationContext
---
.../ApplicationHost.cs | 2 -
.../HttpServer/Security/SessionContext.cs | 59 -------------
.../Session/SessionWebSocketListener.cs | 16 ++--
Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | 9 +-
.../SyncPlayAccessHandler.cs | 9 +-
Jellyfin.Api/Controllers/ArtistsController.cs | 6 +-
.../Controllers/ClientLogController.cs | 7 +-
.../Controllers/CollectionController.cs | 11 +--
.../Controllers/DynamicHlsController.cs | 14 +--
Jellyfin.Api/Controllers/GenresController.cs | 4 +-
Jellyfin.Api/Controllers/ImageController.cs | 19 ++--
.../Controllers/InstantMixController.cs | 14 +--
Jellyfin.Api/Controllers/ItemsController.cs | 20 ++---
Jellyfin.Api/Controllers/LibraryController.cs | 37 +++-----
Jellyfin.Api/Controllers/LiveTvController.cs | 37 +++++---
.../Controllers/MediaInfoController.cs | 16 ++--
Jellyfin.Api/Controllers/MoviesController.cs | 2 +-
.../Controllers/MusicGenresController.cs | 4 +-
Jellyfin.Api/Controllers/PersonsController.cs | 4 +-
.../Controllers/PlaylistsController.cs | 2 +-
.../Controllers/PlaystateController.cs | 28 +++---
.../Controllers/QuickConnectController.cs | 7 +-
Jellyfin.Api/Controllers/SessionController.cs | 33 +++----
Jellyfin.Api/Controllers/StudiosController.cs | 4 +-
.../Controllers/SubtitleController.cs | 8 +-
.../Controllers/SuggestionsController.cs | 2 +-
.../Controllers/SyncPlayController.cs | 54 ++++++------
Jellyfin.Api/Controllers/TvShowsController.cs | 8 +-
.../Controllers/UniversalAudioController.cs | 14 +--
Jellyfin.Api/Controllers/UserController.cs | 23 ++---
.../Controllers/UserLibraryController.cs | 12 +--
.../Controllers/UserViewsController.cs | 2 +-
Jellyfin.Api/Controllers/VideosController.cs | 9 +-
Jellyfin.Api/Controllers/YearsController.cs | 4 +-
.../Extensions/ClaimsPrincipalExtensions.cs | 81 +++++++++++++++++
Jellyfin.Api/Extensions/DtoExtensions.cs | 8 +-
Jellyfin.Api/Helpers/AudioHelper.cs | 8 +-
Jellyfin.Api/Helpers/ClaimHelpers.cs | 88 -------------------
Jellyfin.Api/Helpers/DynamicHlsHelper.cs | 11 +--
Jellyfin.Api/Helpers/MediaInfoHelper.cs | 33 +++----
Jellyfin.Api/Helpers/RequestHelpers.cs | 48 +++++-----
Jellyfin.Api/Helpers/StreamingHelpers.cs | 15 ++--
Jellyfin.Api/Helpers/TranscodingJobHelper.cs | 17 ++--
.../Net/ISessionContext.cs | 20 -----
44 files changed, 334 insertions(+), 495 deletions(-)
delete mode 100644 Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
create mode 100644 Jellyfin.Api/Extensions/ClaimsPrincipalExtensions.cs
delete mode 100644 Jellyfin.Api/Helpers/ClaimHelpers.cs
delete mode 100644 MediaBrowser.Controller/Net/ISessionContext.cs
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 91a16c199d..9a9de1059e 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -630,8 +630,6 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton();
- serviceCollection.AddScoped();
-
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
diff --git a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs b/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
deleted file mode 100644
index e0d20e2100..0000000000
--- a/Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-#pragma warning disable CS1591
-
-using System.Threading.Tasks;
-using Jellyfin.Data.Entities;
-using MediaBrowser.Common.Extensions;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
-using MediaBrowser.Controller.Session;
-using Microsoft.AspNetCore.Http;
-
-namespace Emby.Server.Implementations.HttpServer.Security
-{
- public class SessionContext : ISessionContext
- {
- private readonly IUserManager _userManager;
- private readonly ISessionManager _sessionManager;
- private readonly IAuthorizationContext _authContext;
-
- public SessionContext(IUserManager userManager, IAuthorizationContext authContext, ISessionManager sessionManager)
- {
- _userManager = userManager;
- _authContext = authContext;
- _sessionManager = sessionManager;
- }
-
- public async Task GetSession(HttpContext requestContext)
- {
- var authorization = await _authContext.GetAuthorizationInfo(requestContext).ConfigureAwait(false);
-
- var user = authorization.User;
- return await _sessionManager.LogSessionActivity(
- authorization.Client,
- authorization.Version,
- authorization.DeviceId,
- authorization.Device,
- requestContext.GetNormalizedRemoteIp().ToString(),
- user).ConfigureAwait(false);
- }
-
- public Task GetSession(object requestContext)
- {
- return GetSession((HttpContext)requestContext);
- }
-
- public async Task GetUser(HttpContext requestContext)
- {
- var session = await GetSession(requestContext).ConfigureAwait(false);
-
- return session.UserId.Equals(default)
- ? null
- : _userManager.GetUserById(session.UserId);
- }
-
- public Task GetUser(object requestContext)
- {
- return GetUser(((HttpRequest)requestContext).HttpContext);
- }
- }
-}
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
index 35fd5caae7..c654828b1e 100644
--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -6,6 +6,7 @@ using System.Linq;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
+using Jellyfin.Api.Extensions;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Net;
@@ -53,7 +54,6 @@ namespace Emby.Server.Implementations.Session
private readonly ISessionManager _sessionManager;
private readonly ILogger _logger;
private readonly ILoggerFactory _loggerFactory;
- private readonly IAuthorizationContext _authorizationContext;
///
/// The KeepAlive cancellation token.
@@ -66,17 +66,14 @@ namespace Emby.Server.Implementations.Session
/// The logger.
/// The session manager.
/// The logger factory.
- /// The authorization context.
public SessionWebSocketListener(
ILogger logger,
ISessionManager sessionManager,
- ILoggerFactory loggerFactory,
- IAuthorizationContext authorizationContext)
+ ILoggerFactory loggerFactory)
{
_logger = logger;
_sessionManager = sessionManager;
_loggerFactory = loggerFactory;
- _authorizationContext = authorizationContext;
}
///
@@ -110,21 +107,18 @@ namespace Emby.Server.Implementations.Session
private async Task GetSession(HttpContext httpContext, string remoteEndpoint)
{
- var authorizationInfo = await _authorizationContext.GetAuthorizationInfo(httpContext)
- .ConfigureAwait(false);
-
- if (!authorizationInfo.IsAuthenticated)
+ if (!httpContext.User.Identity?.IsAuthenticated ?? false)
{
return null;
}
- var deviceId = authorizationInfo.DeviceId;
+ var deviceId = httpContext.User.GetDeviceId();
if (httpContext.Request.Query.TryGetValue("deviceId", out var queryDeviceId))
{
deviceId = queryDeviceId;
}
- return await _sessionManager.GetSessionByAuthenticationToken(authorizationInfo.Token, deviceId, remoteEndpoint)
+ return await _sessionManager.GetSessionByAuthenticationToken(httpContext.User.GetToken(), deviceId, remoteEndpoint)
.ConfigureAwait(false);
}
diff --git a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
index 13d3257dff..92ee1dd59a 100644
--- a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
+++ b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs
@@ -1,4 +1,5 @@
using System.Security.Claims;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Data.Enums;
using MediaBrowser.Common.Extensions;
@@ -51,21 +52,21 @@ namespace Jellyfin.Api.Auth
bool requiredDownloadPermission = false)
{
// ApiKey is currently global admin, always allow.
- var isApiKey = ClaimHelpers.GetIsApiKey(claimsPrincipal);
+ var isApiKey = claimsPrincipal.GetIsApiKey();
if (isApiKey)
{
return true;
}
// Ensure claim has userId.
- var userId = ClaimHelpers.GetUserId(claimsPrincipal);
- if (!userId.HasValue)
+ var userId = claimsPrincipal.GetUserId();
+ if (userId.Equals(default))
{
return false;
}
// Ensure userId links to a valid user.
- var user = _userManager.GetUserById(userId.Value);
+ var user = _userManager.GetUserById(userId);
if (user == null)
{
return false;
diff --git a/Jellyfin.Api/Auth/SyncPlayAccessPolicy/SyncPlayAccessHandler.cs b/Jellyfin.Api/Auth/SyncPlayAccessPolicy/SyncPlayAccessHandler.cs
index e6c04eb082..cdd7d8a52b 100644
--- a/Jellyfin.Api/Auth/SyncPlayAccessPolicy/SyncPlayAccessHandler.cs
+++ b/Jellyfin.Api/Auth/SyncPlayAccessPolicy/SyncPlayAccessHandler.cs
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Data.Enums;
using MediaBrowser.Common.Net;
@@ -44,14 +45,14 @@ namespace Jellyfin.Api.Auth.SyncPlayAccessPolicy
return Task.CompletedTask;
}
- var userId = ClaimHelpers.GetUserId(context.User);
- var user = _userManager.GetUserById(userId!.Value);
+ var userId = context.User.GetUserId();
+ var user = _userManager.GetUserById(userId);
if (requirement.RequiredAccess == SyncPlayAccessRequirementType.HasAccess)
{
if (user.SyncPlayAccess == SyncPlayUserAccessType.CreateAndJoinGroups
|| user.SyncPlayAccess == SyncPlayUserAccessType.JoinGroups
- || _syncPlayManager.IsUserActive(userId.Value))
+ || _syncPlayManager.IsUserActive(userId))
{
context.Succeed(requirement);
}
@@ -85,7 +86,7 @@ namespace Jellyfin.Api.Auth.SyncPlayAccessPolicy
}
else if (requirement.RequiredAccess == SyncPlayAccessRequirementType.IsInGroup)
{
- if (_syncPlayManager.IsUserActive(userId.Value))
+ if (_syncPlayManager.IsUserActive(userId))
{
context.Succeed(requirement);
}
diff --git a/Jellyfin.Api/Controllers/ArtistsController.cs b/Jellyfin.Api/Controllers/ArtistsController.cs
index 44796bcc4c..c059cb198a 100644
--- a/Jellyfin.Api/Controllers/ArtistsController.cs
+++ b/Jellyfin.Api/Controllers/ArtistsController.cs
@@ -120,7 +120,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
User? user = null;
@@ -323,7 +323,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
User? user = null;
@@ -463,7 +463,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult GetArtistByName([FromRoute, Required] string name, [FromQuery] Guid? userId)
{
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var item = _libraryManager.GetArtist(name, dtoOptions);
diff --git a/Jellyfin.Api/Controllers/ClientLogController.cs b/Jellyfin.Api/Controllers/ClientLogController.cs
index 98fd224307..ed073a687e 100644
--- a/Jellyfin.Api/Controllers/ClientLogController.cs
+++ b/Jellyfin.Api/Controllers/ClientLogController.cs
@@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.Models.ClientLogDtos;
using MediaBrowser.Controller.ClientEvent;
@@ -69,10 +70,10 @@ namespace Jellyfin.Api.Controllers
private (string ClientName, string ClientVersion) GetRequestInformation()
{
- var clientName = ClaimHelpers.GetClient(HttpContext.User) ?? "unknown-client";
- var clientVersion = ClaimHelpers.GetIsApiKey(HttpContext.User)
+ var clientName = HttpContext.User.GetClient() ?? "unknown-client";
+ var clientVersion = HttpContext.User.GetIsApiKey()
? "apikey"
- : ClaimHelpers.GetVersion(HttpContext.User) ?? "unknown-version";
+ : HttpContext.User.GetVersion() ?? "unknown-version";
return (clientName, clientVersion);
}
diff --git a/Jellyfin.Api/Controllers/CollectionController.cs b/Jellyfin.Api/Controllers/CollectionController.cs
index 8a98d856c4..effc9ed7aa 100644
--- a/Jellyfin.Api/Controllers/CollectionController.cs
+++ b/Jellyfin.Api/Controllers/CollectionController.cs
@@ -6,7 +6,6 @@ using Jellyfin.Api.Extensions;
using Jellyfin.Api.ModelBinders;
using MediaBrowser.Controller.Collections;
using MediaBrowser.Controller.Dto;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Collections;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
@@ -23,22 +22,18 @@ namespace Jellyfin.Api.Controllers
{
private readonly ICollectionManager _collectionManager;
private readonly IDtoService _dtoService;
- private readonly IAuthorizationContext _authContext;
///
/// Initializes a new instance of the class.
///
/// Instance of interface.
/// Instance of interface.
- /// Instance of interface.
public CollectionController(
ICollectionManager collectionManager,
- IDtoService dtoService,
- IAuthorizationContext authContext)
+ IDtoService dtoService)
{
_collectionManager = collectionManager;
_dtoService = dtoService;
- _authContext = authContext;
}
///
@@ -58,7 +53,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] Guid? parentId,
[FromQuery] bool isLocked = false)
{
- var userId = (await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false)).UserId;
+ var userId = User.GetUserId();
var item = await _collectionManager.CreateCollectionAsync(new CollectionCreationOptions
{
@@ -69,7 +64,7 @@ namespace Jellyfin.Api.Controllers
UserIds = new[] { userId }
}).ConfigureAwait(false);
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var dto = _dtoService.GetBaseItemDto(item, dtoOptions);
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 3ed80f6621..0f4d3c1ebc 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -20,7 +20,6 @@ using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.IO;
@@ -46,7 +45,6 @@ namespace Jellyfin.Api.Controllers
private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager;
private readonly IDlnaManager _dlnaManager;
- private readonly IAuthorizationContext _authContext;
private readonly IMediaSourceManager _mediaSourceManager;
private readonly IServerConfigurationManager _serverConfigurationManager;
private readonly IMediaEncoder _mediaEncoder;
@@ -65,7 +63,6 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
@@ -80,7 +77,6 @@ namespace Jellyfin.Api.Controllers
ILibraryManager libraryManager,
IUserManager userManager,
IDlnaManager dlnaManager,
- IAuthorizationContext authContext,
IMediaSourceManager mediaSourceManager,
IServerConfigurationManager serverConfigurationManager,
IMediaEncoder mediaEncoder,
@@ -95,7 +91,6 @@ namespace Jellyfin.Api.Controllers
_libraryManager = libraryManager;
_userManager = userManager;
_dlnaManager = dlnaManager;
- _authContext = authContext;
_mediaSourceManager = mediaSourceManager;
_serverConfigurationManager = serverConfigurationManager;
_mediaEncoder = mediaEncoder;
@@ -287,8 +282,7 @@ namespace Jellyfin.Api.Controllers
var cancellationToken = cancellationTokenSource.Token;
var state = await StreamingHelpers.GetStreamingState(
streamingRequest,
- Request,
- _authContext,
+ HttpContext,
_mediaSourceManager,
_userManager,
_libraryManager,
@@ -1393,8 +1387,7 @@ namespace Jellyfin.Api.Controllers
{
using var state = await StreamingHelpers.GetStreamingState(
streamingRequest,
- Request,
- _authContext,
+ HttpContext,
_mediaSourceManager,
_userManager,
_libraryManager,
@@ -1434,8 +1427,7 @@ namespace Jellyfin.Api.Controllers
var state = await StreamingHelpers.GetStreamingState(
streamingRequest,
- Request,
- _authContext,
+ HttpContext,
_mediaSourceManager,
_userManager,
_libraryManager,
diff --git a/Jellyfin.Api/Controllers/GenresController.cs b/Jellyfin.Api/Controllers/GenresController.cs
index e28a50750a..611643bd8a 100644
--- a/Jellyfin.Api/Controllers/GenresController.cs
+++ b/Jellyfin.Api/Controllers/GenresController.cs
@@ -92,7 +92,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, false, imageTypeLimit, enableImageTypes);
User? user = userId is null || userId.Value.Equals(default)
@@ -157,7 +157,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult GetGenre([FromRoute, Required] string genreName, [FromQuery] Guid? userId)
{
var dtoOptions = new DtoOptions()
- .AddClientFields(Request);
+ .AddClientFields(User);
Genre? item;
if (genreName.Contains(BaseItem.SlugChar, StringComparison.OrdinalIgnoreCase))
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs
index 6c7842c7b9..f092bd8820 100644
--- a/Jellyfin.Api/Controllers/ImageController.cs
+++ b/Jellyfin.Api/Controllers/ImageController.cs
@@ -17,7 +17,6 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Branding;
using MediaBrowser.Model.Drawing;
@@ -44,11 +43,9 @@ namespace Jellyfin.Api.Controllers
private readonly IProviderManager _providerManager;
private readonly IImageProcessor _imageProcessor;
private readonly IFileSystem _fileSystem;
- private readonly IAuthorizationContext _authContext;
private readonly ILogger _logger;
private readonly IServerConfigurationManager _serverConfigurationManager;
private readonly IApplicationPaths _appPaths;
- private readonly IImageEncoder _imageEncoder;
///
/// Initializes a new instance of the class.
@@ -58,33 +55,27 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
public ImageController(
IUserManager userManager,
ILibraryManager libraryManager,
IProviderManager providerManager,
IImageProcessor imageProcessor,
IFileSystem fileSystem,
- IAuthorizationContext authContext,
ILogger logger,
IServerConfigurationManager serverConfigurationManager,
- IApplicationPaths appPaths,
- IImageEncoder imageEncoder)
+ IApplicationPaths appPaths)
{
_userManager = userManager;
_libraryManager = libraryManager;
_providerManager = providerManager;
_imageProcessor = imageProcessor;
_fileSystem = fileSystem;
- _authContext = authContext;
_logger = logger;
_serverConfigurationManager = serverConfigurationManager;
_appPaths = appPaths;
- _imageEncoder = imageEncoder;
}
///
@@ -108,7 +99,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] ImageType imageType,
[FromQuery] int? index = null)
{
- if (!await RequestHelpers.AssertCanUpdateUser(_authContext, HttpContext.Request, userId, true).ConfigureAwait(false))
+ if (!RequestHelpers.AssertCanUpdateUser(_userManager, HttpContext.User, userId, true))
{
return StatusCode(StatusCodes.Status403Forbidden, "User is not allowed to update the image.");
}
@@ -155,7 +146,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] ImageType imageType,
[FromRoute] int index)
{
- if (!await RequestHelpers.AssertCanUpdateUser(_authContext, HttpContext.Request, userId, true).ConfigureAwait(false))
+ if (!RequestHelpers.AssertCanUpdateUser(_userManager, HttpContext.User, userId, true))
{
return StatusCode(StatusCodes.Status403Forbidden, "User is not allowed to update the image.");
}
@@ -201,7 +192,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] ImageType imageType,
[FromQuery] int? index = null)
{
- if (!await RequestHelpers.AssertCanUpdateUser(_authContext, HttpContext.Request, userId, true).ConfigureAwait(false))
+ if (!RequestHelpers.AssertCanUpdateUser(_userManager, HttpContext.User, userId, true))
{
return StatusCode(StatusCodes.Status403Forbidden, "User is not allowed to delete the image.");
}
@@ -245,7 +236,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] ImageType imageType,
[FromRoute] int index)
{
- if (!await RequestHelpers.AssertCanUpdateUser(_authContext, HttpContext.Request, userId, true).ConfigureAwait(false))
+ if (!RequestHelpers.AssertCanUpdateUser(_userManager, HttpContext.User, userId, true))
{
return StatusCode(StatusCodes.Status403Forbidden, "User is not allowed to delete the image.");
}
diff --git a/Jellyfin.Api/Controllers/InstantMixController.cs b/Jellyfin.Api/Controllers/InstantMixController.cs
index 9abea5938f..2e0d3cb99e 100644
--- a/Jellyfin.Api/Controllers/InstantMixController.cs
+++ b/Jellyfin.Api/Controllers/InstantMixController.cs
@@ -79,7 +79,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
@@ -115,7 +115,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromItem(album, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
@@ -151,7 +151,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromItem(playlist, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
@@ -186,7 +186,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromGenres(new[] { name }, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
@@ -222,7 +222,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
@@ -258,7 +258,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
@@ -331,7 +331,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
return GetResult(items, user, limit, dtoOptions);
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 4d09070dbb..3c7c375d4e 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -10,7 +10,6 @@ using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
@@ -34,7 +33,6 @@ namespace Jellyfin.Api.Controllers
private readonly ILibraryManager _libraryManager;
private readonly ILocalizationManager _localization;
private readonly IDtoService _dtoService;
- private readonly IAuthorizationContext _authContext;
private readonly ILogger _logger;
private readonly ISessionManager _sessionManager;
@@ -45,7 +43,6 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
public ItemsController(
@@ -53,7 +50,6 @@ namespace Jellyfin.Api.Controllers
ILibraryManager libraryManager,
ILocalizationManager localization,
IDtoService dtoService,
- IAuthorizationContext authContext,
ILogger logger,
ISessionManager sessionManager)
{
@@ -61,7 +57,6 @@ namespace Jellyfin.Api.Controllers
_libraryManager = libraryManager;
_localization = localization;
_dtoService = dtoService;
- _authContext = authContext;
_logger = logger;
_sessionManager = sessionManager;
}
@@ -244,21 +239,20 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true,
[FromQuery] bool? enableImages = true)
{
- var auth = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
-
+ var isApiKey = User.GetIsApiKey();
// if api key is used (auth.IsApiKey == true), then `user` will be null throughout this method
- var user = !auth.IsApiKey && userId.HasValue && !userId.Value.Equals(default)
+ var user = !isApiKey && userId.HasValue && !userId.Value.Equals(default)
? _userManager.GetUserById(userId.Value)
: null;
// beyond this point, we're either using an api key or we have a valid user
- if (!auth.IsApiKey && user is null)
+ if (!isApiKey && user is null)
{
return BadRequest("userId is required");
}
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
if (includeItemTypes.Length == 1
@@ -288,12 +282,12 @@ namespace Jellyfin.Api.Controllers
includeItemTypes = new[] { BaseItemKind.Playlist };
}
- var enabledChannels = auth.IsApiKey
+ var enabledChannels = isApiKey
? Array.Empty()
: user!.GetPreferenceValues(PreferenceKind.EnabledChannels);
// api keys are always enabled for all folders
- bool isInEnabledFolder = auth.IsApiKey
+ bool isInEnabledFolder = isApiKey
|| Array.IndexOf(user!.GetPreferenceValues(PreferenceKind.EnabledFolders), item.Id) != -1
// Assume all folders inside an EnabledChannel are enabled
|| Array.IndexOf(enabledChannels, item.Id) != -1
@@ -850,7 +844,7 @@ namespace Jellyfin.Api.Controllers
var user = _userManager.GetUserById(userId);
var parentIdGuid = parentId ?? Guid.Empty;
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var ancestorIds = Array.Empty();
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index 4cc17dd0fc..e9492a6a47 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -24,7 +24,6 @@ using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Configuration;
@@ -50,7 +49,6 @@ namespace Jellyfin.Api.Controllers
private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager;
private readonly IDtoService _dtoService;
- private readonly IAuthorizationContext _authContext;
private readonly IActivityManager _activityManager;
private readonly ILocalizationManager _localization;
private readonly ILibraryMonitor _libraryMonitor;
@@ -64,7 +62,6 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
@@ -75,7 +72,6 @@ namespace Jellyfin.Api.Controllers
ILibraryManager libraryManager,
IUserManager userManager,
IDtoService dtoService,
- IAuthorizationContext authContext,
IActivityManager activityManager,
ILocalizationManager localization,
ILibraryMonitor libraryMonitor,
@@ -86,7 +82,6 @@ namespace Jellyfin.Api.Controllers
_libraryManager = libraryManager;
_userManager = userManager;
_dtoService = dtoService;
- _authContext = authContext;
_activityManager = activityManager;
_localization = localization;
_libraryMonitor = libraryMonitor;
@@ -184,7 +179,7 @@ namespace Jellyfin.Api.Controllers
item = parent;
}
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var items = themeItems
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item))
.ToArray();
@@ -250,7 +245,7 @@ namespace Jellyfin.Api.Controllers
item = parent;
}
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var items = themeItems
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item))
.ToArray();
@@ -331,11 +326,10 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
- public async Task DeleteItem(Guid itemId)
+ public ActionResult DeleteItem(Guid itemId)
{
var item = _libraryManager.GetItemById(itemId);
- var auth = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
- var user = auth.User;
+ var user = _userManager.GetUserById(User.GetUserId());
if (!item.CanDelete(user))
{
@@ -361,7 +355,7 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
- public async Task DeleteItems([FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] ids)
+ public ActionResult DeleteItems([FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] ids)
{
if (ids.Length == 0)
{
@@ -371,8 +365,7 @@ namespace Jellyfin.Api.Controllers
foreach (var i in ids)
{
var item = _libraryManager.GetItemById(i);
- var auth = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
- var user = auth.User;
+ var user = _userManager.GetUserById(User.GetUserId());
if (!item.CanDelete(user))
{
@@ -453,7 +446,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
BaseItem? parent = item.GetParent();
while (parent != null)
@@ -505,7 +498,7 @@ namespace Jellyfin.Api.Controllers
items = items.Where(i => i.IsHidden == val).ToList();
}
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var resultArray = _dtoService.GetBaseItemDtos(items, dtoOptions);
return new QueryResult(resultArray);
}
@@ -622,9 +615,7 @@ namespace Jellyfin.Api.Controllers
return NotFound();
}
- var auth = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
-
- var user = auth.User;
+ var user = _userManager.GetUserById(User.GetUserId());
if (user != null)
{
@@ -643,7 +634,7 @@ namespace Jellyfin.Api.Controllers
if (user != null)
{
- await LogDownloadAsync(item, user, auth).ConfigureAwait(false);
+ await LogDownloadAsync(item, user).ConfigureAwait(false);
}
var path = item.Path;
@@ -704,7 +695,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request);
+ .AddClientFields(User);
var program = item as IHasProgramAttributes;
bool? isMovie = item is Movie || (program != null && program.IsMovie) || item is Trailer;
@@ -892,16 +883,16 @@ namespace Jellyfin.Api.Controllers
: item;
}
- private async Task LogDownloadAsync(BaseItem item, User user, AuthorizationInfo auth)
+ private async Task LogDownloadAsync(BaseItem item, User user)
{
try
{
await _activityManager.CreateAsync(new ActivityLog(
string.Format(CultureInfo.InvariantCulture, _localization.GetLocalizedString("UserDownloadingItemWithValues"), user.Username, item.Name),
"UserDownloadingContent",
- auth.UserId)
+ User.GetUserId())
{
- ShortOverview = string.Format(CultureInfo.InvariantCulture, _localization.GetLocalizedString("AppDeviceValues"), auth.Client, auth.Device),
+ ShortOverview = string.Format(CultureInfo.InvariantCulture, _localization.GetLocalizedString("AppDeviceValues"), User.GetClient(), User.GetDevice()),
}).ConfigureAwait(false);
}
catch
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs
index 05340099bf..394df0f58b 100644
--- a/Jellyfin.Api/Controllers/LiveTvController.cs
+++ b/Jellyfin.Api/Controllers/LiveTvController.cs
@@ -17,6 +17,7 @@ using Jellyfin.Api.ModelBinders;
using Jellyfin.Api.Models.LiveTvDtos;
using Jellyfin.Data.Enums;
using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
@@ -24,6 +25,7 @@ using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Net;
+using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
@@ -45,10 +47,10 @@ namespace Jellyfin.Api.Controllers
private readonly IHttpClientFactory _httpClientFactory;
private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService;
- private readonly ISessionContext _sessionContext;
private readonly IMediaSourceManager _mediaSourceManager;
private readonly IConfigurationManager _configurationManager;
private readonly TranscodingJobHelper _transcodingJobHelper;
+ private readonly ISessionManager _sessionManager;
///
/// Initializes a new instance of the class.
@@ -58,30 +60,30 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the class.
+ /// Instance of the interface.
public LiveTvController(
ILiveTvManager liveTvManager,
IUserManager userManager,
IHttpClientFactory httpClientFactory,
ILibraryManager libraryManager,
IDtoService dtoService,
- ISessionContext sessionContext,
IMediaSourceManager mediaSourceManager,
IConfigurationManager configurationManager,
- TranscodingJobHelper transcodingJobHelper)
+ TranscodingJobHelper transcodingJobHelper,
+ ISessionManager sessionManager)
{
_liveTvManager = liveTvManager;
_userManager = userManager;
_httpClientFactory = httpClientFactory;
_libraryManager = libraryManager;
_dtoService = dtoService;
- _sessionContext = sessionContext;
_mediaSourceManager = mediaSourceManager;
_configurationManager = configurationManager;
_transcodingJobHelper = transcodingJobHelper;
+ _sessionManager = sessionManager;
}
///
@@ -154,7 +156,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool addCurrentProgram = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var channelResult = _liveTvManager.GetInternalChannels(
@@ -219,7 +221,7 @@ namespace Jellyfin.Api.Controllers
: _libraryManager.GetItemById(channelId);
var dtoOptions = new DtoOptions()
- .AddClientFields(Request);
+ .AddClientFields(User);
return _dtoService.GetBaseItemDto(item, dtoOptions, user);
}
@@ -272,7 +274,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
return _liveTvManager.GetRecordings(
@@ -410,7 +412,7 @@ namespace Jellyfin.Api.Controllers
var item = recordingId.Equals(default) ? _libraryManager.GetUserRootFolder() : _libraryManager.GetItemById(recordingId);
var dtoOptions = new DtoOptions()
- .AddClientFields(Request);
+ .AddClientFields(User);
return _dtoService.GetBaseItemDto(item, dtoOptions, user);
}
@@ -599,7 +601,7 @@ namespace Jellyfin.Api.Controllers
}
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
return await _liveTvManager.GetPrograms(query, dtoOptions, CancellationToken.None).ConfigureAwait(false);
}
@@ -653,7 +655,7 @@ namespace Jellyfin.Api.Controllers
}
var dtoOptions = new DtoOptions { Fields = body.Fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(body.EnableImages, body.EnableUserData, body.ImageTypeLimit, body.EnableImageTypes);
return await _liveTvManager.GetPrograms(query, dtoOptions, CancellationToken.None).ConfigureAwait(false);
}
@@ -719,7 +721,7 @@ namespace Jellyfin.Api.Controllers
};
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
return await _liveTvManager.GetRecommendedProgramsAsync(query, dtoOptions, CancellationToken.None).ConfigureAwait(false);
}
@@ -1210,9 +1212,16 @@ namespace Jellyfin.Api.Controllers
private async Task AssertUserCanManageLiveTv()
{
- var user = await _sessionContext.GetUser(Request).ConfigureAwait(false);
+ var user = _userManager.GetUserById(User.GetUserId());
+ var session = await _sessionManager.LogSessionActivity(
+ User.GetClient(),
+ User.GetVersion(),
+ User.GetDeviceId(),
+ User.GetDevice(),
+ HttpContext.GetNormalizedRemoteIp().ToString(),
+ user).ConfigureAwait(false);
- if (user == null)
+ if (session.UserId.Equals(default))
{
throw new SecurityException("Anonymous live tv management is not allowed.");
}
diff --git a/Jellyfin.Api/Controllers/MediaInfoController.cs b/Jellyfin.Api/Controllers/MediaInfoController.cs
index d2852ed011..c111e92186 100644
--- a/Jellyfin.Api/Controllers/MediaInfoController.cs
+++ b/Jellyfin.Api/Controllers/MediaInfoController.cs
@@ -6,12 +6,12 @@ using System.Net.Mime;
using System.Threading.Tasks;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.Models.MediaInfoDtos;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Model.MediaInfo;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
@@ -31,7 +31,6 @@ namespace Jellyfin.Api.Controllers
private readonly IMediaSourceManager _mediaSourceManager;
private readonly IDeviceManager _deviceManager;
private readonly ILibraryManager _libraryManager;
- private readonly IAuthorizationContext _authContext;
private readonly ILogger _logger;
private readonly MediaInfoHelper _mediaInfoHelper;
@@ -41,21 +40,18 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Instance of the .
public MediaInfoController(
IMediaSourceManager mediaSourceManager,
IDeviceManager deviceManager,
ILibraryManager libraryManager,
- IAuthorizationContext authContext,
ILogger logger,
MediaInfoHelper mediaInfoHelper)
{
_mediaSourceManager = mediaSourceManager;
_deviceManager = deviceManager;
_libraryManager = libraryManager;
- _authContext = authContext;
_logger = logger;
_mediaInfoHelper = mediaInfoHelper;
}
@@ -122,14 +118,12 @@ namespace Jellyfin.Api.Controllers
[FromQuery, ParameterObsolete] bool? allowAudioStreamCopy,
[FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow)] PlaybackInfoDto? playbackInfoDto)
{
- var authInfo = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
-
var profile = playbackInfoDto?.DeviceProfile;
_logger.LogDebug("GetPostedPlaybackInfo profile: {@Profile}", profile);
if (profile == null)
{
- var caps = _deviceManager.GetCapabilities(authInfo.DeviceId);
+ var caps = _deviceManager.GetCapabilities(User.GetDeviceId());
if (caps != null)
{
profile = caps.DeviceProfile;
@@ -176,7 +170,7 @@ namespace Jellyfin.Api.Controllers
item,
mediaSource,
profile,
- authInfo,
+ User,
maxStreamingBitrate ?? profile.MaxStreamingBitrate,
startTimeTicks ?? 0,
mediaSourceId ?? string.Empty,
@@ -203,7 +197,7 @@ namespace Jellyfin.Api.Controllers
if (mediaSource != null && mediaSource.RequiresOpening && string.IsNullOrWhiteSpace(mediaSource.LiveStreamId))
{
var openStreamResult = await _mediaInfoHelper.OpenMediaSource(
- Request,
+ HttpContext,
new LiveStreamRequest
{
AudioStreamIndex = audioStreamIndex,
@@ -276,7 +270,7 @@ namespace Jellyfin.Api.Controllers
EnableDirectStream = enableDirectStream ?? openLiveStreamDto?.EnableDirectStream ?? true,
DirectPlayProtocols = openLiveStreamDto?.DirectPlayProtocols ?? new[] { MediaProtocol.Http }
};
- return await _mediaInfoHelper.OpenMediaSource(Request, request).ConfigureAwait(false);
+ return await _mediaInfoHelper.OpenMediaSource(HttpContext, request).ConfigureAwait(false);
}
///
diff --git a/Jellyfin.Api/Controllers/MoviesController.cs b/Jellyfin.Api/Controllers/MoviesController.cs
index 4669447049..8195fc7609 100644
--- a/Jellyfin.Api/Controllers/MoviesController.cs
+++ b/Jellyfin.Api/Controllers/MoviesController.cs
@@ -72,7 +72,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId.Value);
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request);
+ .AddClientFields(User);
var categories = new List();
diff --git a/Jellyfin.Api/Controllers/MusicGenresController.cs b/Jellyfin.Api/Controllers/MusicGenresController.cs
index 0499b29857..f4fb5f44ab 100644
--- a/Jellyfin.Api/Controllers/MusicGenresController.cs
+++ b/Jellyfin.Api/Controllers/MusicGenresController.cs
@@ -92,7 +92,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, false, imageTypeLimit, enableImageTypes);
User? user = userId is null || userId.Value.Equals(default)
@@ -145,7 +145,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult GetMusicGenre([FromRoute, Required] string genreName, [FromQuery] Guid? userId)
{
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
MusicGenre? item;
diff --git a/Jellyfin.Api/Controllers/PersonsController.cs b/Jellyfin.Api/Controllers/PersonsController.cs
index 33f1aea394..42be969b29 100644
--- a/Jellyfin.Api/Controllers/PersonsController.cs
+++ b/Jellyfin.Api/Controllers/PersonsController.cs
@@ -79,7 +79,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool? enableImages = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
User? user = userId is null || userId.Value.Equals(default)
@@ -119,7 +119,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult GetPerson([FromRoute, Required] string name, [FromQuery] Guid? userId)
{
var dtoOptions = new DtoOptions()
- .AddClientFields(Request);
+ .AddClientFields(User);
var item = _libraryManager.GetPerson(name);
if (item == null)
diff --git a/Jellyfin.Api/Controllers/PlaylistsController.cs b/Jellyfin.Api/Controllers/PlaylistsController.cs
index ad85f2fb24..fb045f891e 100644
--- a/Jellyfin.Api/Controllers/PlaylistsController.cs
+++ b/Jellyfin.Api/Controllers/PlaylistsController.cs
@@ -200,7 +200,7 @@ namespace Jellyfin.Api.Controllers
}
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
var dtos = _dtoService.GetBaseItemDtos(items.Select(i => i.Item2).ToList(), dtoOptions, user);
diff --git a/Jellyfin.Api/Controllers/PlaystateController.cs b/Jellyfin.Api/Controllers/PlaystateController.cs
index 6dee1c2192..0dd4bf8035 100644
--- a/Jellyfin.Api/Controllers/PlaystateController.cs
+++ b/Jellyfin.Api/Controllers/PlaystateController.cs
@@ -3,11 +3,11 @@ using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Session;
@@ -29,7 +29,6 @@ namespace Jellyfin.Api.Controllers
private readonly IUserDataManager _userDataRepository;
private readonly ILibraryManager _libraryManager;
private readonly ISessionManager _sessionManager;
- private readonly IAuthorizationContext _authContext;
private readonly ILogger _logger;
private readonly TranscodingJobHelper _transcodingJobHelper;
@@ -40,7 +39,6 @@ namespace Jellyfin.Api.Controllers
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
/// Th singleton.
public PlaystateController(
@@ -48,7 +46,6 @@ namespace Jellyfin.Api.Controllers
IUserDataManager userDataRepository,
ILibraryManager libraryManager,
ISessionManager sessionManager,
- IAuthorizationContext authContext,
ILoggerFactory loggerFactory,
TranscodingJobHelper transcodingJobHelper)
{
@@ -56,7 +53,6 @@ namespace Jellyfin.Api.Controllers
_userDataRepository = userDataRepository;
_libraryManager = libraryManager;
_sessionManager = sessionManager;
- _authContext = authContext;
_logger = loggerFactory.CreateLogger();
_transcodingJobHelper = transcodingJobHelper;
@@ -78,7 +74,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery, ModelBinder(typeof(LegacyDateTimeModelBinder))] DateTime? datePlayed)
{
var user = _userManager.GetUserById(userId);
- var session = await RequestHelpers.GetSession(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ var session = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var dto = UpdatePlayedStatus(user, itemId, true, datePlayed);
foreach (var additionalUserInfo in session.AdditionalUsers)
{
@@ -101,7 +97,7 @@ namespace Jellyfin.Api.Controllers
public async Task> MarkUnplayedItem([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId)
{
var user = _userManager.GetUserById(userId);
- var session = await RequestHelpers.GetSession(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ var session = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var dto = UpdatePlayedStatus(user, itemId, false, null);
foreach (var additionalUserInfo in session.AdditionalUsers)
{
@@ -123,7 +119,7 @@ namespace Jellyfin.Api.Controllers
public async Task ReportPlaybackStart([FromBody] PlaybackStartInfo playbackStartInfo)
{
playbackStartInfo.PlayMethod = ValidatePlayMethod(playbackStartInfo.PlayMethod, playbackStartInfo.PlaySessionId);
- playbackStartInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ playbackStartInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
await _sessionManager.OnPlaybackStart(playbackStartInfo).ConfigureAwait(false);
return NoContent();
}
@@ -139,7 +135,7 @@ namespace Jellyfin.Api.Controllers
public async Task ReportPlaybackProgress([FromBody] PlaybackProgressInfo playbackProgressInfo)
{
playbackProgressInfo.PlayMethod = ValidatePlayMethod(playbackProgressInfo.PlayMethod, playbackProgressInfo.PlaySessionId);
- playbackProgressInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ playbackProgressInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
await _sessionManager.OnPlaybackProgress(playbackProgressInfo).ConfigureAwait(false);
return NoContent();
}
@@ -171,11 +167,10 @@ namespace Jellyfin.Api.Controllers
_logger.LogDebug("ReportPlaybackStopped PlaySessionId: {0}", playbackStopInfo.PlaySessionId ?? string.Empty);
if (!string.IsNullOrWhiteSpace(playbackStopInfo.PlaySessionId))
{
- var authInfo = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
- await _transcodingJobHelper.KillTranscodingJobs(authInfo.DeviceId, playbackStopInfo.PlaySessionId, s => true).ConfigureAwait(false);
+ await _transcodingJobHelper.KillTranscodingJobs(User.GetDeviceId()!, playbackStopInfo.PlaySessionId, s => true).ConfigureAwait(false);
}
- playbackStopInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ playbackStopInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
await _sessionManager.OnPlaybackStopped(playbackStopInfo).ConfigureAwait(false);
return NoContent();
}
@@ -221,7 +216,7 @@ namespace Jellyfin.Api.Controllers
};
playbackStartInfo.PlayMethod = ValidatePlayMethod(playbackStartInfo.PlayMethod, playbackStartInfo.PlaySessionId);
- playbackStartInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ playbackStartInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
await _sessionManager.OnPlaybackStart(playbackStartInfo).ConfigureAwait(false);
return NoContent();
}
@@ -279,7 +274,7 @@ namespace Jellyfin.Api.Controllers
};
playbackProgressInfo.PlayMethod = ValidatePlayMethod(playbackProgressInfo.PlayMethod, playbackProgressInfo.PlaySessionId);
- playbackProgressInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ playbackProgressInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);;
await _sessionManager.OnPlaybackProgress(playbackProgressInfo).ConfigureAwait(false);
return NoContent();
}
@@ -321,11 +316,10 @@ namespace Jellyfin.Api.Controllers
_logger.LogDebug("ReportPlaybackStopped PlaySessionId: {0}", playbackStopInfo.PlaySessionId ?? string.Empty);
if (!string.IsNullOrWhiteSpace(playbackStopInfo.PlaySessionId))
{
- var authInfo = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
- await _transcodingJobHelper.KillTranscodingJobs(authInfo.DeviceId, playbackStopInfo.PlaySessionId, s => true).ConfigureAwait(false);
+ await _transcodingJobHelper.KillTranscodingJobs(User.GetDeviceId()!, playbackStopInfo.PlaySessionId, s => true).ConfigureAwait(false);
}
- playbackStopInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ playbackStopInfo.SessionId = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);;
await _sessionManager.OnPlaybackStopped(playbackStopInfo).ConfigureAwait(false);
return NoContent();
}
diff --git a/Jellyfin.Api/Controllers/QuickConnectController.cs b/Jellyfin.Api/Controllers/QuickConnectController.cs
index 1df26355f0..77d88475ff 100644
--- a/Jellyfin.Api/Controllers/QuickConnectController.cs
+++ b/Jellyfin.Api/Controllers/QuickConnectController.cs
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Authentication;
@@ -104,15 +105,15 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public async Task> AuthorizeQuickConnect([FromQuery, Required] string code)
{
- var userId = ClaimHelpers.GetUserId(Request.HttpContext.User);
- if (!userId.HasValue)
+ var userId = User.GetUserId();
+ if (userId.Equals(default))
{
return StatusCode(StatusCodes.Status403Forbidden, "Unknown user id");
}
try
{
- return await _quickConnect.AuthorizeRequest(userId.Value, code).ConfigureAwait(false);
+ return await _quickConnect.AuthorizeRequest(userId, code).ConfigureAwait(false);
}
catch (AuthenticationException)
{
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs
index 860bccb9bd..28415555ed 100644
--- a/Jellyfin.Api/Controllers/SessionController.cs
+++ b/Jellyfin.Api/Controllers/SessionController.cs
@@ -5,13 +5,13 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Api.Models.SessionDtos;
using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Session;
@@ -29,7 +29,6 @@ namespace Jellyfin.Api.Controllers
{
private readonly ISessionManager _sessionManager;
private readonly IUserManager _userManager;
- private readonly IAuthorizationContext _authContext;
private readonly IDeviceManager _deviceManager;
///
@@ -37,17 +36,14 @@ namespace Jellyfin.Api.Controllers
///
/// Instance of interface.
/// Instance of interface.
- /// Instance of interface.
/// Instance of interface.
public SessionController(
ISessionManager sessionManager,
IUserManager userManager,
- IAuthorizationContext authContext,
IDeviceManager deviceManager)
{
_sessionManager = sessionManager;
_userManager = userManager;
- _authContext = authContext;
_deviceManager = deviceManager;
}
@@ -139,7 +135,7 @@ namespace Jellyfin.Api.Controllers
};
await _sessionManager.SendBrowseCommand(
- await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false),
+ await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false),
sessionId,
command,
CancellationToken.None)
@@ -186,7 +182,7 @@ namespace Jellyfin.Api.Controllers
};
await _sessionManager.SendPlayCommand(
- await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false),
+ await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false),
sessionId,
playRequest,
CancellationToken.None)
@@ -214,7 +210,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? controllingUserId)
{
await _sessionManager.SendPlaystateCommand(
- await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false),
+ await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false),
sessionId,
new PlaystateRequest()
{
@@ -242,14 +238,14 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string sessionId,
[FromRoute, Required] GeneralCommandType command)
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var generalCommand = new GeneralCommand
{
Name = command,
ControllingUserId = currentSession.UserId
};
- await _sessionManager.SendGeneralCommand(currentSession.Id, sessionId, generalCommand, CancellationToken.None);
+ await _sessionManager.SendGeneralCommand(currentSession.Id, sessionId, generalCommand, CancellationToken.None).ConfigureAwait(false);
return NoContent();
}
@@ -268,7 +264,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string sessionId,
[FromRoute, Required] GeneralCommandType command)
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var generalCommand = new GeneralCommand
{
@@ -296,8 +292,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string sessionId,
[FromBody, Required] GeneralCommand command)
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authContext, Request)
- .ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
if (command == null)
{
@@ -336,7 +331,7 @@ namespace Jellyfin.Api.Controllers
}
await _sessionManager.SendMessageCommand(
- await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false),
+ await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false),
sessionId,
command,
CancellationToken.None)
@@ -405,7 +400,7 @@ namespace Jellyfin.Api.Controllers
{
if (string.IsNullOrWhiteSpace(id))
{
- id = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ id = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
}
_sessionManager.ReportCapabilities(id, new ClientCapabilities
@@ -435,7 +430,7 @@ namespace Jellyfin.Api.Controllers
{
if (string.IsNullOrWhiteSpace(id))
{
- id = await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ id = await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
}
_sessionManager.ReportCapabilities(id, capabilities.ToClientCapabilities());
@@ -457,7 +452,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? sessionId,
[FromQuery, Required] string? itemId)
{
- string session = sessionId ?? await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false);
+ string session = sessionId ?? await RequestHelpers.GetSessionId(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
_sessionManager.ReportNowViewingItem(session, itemId);
return NoContent();
@@ -473,9 +468,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status204NoContent)]
public async Task ReportSessionEnded()
{
- AuthorizationInfo auth = await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false);
-
- await _sessionManager.Logout(auth.Token).ConfigureAwait(false);
+ await _sessionManager.Logout(User.GetToken()).ConfigureAwait(false);
return NoContent();
}
diff --git a/Jellyfin.Api/Controllers/StudiosController.cs b/Jellyfin.Api/Controllers/StudiosController.cs
index 053c7baaa1..1288fb5124 100644
--- a/Jellyfin.Api/Controllers/StudiosController.cs
+++ b/Jellyfin.Api/Controllers/StudiosController.cs
@@ -88,7 +88,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true)
{
var dtoOptions = new DtoOptions { Fields = fields }
- .AddClientFields(Request)
+ .AddClientFields(User)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
User? user = userId is null || userId.Value.Equals(default)
@@ -140,7 +140,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult GetStudio([FromRoute, Required] string name, [FromQuery] Guid? userId)
{
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var item = _libraryManager.GetStudio(name);
if (userId.HasValue && !userId.Equals(default))
diff --git a/Jellyfin.Api/Controllers/SubtitleController.cs b/Jellyfin.Api/Controllers/SubtitleController.cs
index 16acedcf35..1258a9876b 100644
--- a/Jellyfin.Api/Controllers/SubtitleController.cs
+++ b/Jellyfin.Api/Controllers/SubtitleController.cs
@@ -11,13 +11,13 @@ using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Models.SubtitleDtos;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Subtitles;
using MediaBrowser.Model.Entities;
@@ -45,7 +45,6 @@ namespace Jellyfin.Api.Controllers
private readonly IMediaSourceManager _mediaSourceManager;
private readonly IProviderManager _providerManager;
private readonly IFileSystem _fileSystem;
- private readonly IAuthorizationContext _authContext;
private readonly ILogger _logger;
///
@@ -58,7 +57,6 @@ namespace Jellyfin.Api.Controllers
/// Instance of interface.
/// Instance of interface.
/// Instance of interface.
- /// Instance of interface.
/// Instance of interface.
public SubtitleController(
IServerConfigurationManager serverConfigurationManager,
@@ -68,7 +66,6 @@ namespace Jellyfin.Api.Controllers
IMediaSourceManager mediaSourceManager,
IProviderManager providerManager,
IFileSystem fileSystem,
- IAuthorizationContext authContext,
ILogger logger)
{
_serverConfigurationManager = serverConfigurationManager;
@@ -78,7 +75,6 @@ namespace Jellyfin.Api.Controllers
_mediaSourceManager = mediaSourceManager;
_providerManager = providerManager;
_fileSystem = fileSystem;
- _authContext = authContext;
_logger = logger;
}
@@ -361,7 +357,7 @@ namespace Jellyfin.Api.Controllers
long positionTicks = 0;
- var accessToken = (await _authContext.GetAuthorizationInfo(Request).ConfigureAwait(false)).Token;
+ var accessToken = User.GetToken();
while (positionTicks < runtime)
{
diff --git a/Jellyfin.Api/Controllers/SuggestionsController.cs b/Jellyfin.Api/Controllers/SuggestionsController.cs
index e9c46dcf3a..1cf528153f 100644
--- a/Jellyfin.Api/Controllers/SuggestionsController.cs
+++ b/Jellyfin.Api/Controllers/SuggestionsController.cs
@@ -67,7 +67,7 @@ namespace Jellyfin.Api.Controllers
? null
: _userManager.GetUserById(userId);
- var dtoOptions = new DtoOptions().AddClientFields(Request);
+ var dtoOptions = new DtoOptions().AddClientFields(User);
var result = _libraryManager.GetItemsResult(new InternalItemsQuery(user)
{
OrderBy = new[] { (ItemSortBy.Random, SortOrder.Descending) },
diff --git a/Jellyfin.Api/Controllers/SyncPlayController.cs b/Jellyfin.Api/Controllers/SyncPlayController.cs
index c6b70f3d20..e194fc556e 100644
--- a/Jellyfin.Api/Controllers/SyncPlayController.cs
+++ b/Jellyfin.Api/Controllers/SyncPlayController.cs
@@ -5,7 +5,7 @@ using System.Threading.Tasks;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.Models.SyncPlayDtos;
-using MediaBrowser.Controller.Net;
+using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;
using MediaBrowser.Controller.SyncPlay;
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
@@ -24,23 +24,23 @@ namespace Jellyfin.Api.Controllers
public class SyncPlayController : BaseJellyfinApiController
{
private readonly ISessionManager _sessionManager;
- private readonly IAuthorizationContext _authorizationContext;
private readonly ISyncPlayManager _syncPlayManager;
+ private readonly IUserManager _userManager;
///
/// Initializes a new instance of the class.
///
/// Instance of the interface.
- /// Instance of the interface.
/// Instance of the interface.
+ /// Instance of the interface.
public SyncPlayController(
ISessionManager sessionManager,
- IAuthorizationContext authorizationContext,
- ISyncPlayManager syncPlayManager)
+ ISyncPlayManager syncPlayManager,
+ IUserManager userManager)
{
_sessionManager = sessionManager;
- _authorizationContext = authorizationContext;
_syncPlayManager = syncPlayManager;
+ _userManager = userManager;
}
///
@@ -55,7 +55,7 @@ namespace Jellyfin.Api.Controllers
public async Task SyncPlayCreateGroup(
[FromBody, Required] NewGroupRequestDto requestData)
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request).ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var syncPlayRequest = new NewGroupRequest(requestData.GroupName);
_syncPlayManager.NewGroup(currentSession, syncPlayRequest, CancellationToken.None);
return NoContent();
@@ -73,7 +73,7 @@ namespace Jellyfin.Api.Controllers
public async Task SyncPlayJoinGroup(
[FromBody, Required] JoinGroupRequestDto requestData)
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request).ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var syncPlayRequest = new JoinGroupRequest(requestData.GroupId);
_syncPlayManager.JoinGroup(currentSession, syncPlayRequest, CancellationToken.None);
return NoContent();
@@ -89,7 +89,7 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.SyncPlayIsInGroup)]
public async Task SyncPlayLeaveGroup()
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request).ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var syncPlayRequest = new LeaveGroupRequest();
_syncPlayManager.LeaveGroup(currentSession, syncPlayRequest, CancellationToken.None);
return NoContent();
@@ -105,7 +105,7 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.SyncPlayJoinGroup)]
public async Task>> SyncPlayGetGroups()
{
- var currentSession = await RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request).ConfigureAwait(false);
+ var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
var syncPlayRequest = new ListGroupsRequest();
return Ok(_syncPlayManager.ListGroups(currentSession, syncPlayRequest));
}
@@ -122,7 +122,7 @@ namespace Jellyfin.Api.Controllers
public async Task