revert servicestack.text update

This commit is contained in:
Luke Pulverenti
2017-08-10 14:01:31 -04:00
parent c147b64de8
commit e7425e6205
64 changed files with 198 additions and 310 deletions

View File

@@ -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);
}
}

View File

@@ -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()

View File

@@ -5,7 +5,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
public interface IHasAlbumArtist
{
List<string> AlbumArtists { get; set; }
string[] AlbumArtists { get; set; }
}
public interface IHasArtist

View File

@@ -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]

View File

@@ -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);

View File

@@ -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();

View File

@@ -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;
}
}
}
}

View File

@@ -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)

View File

@@ -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&lt;Guid&gt;.</returns>
public List<Guid> GetTrailerIds()
{
var list = LocalTrailerIds.ToList();
list.AddRange(RemoteTrailerIds);
return list;
}
}
}

View File

@@ -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

View File

@@ -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.
@@ -147,17 +147,6 @@ namespace MediaBrowser.Controller.Entities.Movies
return true;
}
/// <summary>
/// Gets the trailer ids.
/// </summary>
/// <returns>List&lt;Guid&gt;.</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>

View File

@@ -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.

View File

@@ -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.

View File

@@ -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&lt;Guid&gt;.</returns>
public List<Guid> GetTrailerIds()
{
var list = LocalTrailerIds.ToList();
list.AddRange(RemoteTrailerIds);
return list;
}
[IgnoreDataMember]
public bool ContainsEpisodesWithoutSeasonFolders
{

View File

@@ -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()

View File

@@ -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" />

View File

@@ -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; }
}
}

View File

@@ -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)

View File

@@ -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);
}
}

View File

@@ -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.

View File

@@ -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)
{

View File

@@ -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;
}
}
}

View File

@@ -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>

View File

@@ -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;
}
}
}