diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-08-10 14:03:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-10 14:03:18 -0400 |
| commit | d93d9754c9869378b8baf4c84b63c30f8c3682a8 (patch) | |
| tree | fdf2a4bf00b7e30c094f7c19663e8c86b9ae3cf6 /MediaBrowser.Controller | |
| parent | c6f98843fffffe1ddcf9baa348740fef0d6d8e19 (diff) | |
| parent | 773c00861ece4f497d4d8ebbd54edf7d9b42b276 (diff) | |
Merge pull request #2803 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Controller')
24 files changed, 101 insertions, 173 deletions
diff --git a/MediaBrowser.Controller/Chapters/IChapterManager.cs b/MediaBrowser.Controller/Chapters/IChapterManager.cs index 05517ebcd4..85feec40b7 100644 --- a/MediaBrowser.Controller/Chapters/IChapterManager.cs +++ b/MediaBrowser.Controller/Chapters/IChapterManager.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; -using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Chapters @@ -21,10 +19,6 @@ namespace MediaBrowser.Controller.Chapters /// <summary> /// Saves the chapters. /// </summary> - /// <param name="itemId">The item identifier.</param> - /// <param name="chapters">The chapters.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task.</returns> - Task SaveChapters(string itemId, List<ChapterInfo> chapters, CancellationToken cancellationToken); + Task SaveChapters(string itemId, List<ChapterInfo> chapters); } } diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 9761aad4ff..0781dc35b0 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.Entities.Audio public List<string> Artists { get; set; } [IgnoreDataMember] - public List<string> AlbumArtists { get; set; } + public string[] AlbumArtists { get; set; } [IgnoreDataMember] public override bool EnableRefreshOnDateModifiedChange @@ -43,7 +43,7 @@ namespace MediaBrowser.Controller.Entities.Audio public Audio() { Artists = new List<string>(); - AlbumArtists = new List<string>(); + AlbumArtists = EmptyStringArray; } public override double? GetDefaultPrimaryImageAspectRatio() diff --git a/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs b/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs index a7c914664e..6900699e59 100644 --- a/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs @@ -5,7 +5,7 @@ namespace MediaBrowser.Controller.Entities.Audio { public interface IHasAlbumArtist { - List<string> AlbumArtists { get; set; } + string[] AlbumArtists { get; set; } } public interface IHasArtist diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index 516ab50530..c35e818265 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -19,13 +19,13 @@ namespace MediaBrowser.Controller.Entities.Audio /// </summary> public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>, IMetadataContainer { - public List<string> AlbumArtists { get; set; } + public string[] AlbumArtists { get; set; } public List<string> Artists { get; set; } public MusicAlbum() { Artists = new List<string>(); - AlbumArtists = new List<string>(); + AlbumArtists = EmptyStringArray; } [IgnoreDataMember] diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 16ad008271..8cc90db7d4 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -44,7 +44,9 @@ namespace MediaBrowser.Controller.Entities protected static Guid[] EmptyGuidArray = new Guid[] { }; protected static MetadataFields[] EmptyMetadataFieldsArray = new MetadataFields[] { }; protected static string[] EmptyStringArray = new string[] { }; + protected static MediaUrl[] EmptyMediaUrlArray = new MediaUrl[] { }; protected static ItemImageInfo[] EmptyItemImageInfoArray = new ItemImageInfo[] { }; + public static readonly LinkedChild[] EmptyLinkedChildArray = new LinkedChild[] { }; protected BaseItem() { @@ -1169,7 +1171,7 @@ namespace MediaBrowser.Controller.Entities { var newItems = LibraryManager.FindTrailers(this, fileSystemChildren, options.DirectoryService).ToList(); - var newItemIds = newItems.Select(i => i.Id).ToList(); + var newItemIds = newItems.Select(i => i.Id).ToArray(); var itemsChanged = !item.LocalTrailerIds.SequenceEqual(newItemIds); diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index 9e9624aae5..f314d82c13 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -249,7 +249,7 @@ namespace MediaBrowser.Controller.Entities var changed = !linkedChildren.SequenceEqual(LinkedChildren, new LinkedChildComparer(FileSystem)); - LinkedChildren = linkedChildren; + LinkedChildren = linkedChildren.ToArray(linkedChildren.Count); var folderIds = PhysicalFolderIds.ToList(); var newFolderIds = physicalFolders.Select(i => i.Id).ToList(); diff --git a/MediaBrowser.Controller/Entities/Extensions.cs b/MediaBrowser.Controller/Entities/Extensions.cs index 5e792a03a4..36855a86c1 100644 --- a/MediaBrowser.Controller/Entities/Extensions.cs +++ b/MediaBrowser.Controller/Entities/Extensions.cs @@ -1,6 +1,7 @@ using MediaBrowser.Model.Entities; using System; using System.Linq; +using MediaBrowser.Model.Extensions; namespace MediaBrowser.Controller.Entities { @@ -12,11 +13,7 @@ namespace MediaBrowser.Controller.Entities /// <summary> /// Adds the trailer URL. /// </summary> - /// <param name="item">The item.</param> - /// <param name="url">The URL.</param> - /// <param name="isDirectLink">if set to <c>true</c> [is direct link].</param> - /// <exception cref="System.ArgumentNullException">url</exception> - public static void AddTrailerUrl(this IHasTrailers item, string url, bool isDirectLink) + public static void AddTrailerUrl(this IHasTrailers item, string url) { if (string.IsNullOrWhiteSpace(url)) { @@ -27,10 +24,22 @@ namespace MediaBrowser.Controller.Entities if (current == null) { - item.RemoteTrailers.Add(new MediaUrl + var mediaUrl = new MediaUrl { Url = url - }); + }; + + if (item.RemoteTrailers.Length == 0) + { + item.RemoteTrailers = new[] { mediaUrl }; + } + else + { + var list = item.RemoteTrailers.ToArray(item.RemoteTrailers.Length + 1); + list[list.Length - 1] = mediaUrl; + + item.RemoteTrailers = list; + } } } } diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 80a1b5e2a4..c0e1423964 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -38,14 +38,14 @@ namespace MediaBrowser.Controller.Entities /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value> public bool IsRoot { get; set; } - public virtual List<LinkedChild> LinkedChildren { get; set; } + public LinkedChild[] LinkedChildren { get; set; } [IgnoreDataMember] public DateTime? DateLastMediaAdded { get; set; } public Folder() { - LinkedChildren = new List<LinkedChild>(); + LinkedChildren = EmptyLinkedChildArray; } [IgnoreDataMember] @@ -707,7 +707,7 @@ namespace MediaBrowser.Controller.Entities public virtual int GetChildCount(User user) { - if (LinkedChildren.Count > 0) + if (LinkedChildren.Length > 0) { if (!(this is ICollectionFolder)) { @@ -844,7 +844,7 @@ namespace MediaBrowser.Controller.Entities private bool RequiresPostFiltering(InternalItemsQuery query) { - if (LinkedChildren.Count > 0) + if (LinkedChildren.Length > 0) { if (!(this is ICollectionFolder)) { @@ -1225,7 +1225,7 @@ namespace MediaBrowser.Controller.Entities return GetLinkedChildren(); } - if (LinkedChildren.Count == 0) + if (LinkedChildren.Length == 0) { return new List<BaseItem>(); } @@ -1314,14 +1314,9 @@ namespace MediaBrowser.Controller.Entities /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> protected virtual bool RefreshLinkedChildren(IEnumerable<FileSystemMetadata> fileSystemChildren) { - var currentManualLinks = LinkedChildren.Where(i => i.Type == LinkedChildType.Manual).ToList(); - var currentShortcutLinks = LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut).ToList(); - - List<LinkedChild> newShortcutLinks; - if (SupportsShortcutChildren) { - newShortcutLinks = fileSystemChildren + var newShortcutLinks = fileSystemChildren .Where(i => !i.IsDirectory && FileSystem.IsShortcut(i.FullName)) .Select(i => { @@ -1352,16 +1347,17 @@ namespace MediaBrowser.Controller.Entities }) .Where(i => i != null) .ToList(); - } - else { newShortcutLinks = new List<LinkedChild>(); } - if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer(FileSystem))) - { - Logger.Info("Shortcut links have changed for {0}", Path); + var currentShortcutLinks = LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut).ToList(); - newShortcutLinks.AddRange(currentManualLinks); - LinkedChildren = newShortcutLinks; - return true; + if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer(FileSystem))) + { + Logger.Info("Shortcut links have changed for {0}", Path); + + newShortcutLinks.AddRange(LinkedChildren.Where(i => i.Type == LinkedChildType.Manual)); + LinkedChildren = newShortcutLinks.ToArray(newShortcutLinks.Count); + return true; + } } foreach (var child in LinkedChildren) diff --git a/MediaBrowser.Controller/Entities/Game.cs b/MediaBrowser.Controller/Entities/Game.cs index aec67c3db8..eb2638ee4a 100644 --- a/MediaBrowser.Controller/Entities/Game.cs +++ b/MediaBrowser.Controller/Entities/Game.cs @@ -14,13 +14,13 @@ namespace MediaBrowser.Controller.Entities public Game() { MultiPartGameFiles = EmptyStringArray; - RemoteTrailers = new List<MediaUrl>(); - LocalTrailerIds = new List<Guid>(); - RemoteTrailerIds = new List<Guid>(); + RemoteTrailers = EmptyMediaUrlArray; + LocalTrailerIds = EmptyGuidArray; + RemoteTrailerIds = EmptyGuidArray; } - public List<Guid> LocalTrailerIds { get; set; } - public List<Guid> RemoteTrailerIds { get; set; } + public Guid[] LocalTrailerIds { get; set; } + public Guid[] RemoteTrailerIds { get; set; } public override bool CanDownload() { @@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the remote trailers. /// </summary> /// <value>The remote trailers.</value> - public List<MediaUrl> RemoteTrailers { get; set; } + public MediaUrl[] RemoteTrailers { get; set; } /// <summary> /// Gets the type of the media. @@ -127,16 +127,5 @@ namespace MediaBrowser.Controller.Entities return id; } - - /// <summary> - /// Gets the trailer ids. - /// </summary> - /// <returns>List<Guid>.</returns> - public List<Guid> GetTrailerIds() - { - var list = LocalTrailerIds.ToList(); - list.AddRange(RemoteTrailerIds); - return list; - } } } diff --git a/MediaBrowser.Controller/Entities/IHasTrailers.cs b/MediaBrowser.Controller/Entities/IHasTrailers.cs index e5cbdff723..8686c802ab 100644 --- a/MediaBrowser.Controller/Entities/IHasTrailers.cs +++ b/MediaBrowser.Controller/Entities/IHasTrailers.cs @@ -11,14 +11,14 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the remote trailers. /// </summary> /// <value>The remote trailers.</value> - List<MediaUrl> RemoteTrailers { get; set; } + MediaUrl[] RemoteTrailers { get; set; } /// <summary> /// Gets or sets the local trailer ids. /// </summary> /// <value>The local trailer ids.</value> - List<Guid> LocalTrailerIds { get; set; } - List<Guid> RemoteTrailerIds { get; set; } + Guid[] LocalTrailerIds { get; set; } + Guid[] RemoteTrailerIds { get; set; } } public static class HasTrailerExtensions diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index 071ed405f1..a5387a2657 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -21,9 +21,9 @@ namespace MediaBrowser.Controller.Entities.Movies public BoxSet() { - RemoteTrailers = new List<MediaUrl>(); - LocalTrailerIds = new List<Guid>(); - RemoteTrailerIds = new List<Guid>(); + RemoteTrailers = EmptyMediaUrlArray; + LocalTrailerIds = EmptyGuidArray; + RemoteTrailerIds = EmptyGuidArray; DisplayOrder = ItemSortBy.PremiereDate; Shares = new List<Share>(); @@ -47,14 +47,14 @@ namespace MediaBrowser.Controller.Entities.Movies } } - public List<Guid> LocalTrailerIds { get; set; } - public List<Guid> RemoteTrailerIds { get; set; } + public Guid[] LocalTrailerIds { get; set; } + public Guid[] RemoteTrailerIds { get; set; } /// <summary> /// Gets or sets the remote trailers. /// </summary> /// <value>The remote trailers.</value> - public List<MediaUrl> RemoteTrailers { get; set; } + public MediaUrl[] RemoteTrailers { get; set; } /// <summary> /// Gets or sets the display order. @@ -148,17 +148,6 @@ namespace MediaBrowser.Controller.Entities.Movies } /// <summary> - /// Gets the trailer ids. - /// </summary> - /// <returns>List<Guid>.</returns> - public List<Guid> GetTrailerIds() - { - var list = LocalTrailerIds.ToList(); - list.AddRange(RemoteTrailerIds); - return list; - } - - /// <summary> /// Updates the official rating based on content and returns true or false indicating if it changed. /// </summary> /// <returns></returns> diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 632e3ba121..99d7fdecb4 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -24,15 +24,15 @@ namespace MediaBrowser.Controller.Entities.Movies public Movie() { SpecialFeatureIds = new List<Guid>(); - RemoteTrailers = new List<MediaUrl>(); - LocalTrailerIds = new List<Guid>(); - RemoteTrailerIds = new List<Guid>(); + RemoteTrailers = EmptyMediaUrlArray; + LocalTrailerIds = EmptyGuidArray; + RemoteTrailerIds = EmptyGuidArray; } - public List<Guid> LocalTrailerIds { get; set; } - public List<Guid> RemoteTrailerIds { get; set; } + public Guid[] LocalTrailerIds { get; set; } + public Guid[] RemoteTrailerIds { get; set; } - public List<MediaUrl> RemoteTrailers { get; set; } + public MediaUrl[] RemoteTrailers { get; set; } /// <summary> /// Gets or sets the name of the TMDB collection. diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 45b4de1b3b..3cdfd19f10 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -17,14 +17,14 @@ namespace MediaBrowser.Controller.Entities.TV {
public Episode()
{
- RemoteTrailers = new List<MediaUrl>();
- LocalTrailerIds = new List<Guid>();
- RemoteTrailerIds = new List<Guid>();
+ RemoteTrailers = EmptyMediaUrlArray;
+ LocalTrailerIds = EmptyGuidArray;
+ RemoteTrailerIds = EmptyGuidArray;
}
- public List<Guid> LocalTrailerIds { get; set; }
- public List<Guid> RemoteTrailerIds { get; set; }
- public List<MediaUrl> RemoteTrailers { get; set; }
+ public Guid[] LocalTrailerIds { get; set; }
+ public Guid[] RemoteTrailerIds { get; set; }
+ public MediaUrl[] RemoteTrailers { get; set; }
/// <summary>
/// Gets the season in which it aired.
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index a8051aa9dd..f9133ccb01 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -24,9 +24,9 @@ namespace MediaBrowser.Controller.Entities.TV { AirDays = new List<DayOfWeek>(); - RemoteTrailers = new List<MediaUrl>(); - LocalTrailerIds = new List<Guid>(); - RemoteTrailerIds = new List<Guid>(); + RemoteTrailers = EmptyMediaUrlArray; + LocalTrailerIds = EmptyGuidArray; + RemoteTrailerIds = EmptyGuidArray; } [IgnoreDataMember] @@ -62,10 +62,10 @@ namespace MediaBrowser.Controller.Entities.TV } } - public List<Guid> LocalTrailerIds { get; set; } - public List<Guid> RemoteTrailerIds { get; set; } + public Guid[] LocalTrailerIds { get; set; } + public Guid[] RemoteTrailerIds { get; set; } - public List<MediaUrl> RemoteTrailers { get; set; } + public MediaUrl[] RemoteTrailers { get; set; } /// <summary> /// airdate, dvd or absolute @@ -225,17 +225,6 @@ namespace MediaBrowser.Controller.Entities.TV return list; } - /// <summary> - /// Gets the trailer ids. - /// </summary> - /// <returns>List<Guid>.</returns> - public List<Guid> GetTrailerIds() - { - var list = LocalTrailerIds.ToList(); - list.AddRange(RemoteTrailerIds); - return list; - } - [IgnoreDataMember] public bool ContainsEpisodesWithoutSeasonFolders { diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 585e2a478b..fbeefbbd9c 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -31,9 +31,9 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public string PrimaryVersionId { get; set; } - public List<string> AdditionalParts { get; set; } - public List<string> LocalAlternateVersions { get; set; } - public List<LinkedChild> LinkedAlternateVersions { get; set; } + public string[] AdditionalParts { get; set; } + public string[] LocalAlternateVersions { get; set; } + public LinkedChild[] LinkedAlternateVersions { get; set; } [IgnoreDataMember] public override bool SupportsPlayedStatus @@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the subtitle paths. /// </summary> /// <value>The subtitle paths.</value> - public List<string> SubtitleFiles { get; set; } + public string[] SubtitleFiles { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance has subtitles. @@ -177,10 +177,10 @@ namespace MediaBrowser.Controller.Entities public Video() { - AdditionalParts = new List<string>(); - LocalAlternateVersions = new List<string>(); - SubtitleFiles = new List<string>(); - LinkedAlternateVersions = new List<LinkedChild>(); + AdditionalParts = EmptyStringArray; + LocalAlternateVersions = EmptyStringArray; + SubtitleFiles = EmptyStringArray; + LinkedAlternateVersions = EmptyLinkedChildArray; } public override bool CanDownload() @@ -214,20 +214,20 @@ namespace MediaBrowser.Controller.Entities return item.MediaSourceCount; } } - return LinkedAlternateVersions.Count + LocalAlternateVersions.Count + 1; + return LinkedAlternateVersions.Length + LocalAlternateVersions.Length + 1; } } [IgnoreDataMember] public bool IsStacked { - get { return AdditionalParts.Count > 0; } + get { return AdditionalParts.Length > 0; } } [IgnoreDataMember] public bool HasLocalAlternateVersions { - get { return LocalAlternateVersions.Count > 0; } + get { return LocalAlternateVersions.Length > 0; } } public IEnumerable<Guid> GetAdditionalPartIds() diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index b72b9027ec..38a76c06a0 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -166,7 +166,6 @@ <Compile Include="LiveTv\TimerEventInfo.cs" /> <Compile Include="LiveTv\TimerInfo.cs" /> <Compile Include="LiveTv\TunerChannelMapping.cs" /> - <Compile Include="MediaEncoding\ChapterImageRefreshOptions.cs" /> <Compile Include="MediaEncoding\EncodingHelper.cs" /> <Compile Include="MediaEncoding\EncodingJobInfo.cs" /> <Compile Include="MediaEncoding\EncodingJobOptions.cs" /> diff --git a/MediaBrowser.Controller/MediaEncoding/ChapterImageRefreshOptions.cs b/MediaBrowser.Controller/MediaEncoding/ChapterImageRefreshOptions.cs deleted file mode 100644 index e11bd6cdf8..0000000000 --- a/MediaBrowser.Controller/MediaEncoding/ChapterImageRefreshOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; -using System.Collections.Generic; - -namespace MediaBrowser.Controller.MediaEncoding -{ - public class ChapterImageRefreshOptions - { - public Video Video { get; set; } - - public List<ChapterInfo> Chapters { get; set; } - - public bool SaveChapters { get; set; } - - public bool ExtractImages { get; set; } - } -} diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 190ccdd9cc..1f85a076e5 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1622,26 +1622,6 @@ namespace MediaBrowser.Controller.MediaEncoding inputModifier += " -f " + inputFormat; } } - - // Only do this for video files due to sometimes unpredictable codec names coming from BDInfo - if (state.VideoType == VideoType.VideoFile && state.RunTimeTicks.HasValue && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) - { - foreach (var stream in state.MediaSource.MediaStreams) - { - if (!stream.IsExternal && stream.Type != MediaStreamType.Subtitle) - { - if (!string.IsNullOrWhiteSpace(stream.Codec) && stream.Index != -1) - { - var decoder = GetDecoderFromCodec(stream.Codec); - - if (!string.IsNullOrWhiteSpace(decoder)) - { - inputModifier += " -codec:" + stream.Index.ToString(_usCulture) + " " + decoder; - } - } - } - } - } } if (state.MediaSource.RequiresLooping) diff --git a/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs b/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs index 8683a6af42..81269fe3fa 100644 --- a/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs +++ b/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs @@ -1,5 +1,8 @@ -using System.Threading; +using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.MediaEncoding { @@ -8,9 +11,6 @@ namespace MediaBrowser.Controller.MediaEncoding /// <summary> /// Refreshes the chapter images. /// </summary> - /// <param name="options">The options.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task{System.Boolean}.</returns> - Task<bool> RefreshChapterImages(ChapterImageRefreshOptions options, CancellationToken cancellationToken); + Task<bool> RefreshChapterImages(Video video, List<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs index 3fc92fa2ce..bf54914b1d 100644 --- a/MediaBrowser.Controller/Persistence/IItemRepository.cs +++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs @@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.Persistence /// </summary> /// <param name="id"></param> /// <returns></returns> - IEnumerable<ChapterInfo> GetChapters(Guid id); + List<ChapterInfo> GetChapters(Guid id); /// <summary> /// Gets a single chapter for an item @@ -78,11 +78,7 @@ namespace MediaBrowser.Controller.Persistence /// <summary> /// Saves the chapters. /// </summary> - /// <param name="id">The id.</param> - /// <param name="chapters">The chapters.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task.</returns> - Task SaveChapters(Guid id, List<ChapterInfo> chapters, CancellationToken cancellationToken); + Task SaveChapters(Guid id, List<ChapterInfo> chapters); /// <summary> /// Gets the media streams. diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index eaadc68717..aec0668d43 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Playlists if (query != null) { - items = items.Where(i => UserViewBuilder.FilterItem(i, query)); + items = items.Where(i => UserViewBuilder.FilterItem(i, query)).ToList(); } return items; @@ -116,12 +116,12 @@ namespace MediaBrowser.Controller.Playlists return GetLinkedChildrenInfos(); } - private IEnumerable<BaseItem> GetPlayableItems(User user, DtoOptions options) + private List<BaseItem> GetPlayableItems(User user, DtoOptions options) { return GetPlaylistItems(MediaType, base.GetChildren(user, true), user, options); } - public static IEnumerable<BaseItem> GetPlaylistItems(string playlistMediaType, IEnumerable<BaseItem> inputItems, User user, DtoOptions options) + public static List<BaseItem> GetPlaylistItems(string playlistMediaType, IEnumerable<BaseItem> inputItems, User user, DtoOptions options) { if (user != null) { diff --git a/MediaBrowser.Controller/Providers/AlbumInfo.cs b/MediaBrowser.Controller/Providers/AlbumInfo.cs index b884774094..74feb4ea21 100644 --- a/MediaBrowser.Controller/Providers/AlbumInfo.cs +++ b/MediaBrowser.Controller/Providers/AlbumInfo.cs @@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Providers /// Gets or sets the album artist. /// </summary> /// <value>The album artist.</value> - public List<string> AlbumArtists { get; set; } + public string[] AlbumArtists { get; set; } /// <summary> /// Gets or sets the artist provider ids. @@ -22,7 +22,7 @@ namespace MediaBrowser.Controller.Providers { ArtistProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); SongInfos = new List<SongInfo>(); - AlbumArtists = new List<string>(); + AlbumArtists = EmptyStringArray; } } }
\ No newline at end of file diff --git a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs index dc7a04135a..98122e7767 100644 --- a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs +++ b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs @@ -6,6 +6,8 @@ namespace MediaBrowser.Controller.Providers { public class ItemLookupInfo : IHasProviderIds { + protected static string[] EmptyStringArray = new string[] { }; + /// <summary> /// Gets or sets the name. /// </summary> diff --git a/MediaBrowser.Controller/Providers/SongInfo.cs b/MediaBrowser.Controller/Providers/SongInfo.cs index b83912a002..988e931cd3 100644 --- a/MediaBrowser.Controller/Providers/SongInfo.cs +++ b/MediaBrowser.Controller/Providers/SongInfo.cs @@ -4,14 +4,14 @@ namespace MediaBrowser.Controller.Providers { public class SongInfo : ItemLookupInfo { - public List<string> AlbumArtists { get; set; } + public string[] AlbumArtists { get; set; } public string Album { get; set; } public List<string> Artists { get; set; } public SongInfo() { Artists = new List<string>(); - AlbumArtists = new List<string>(); + AlbumArtists = EmptyStringArray; } } }
\ No newline at end of file |
