From e441e2f53db0b587c9864fe91d7008a2344d147b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 24 Aug 2017 15:52:19 -0400 Subject: update active recordings --- MediaBrowser.Controller/Providers/DirectoryService.cs | 16 ++++++++++++---- MediaBrowser.Controller/Providers/IDirectoryService.cs | 2 +- MediaBrowser.Controller/Providers/MetadataResult.cs | 11 +++++++++-- MediaBrowser.Controller/Providers/SongInfo.cs | 5 ++--- 4 files changed, 24 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Controller/Providers') diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 337bb23a48..d957470d3b 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -4,7 +4,6 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; - using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; @@ -73,14 +72,23 @@ namespace MediaBrowser.Controller.Providers return entries; } - public IEnumerable GetFiles(string path) + public List GetFiles(string path) { return GetFiles(path, false); } - public IEnumerable GetFiles(string path, bool clearCache) + public List GetFiles(string path, bool clearCache) { - return GetFileSystemEntries(path, clearCache).Where(i => !i.IsDirectory); + var list = new List(); + var items = GetFileSystemEntries(path, clearCache); + foreach (var item in items) + { + if (!item.IsDirectory) + { + list.Add(item); + } + } + return list; } public FileSystemMetadata GetFile(string path) diff --git a/MediaBrowser.Controller/Providers/IDirectoryService.cs b/MediaBrowser.Controller/Providers/IDirectoryService.cs index 3747039482..6f864f4be2 100644 --- a/MediaBrowser.Controller/Providers/IDirectoryService.cs +++ b/MediaBrowser.Controller/Providers/IDirectoryService.cs @@ -6,7 +6,7 @@ namespace MediaBrowser.Controller.Providers public interface IDirectoryService { FileSystemMetadata[] GetFileSystemEntries(string path); - IEnumerable GetFiles(string path); + List GetFiles(string path); FileSystemMetadata GetFile(string path); } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Providers/MetadataResult.cs b/MediaBrowser.Controller/Providers/MetadataResult.cs index 99402a9694..5ed55ea162 100644 --- a/MediaBrowser.Controller/Providers/MetadataResult.cs +++ b/MediaBrowser.Controller/Providers/MetadataResult.cs @@ -1,7 +1,6 @@ using MediaBrowser.Controller.Entities; using System; using System.Collections.Generic; -using System.Linq; namespace MediaBrowser.Controller.Providers { @@ -51,7 +50,15 @@ namespace MediaBrowser.Controller.Providers UserDataList = new List(); } - var userData = UserDataList.FirstOrDefault(i => string.Equals(userId, i.UserId.ToString("N"), StringComparison.OrdinalIgnoreCase)); + UserItemData userData = null; + + foreach (var i in UserDataList) + { + if (string.Equals(userId, i.UserId.ToString("N"), StringComparison.OrdinalIgnoreCase)) + { + userData = i; + } + } if (userData == null) { diff --git a/MediaBrowser.Controller/Providers/SongInfo.cs b/MediaBrowser.Controller/Providers/SongInfo.cs index 988e931cd3..e3a6f5d37e 100644 --- a/MediaBrowser.Controller/Providers/SongInfo.cs +++ b/MediaBrowser.Controller/Providers/SongInfo.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; namespace MediaBrowser.Controller.Providers { @@ -6,11 +5,11 @@ namespace MediaBrowser.Controller.Providers { public string[] AlbumArtists { get; set; } public string Album { get; set; } - public List Artists { get; set; } + public string[] Artists { get; set; } public SongInfo() { - Artists = new List(); + Artists = EmptyStringArray; AlbumArtists = EmptyStringArray; } } -- cgit v1.2.3