aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-01-03 17:16:04 -0700
committerGitHub <noreply@github.com>2022-01-03 17:16:04 -0700
commite51777fe4ba9ee14975d9b425cb18810819ff179 (patch)
treea0f1809fe208f070454fc80db9641d576e1a2789
parent37061e5b6b3116ef46ca2cd9362ba9c11c76b6a7 (diff)
parent89528194947832e732413b621a64d32a454b6383 (diff)
Merge pull request #7093 from ilaborde/fix-5355
-rw-r--r--Emby.Dlna/DlnaManager.cs16
1 files changed, 4 insertions, 12 deletions
diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs
index d9d2a345a..f2a0548c2 100644
--- a/Emby.Dlna/DlnaManager.cs
+++ b/Emby.Dlna/DlnaManager.cs
@@ -83,8 +83,7 @@ namespace Emby.Dlna
{
lock (_profiles)
{
- var list = _profiles.Values.ToList();
- return list
+ return _profiles.Values
.OrderBy(i => i.Item1.Info.Type == DeviceProfileType.User ? 0 : 1)
.ThenBy(i => i.Item1.Info.Name)
.Select(i => i.Item2)
@@ -226,11 +225,8 @@ namespace Emby.Dlna
{
try
{
- var xmlFies = _fileSystem.GetFilePaths(path)
+ return _fileSystem.GetFilePaths(path)
.Where(i => string.Equals(Path.GetExtension(i), ".xml", StringComparison.OrdinalIgnoreCase))
- .ToList();
-
- return xmlFies
.Select(i => ParseProfileFile(i, type))
.Where(i => i != null)
.ToList()!; // We just filtered out all the nulls
@@ -252,11 +248,8 @@ namespace Emby.Dlna
try
{
- DeviceProfile profile;
-
var tempProfile = (DeviceProfile)_xmlSerializer.DeserializeFromFile(typeof(DeviceProfile), path);
-
- profile = ReserializeProfile(tempProfile);
+ var profile = ReserializeProfile(tempProfile);
profile.Id = path.ToLowerInvariant().GetMD5().ToString("N", CultureInfo.InvariantCulture);
@@ -295,8 +288,7 @@ namespace Emby.Dlna
{
lock (_profiles)
{
- var list = _profiles.Values.ToList();
- return list
+ return _profiles.Values
.Select(i => i.Item1)
.OrderBy(i => i.Info.Type == DeviceProfileType.User ? 0 : 1)
.ThenBy(i => i.Info.Name);