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

@ -34,8 +34,9 @@
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.Text, Version=4.5.12.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.12\lib\net45\ServiceStack.Text.dll</HintPath> <HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath> <HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.4.12" targetFramework="net46" /> <package id="NLog" version="4.4.12" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.12" targetFramework="net46" /> <package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SharpCompress" version="0.14.0" targetFramework="net462" /> <package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" /> <package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
</packages> </packages>

View File

@ -1344,7 +1344,7 @@ namespace Emby.Server.Implementations.Channels
var hasAlbumArtists = item as IHasAlbumArtist; var hasAlbumArtists = item as IHasAlbumArtist;
if (hasAlbumArtists != null) if (hasAlbumArtists != null)
{ {
hasAlbumArtists.AlbumArtists = info.AlbumArtists; hasAlbumArtists.AlbumArtists = info.AlbumArtists.ToArray(info.AlbumArtists.Count);
} }
var trailer = item as Trailer; var trailer = item as Trailer;

View File

@ -12,6 +12,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Extensions;
namespace Emby.Server.Implementations.Collections namespace Emby.Server.Implementations.Collections
{ {
@ -190,7 +191,9 @@ namespace Emby.Server.Implementations.Collections
if (list.Count > 0) if (list.Count > 0)
{ {
collection.LinkedChildren.AddRange(list); var newList = collection.LinkedChildren.ToList();
newList.AddRange(list);
collection.LinkedChildren = newList.ToArray(newList.Count);
collection.UpdateRatingToContent(); collection.UpdateRatingToContent();
@ -241,9 +244,9 @@ namespace Emby.Server.Implementations.Collections
} }
} }
foreach (var child in list) if (list.Count > 0)
{ {
collection.LinkedChildren.Remove(child); collection.LinkedChildren = collection.LinkedChildren.Except(list).ToArray();
} }
collection.UpdateRatingToContent(); collection.UpdateRatingToContent();

View File

@ -1037,9 +1037,9 @@ namespace Emby.Server.Implementations.Data
var hasAlbumArtists = item as IHasAlbumArtist; var hasAlbumArtists = item as IHasAlbumArtist;
if (hasAlbumArtists != null) if (hasAlbumArtists != null)
{ {
if (hasAlbumArtists.AlbumArtists.Count > 0) if (hasAlbumArtists.AlbumArtists.Length > 0)
{ {
albumArtists = string.Join("|", hasAlbumArtists.AlbumArtists.ToArray()); albumArtists = string.Join("|", hasAlbumArtists.AlbumArtists);
} }
} }
saveItemStatement.TryBind("@AlbumArtists", albumArtists); saveItemStatement.TryBind("@AlbumArtists", albumArtists);
@ -1927,7 +1927,7 @@ namespace Emby.Server.Implementations.Data
var hasAlbumArtists = item as IHasAlbumArtist; var hasAlbumArtists = item as IHasAlbumArtist;
if (hasAlbumArtists != null && !reader.IsDBNull(index)) if (hasAlbumArtists != null && !reader.IsDBNull(index))
{ {
hasAlbumArtists.AlbumArtists = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); hasAlbumArtists.AlbumArtists = reader.GetString(index).Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
} }
index++; index++;
} }
@ -1995,7 +1995,7 @@ namespace Emby.Server.Implementations.Data
/// <param name="id">The id.</param> /// <param name="id">The id.</param>
/// <returns>IEnumerable{ChapterInfo}.</returns> /// <returns>IEnumerable{ChapterInfo}.</returns>
/// <exception cref="System.ArgumentNullException">id</exception> /// <exception cref="System.ArgumentNullException">id</exception>
public IEnumerable<ChapterInfo> GetChapters(Guid id) public List<ChapterInfo> GetChapters(Guid id)
{ {
CheckDisposed(); CheckDisposed();
if (id == Guid.Empty) if (id == Guid.Empty)
@ -2091,18 +2091,7 @@ namespace Emby.Server.Implementations.Data
/// <summary> /// <summary>
/// Saves the chapters. /// Saves the chapters.
/// </summary> /// </summary>
/// <param name="id">The id.</param> public async Task SaveChapters(Guid id, List<ChapterInfo> chapters)
/// <param name="chapters">The chapters.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException">
/// id
/// or
/// chapters
/// or
/// cancellationToken
/// </exception>
public async Task SaveChapters(Guid id, List<ChapterInfo> chapters, CancellationToken cancellationToken)
{ {
CheckDisposed(); CheckDisposed();
@ -2116,8 +2105,6 @@ namespace Emby.Server.Implementations.Data
throw new ArgumentNullException("chapters"); throw new ArgumentNullException("chapters");
} }
cancellationToken.ThrowIfCancellationRequested();
var index = 0; var index = 0;
using (WriteLock.Write()) using (WriteLock.Write())
@ -2826,7 +2813,7 @@ namespace Emby.Server.Implementations.Data
var slowThreshold = 1000; var slowThreshold = 1000;
#if DEBUG #if DEBUG
slowThreshold = 2; slowThreshold = 10;
#endif #endif
if (elapsed >= slowThreshold) if (elapsed >= slowThreshold)

View File

@ -993,7 +993,7 @@ namespace Emby.Server.Implementations.Dto
{ {
dto.RemoteTrailers = hasTrailers != null ? dto.RemoteTrailers = hasTrailers != null ?
hasTrailers.RemoteTrailers : hasTrailers.RemoteTrailers :
new List<MediaUrl>(); new MediaUrl[] {};
} }
dto.Name = item.Name; dto.Name = item.Name;
@ -1172,8 +1172,7 @@ namespace Emby.Server.Implementations.Dto
// }) // })
// .ToList(); // .ToList();
dto.AlbumArtists = new List<NameIdPair>(); dto.AlbumArtists = hasAlbumArtist.AlbumArtists
dto.AlbumArtists.AddRange(hasAlbumArtist.AlbumArtists
//.Except(foundArtists, new DistinctNameComparer()) //.Except(foundArtists, new DistinctNameComparer())
.Select(i => .Select(i =>
{ {
@ -1198,7 +1197,7 @@ namespace Emby.Server.Implementations.Dto
return null; return null;
}).Where(i => i != null)); }).Where(i => i != null).ToArray();
} }
// Add video info // Add video info
@ -1214,9 +1213,9 @@ namespace Emby.Server.Implementations.Dto
dto.HasSubtitles = video.HasSubtitles; dto.HasSubtitles = video.HasSubtitles;
} }
if (video.AdditionalParts.Count != 0) if (video.AdditionalParts.Length != 0)
{ {
dto.PartCount = video.AdditionalParts.Count + 1; dto.PartCount = video.AdditionalParts.Length + 1;
} }
if (fields.Contains(ItemFields.MediaSourceCount)) if (fields.Contains(ItemFields.MediaSourceCount))

View File

@ -367,8 +367,9 @@
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=1.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=1.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.1.2.2\lib\net45\Microsoft.IO.RecyclableMemoryStream.dll</HintPath> <HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.1.2.2\lib\net45\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.Text, Version=4.5.12.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.12\lib\net45\ServiceStack.Text.dll</HintPath> <HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SimpleInjector, Version=4.0.8.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL"> <Reference Include="SimpleInjector, Version=4.0.8.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.4.0.8\lib\net45\SimpleInjector.dll</HintPath> <HintPath>..\packages\SimpleInjector.4.0.8\lib\net45\SimpleInjector.dll</HintPath>

View File

@ -91,7 +91,7 @@ namespace Emby.Server.Implementations.Library
}); });
var trailerIds = trailers.Select(i => i.Id) var trailerIds = trailers.Select(i => i.Id)
.ToList(); .ToArray();
if (!trailerIds.SequenceEqual(item.RemoteTrailerIds)) if (!trailerIds.SequenceEqual(item.RemoteTrailerIds))
{ {

View File

@ -159,8 +159,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
IsInMixedFolder = isInMixedFolder, IsInMixedFolder = isInMixedFolder,
ProductionYear = video.Year, ProductionYear = video.Year,
Name = video.Name, Name = video.Name,
AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToList(), AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToArray(),
LocalAlternateVersions = video.AlternateVersions.Select(i => i.Path).ToList() LocalAlternateVersions = video.AlternateVersions.Select(i => i.Path).ToArray()
}; };
SetVideoType(videoItem, firstVideo); SetVideoType(videoItem, firstVideo);
@ -503,7 +503,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
{ {
Path = folderPaths[0], Path = folderPaths[0],
AdditionalParts = folderPaths.Skip(1).ToList(), AdditionalParts = folderPaths.Skip(1).ToArray(),
VideoType = videoTypes[0], VideoType = videoTypes[0],

View File

@ -84,13 +84,8 @@ namespace Emby.Server.Implementations.MediaEncoder
/// </summary> /// </summary>
private static readonly long FirstChapterTicks = TimeSpan.FromSeconds(15).Ticks; private static readonly long FirstChapterTicks = TimeSpan.FromSeconds(15).Ticks;
public async Task<bool> RefreshChapterImages(ChapterImageRefreshOptions options, CancellationToken cancellationToken) public async Task<bool> RefreshChapterImages(Video video, List<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken)
{ {
var extractImages = options.ExtractImages;
var video = options.Video;
var chapters = options.Chapters;
var saveChapters = options.SaveChapters;
if (!IsEligibleForChapterImageExtraction(video)) if (!IsEligibleForChapterImageExtraction(video))
{ {
extractImages = false; extractImages = false;
@ -179,7 +174,7 @@ namespace Emby.Server.Implementations.MediaEncoder
if (saveChapters && changesMade) if (saveChapters && changesMade)
{ {
await _chapterManager.SaveChapters(video.Id.ToString(), chapters, cancellationToken).ConfigureAwait(false); await _chapterManager.SaveChapters(video.Id.ToString(), chapters).ConfigureAwait(false);
} }
DeleteDeadImages(currentImages, chapters); DeleteDeadImages(currentImages, chapters);

View File

@ -12,10 +12,9 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Extensions;
namespace Emby.Server.Implementations.Playlists namespace Emby.Server.Implementations.Playlists
{ {
@ -164,7 +163,7 @@ namespace Emby.Server.Implementations.Playlists
return path; return path;
} }
private IEnumerable<BaseItem> GetPlaylistItems(IEnumerable<string> itemIds, string playlistMediaType, User user, DtoOptions options) private List<BaseItem> GetPlaylistItems(IEnumerable<string> itemIds, string playlistMediaType, User user, DtoOptions options)
{ {
var items = itemIds.Select(i => _libraryManager.GetItemById(i)).Where(i => i != null); var items = itemIds.Select(i => _libraryManager.GetItemById(i)).Where(i => i != null);
@ -206,7 +205,9 @@ namespace Emby.Server.Implementations.Playlists
list.Add(LinkedChild.Create(item)); list.Add(LinkedChild.Create(item));
} }
playlist.LinkedChildren.AddRange(list); var newList = playlist.LinkedChildren.ToList();
newList.AddRange(list);
playlist.LinkedChildren = newList.ToArray(newList.Count);
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
@ -234,7 +235,7 @@ namespace Emby.Server.Implementations.Playlists
playlist.LinkedChildren = children.Except(removals) playlist.LinkedChildren = children.Except(removals)
.Select(i => i.Item1) .Select(i => i.Item1)
.ToList(); .ToArray();
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
@ -265,17 +266,21 @@ namespace Emby.Server.Implementations.Playlists
var item = playlist.LinkedChildren[oldIndex]; var item = playlist.LinkedChildren[oldIndex];
playlist.LinkedChildren.Remove(item); var newList = playlist.LinkedChildren.ToList();
if (newIndex >= playlist.LinkedChildren.Count) newList.Remove(item);
if (newIndex >= newList.Count)
{ {
playlist.LinkedChildren.Add(item); newList.Add(item);
} }
else else
{ {
playlist.LinkedChildren.Insert(newIndex, item); newList.Insert(newIndex, item);
} }
playlist.LinkedChildren = newList.ToArray(newList.Count);
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
} }

View File

@ -124,16 +124,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
try try
{ {
var chapters = _itemRepo.GetChapters(video.Id).ToList(); var chapters = _itemRepo.GetChapters(video.Id);
var success = await _encodingManager.RefreshChapterImages(new ChapterImageRefreshOptions var success = await _encodingManager.RefreshChapterImages(video, chapters, extract, true, CancellationToken.None);
{
SaveChapters = true,
ExtractImages = extract,
Video = video,
Chapters = chapters
}, CancellationToken.None);
if (!success) if (!success)
{ {

View File

@ -3,7 +3,7 @@
<package id="Emby.XmlTv" version="1.0.9" targetFramework="net46" /> <package id="Emby.XmlTv" version="1.0.9" targetFramework="net46" />
<package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" /> <package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="1.2.2" targetFramework="net46" /> <package id="Microsoft.IO.RecyclableMemoryStream" version="1.2.2" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.12" targetFramework="net46" /> <package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" /> <package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
<package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" /> <package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" />
<package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net46" /> <package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net46" />

View File

@ -347,7 +347,7 @@ namespace MediaBrowser.Api
hasAlbumArtists.AlbumArtists = request hasAlbumArtists.AlbumArtists = request
.AlbumArtists .AlbumArtists
.Select(i => i.Name) .Select(i => i.Name)
.ToList(); .ToArray();
} }
} }

View File

@ -513,7 +513,7 @@ namespace MediaBrowser.Api.Reports
internalHeader = HeaderMetadata.AlbumArtist; internalHeader = HeaderMetadata.AlbumArtist;
break; break;
case HeaderMetadata.AudioAlbumArtist: case HeaderMetadata.AudioAlbumArtist:
option.Column = (i, r) => this.GetListAsString(this.GetObject<Audio, List<string>>(i, (x) => x.AlbumArtists)); option.Column = (i, r) => this.GetListAsString(this.GetObject<Audio, List<string>>(i, (x) => x.AlbumArtists.ToList()));
option.Header.SortField = "AlbumArtist,Album,SortName"; option.Header.SortField = "AlbumArtist,Album,SortName";
internalHeader = HeaderMetadata.AlbumArtist; internalHeader = HeaderMetadata.AlbumArtist;
break; break;

View File

@ -126,7 +126,7 @@ namespace MediaBrowser.Api
await link.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await link.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
} }
video.LinkedAlternateVersions.Clear(); video.LinkedAlternateVersions = Video.EmptyLinkedChildArray;
await video.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await video.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
} }
@ -185,19 +185,23 @@ namespace MediaBrowser.Api
}).First(); }).First();
} }
var list = primaryVersion.LinkedAlternateVersions.ToList();
foreach (var item in items.Where(i => i.Id != primaryVersion.Id)) foreach (var item in items.Where(i => i.Id != primaryVersion.Id))
{ {
item.PrimaryVersionId = primaryVersion.Id.ToString("N"); item.PrimaryVersionId = primaryVersion.Id.ToString("N");
await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
primaryVersion.LinkedAlternateVersions.Add(new LinkedChild list.Add(new LinkedChild
{ {
Path = item.Path, Path = item.Path,
ItemId = item.Id ItemId = item.Id
}); });
} }
primaryVersion.LinkedAlternateVersions = list.ToArray();
await primaryVersion.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await primaryVersion.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
} }
} }

View File

@ -1,7 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Chapters namespace MediaBrowser.Controller.Chapters
@ -21,10 +19,6 @@ namespace MediaBrowser.Controller.Chapters
/// <summary> /// <summary>
/// Saves the chapters. /// Saves the chapters.
/// </summary> /// </summary>
/// <param name="itemId">The item identifier.</param> Task SaveChapters(string itemId, List<ChapterInfo> chapters);
/// <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);
} }
} }

View File

@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.Entities.Audio
public List<string> Artists { get; set; } public List<string> Artists { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public List<string> AlbumArtists { get; set; } public string[] AlbumArtists { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override bool EnableRefreshOnDateModifiedChange public override bool EnableRefreshOnDateModifiedChange
@ -43,7 +43,7 @@ namespace MediaBrowser.Controller.Entities.Audio
public Audio() public Audio()
{ {
Artists = new List<string>(); Artists = new List<string>();
AlbumArtists = new List<string>(); AlbumArtists = EmptyStringArray;
} }
public override double? GetDefaultPrimaryImageAspectRatio() public override double? GetDefaultPrimaryImageAspectRatio()

View File

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

View File

@ -19,13 +19,13 @@ namespace MediaBrowser.Controller.Entities.Audio
/// </summary> /// </summary>
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>, IMetadataContainer 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 List<string> Artists { get; set; }
public MusicAlbum() public MusicAlbum()
{ {
Artists = new List<string>(); Artists = new List<string>();
AlbumArtists = new List<string>(); AlbumArtists = EmptyStringArray;
} }
[IgnoreDataMember] [IgnoreDataMember]

View File

@ -44,7 +44,9 @@ namespace MediaBrowser.Controller.Entities
protected static Guid[] EmptyGuidArray = new Guid[] { }; protected static Guid[] EmptyGuidArray = new Guid[] { };
protected static MetadataFields[] EmptyMetadataFieldsArray = new MetadataFields[] { }; protected static MetadataFields[] EmptyMetadataFieldsArray = new MetadataFields[] { };
protected static string[] EmptyStringArray = new string[] { }; protected static string[] EmptyStringArray = new string[] { };
protected static MediaUrl[] EmptyMediaUrlArray = new MediaUrl[] { };
protected static ItemImageInfo[] EmptyItemImageInfoArray = new ItemImageInfo[] { }; protected static ItemImageInfo[] EmptyItemImageInfoArray = new ItemImageInfo[] { };
public static readonly LinkedChild[] EmptyLinkedChildArray = new LinkedChild[] { };
protected BaseItem() protected BaseItem()
{ {
@ -1169,7 +1171,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var newItems = LibraryManager.FindTrailers(this, fileSystemChildren, options.DirectoryService).ToList(); 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); var itemsChanged = !item.LocalTrailerIds.SequenceEqual(newItemIds);

View File

@ -249,7 +249,7 @@ namespace MediaBrowser.Controller.Entities
var changed = !linkedChildren.SequenceEqual(LinkedChildren, new LinkedChildComparer(FileSystem)); var changed = !linkedChildren.SequenceEqual(LinkedChildren, new LinkedChildComparer(FileSystem));
LinkedChildren = linkedChildren; LinkedChildren = linkedChildren.ToArray(linkedChildren.Count);
var folderIds = PhysicalFolderIds.ToList(); var folderIds = PhysicalFolderIds.ToList();
var newFolderIds = physicalFolders.Select(i => i.Id).ToList(); var newFolderIds = physicalFolders.Select(i => i.Id).ToList();

View File

@ -1,6 +1,7 @@
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using System; using System;
using System.Linq; using System.Linq;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
{ {
@ -12,11 +13,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary> /// <summary>
/// Adds the trailer URL. /// Adds the trailer URL.
/// </summary> /// </summary>
/// <param name="item">The item.</param> public static void AddTrailerUrl(this IHasTrailers item, string url)
/// <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)
{ {
if (string.IsNullOrWhiteSpace(url)) if (string.IsNullOrWhiteSpace(url))
{ {
@ -27,10 +24,22 @@ namespace MediaBrowser.Controller.Entities
if (current == null) if (current == null)
{ {
item.RemoteTrailers.Add(new MediaUrl var mediaUrl = new MediaUrl
{ {
Url = url 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> /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
public bool IsRoot { get; set; } public bool IsRoot { get; set; }
public virtual List<LinkedChild> LinkedChildren { get; set; } public LinkedChild[] LinkedChildren { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public DateTime? DateLastMediaAdded { get; set; } public DateTime? DateLastMediaAdded { get; set; }
public Folder() public Folder()
{ {
LinkedChildren = new List<LinkedChild>(); LinkedChildren = EmptyLinkedChildArray;
} }
[IgnoreDataMember] [IgnoreDataMember]
@ -707,7 +707,7 @@ namespace MediaBrowser.Controller.Entities
public virtual int GetChildCount(User user) public virtual int GetChildCount(User user)
{ {
if (LinkedChildren.Count > 0) if (LinkedChildren.Length > 0)
{ {
if (!(this is ICollectionFolder)) if (!(this is ICollectionFolder))
{ {
@ -844,7 +844,7 @@ namespace MediaBrowser.Controller.Entities
private bool RequiresPostFiltering(InternalItemsQuery query) private bool RequiresPostFiltering(InternalItemsQuery query)
{ {
if (LinkedChildren.Count > 0) if (LinkedChildren.Length > 0)
{ {
if (!(this is ICollectionFolder)) if (!(this is ICollectionFolder))
{ {
@ -1225,7 +1225,7 @@ namespace MediaBrowser.Controller.Entities
return GetLinkedChildren(); return GetLinkedChildren();
} }
if (LinkedChildren.Count == 0) if (LinkedChildren.Length == 0)
{ {
return new List<BaseItem>(); return new List<BaseItem>();
} }
@ -1314,14 +1314,9 @@ namespace MediaBrowser.Controller.Entities
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
protected virtual bool RefreshLinkedChildren(IEnumerable<FileSystemMetadata> fileSystemChildren) 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) if (SupportsShortcutChildren)
{ {
newShortcutLinks = fileSystemChildren var newShortcutLinks = fileSystemChildren
.Where(i => !i.IsDirectory && FileSystem.IsShortcut(i.FullName)) .Where(i => !i.IsDirectory && FileSystem.IsShortcut(i.FullName))
.Select(i => .Select(i =>
{ {
@ -1352,16 +1347,17 @@ namespace MediaBrowser.Controller.Entities
}) })
.Where(i => i != null) .Where(i => i != null)
.ToList(); .ToList();
}
else { newShortcutLinks = new List<LinkedChild>(); }
if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer(FileSystem))) var currentShortcutLinks = LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut).ToList();
{
Logger.Info("Shortcut links have changed for {0}", Path);
newShortcutLinks.AddRange(currentManualLinks); if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer(FileSystem)))
LinkedChildren = newShortcutLinks; {
return true; 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) foreach (var child in LinkedChildren)

View File

@ -14,13 +14,13 @@ namespace MediaBrowser.Controller.Entities
public Game() public Game()
{ {
MultiPartGameFiles = EmptyStringArray; MultiPartGameFiles = EmptyStringArray;
RemoteTrailers = new List<MediaUrl>(); RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = new List<Guid>(); LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = new List<Guid>(); RemoteTrailerIds = EmptyGuidArray;
} }
public List<Guid> LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public List<Guid> RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
public override bool CanDownload() public override bool CanDownload()
{ {
@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the remote trailers. /// Gets or sets the remote trailers.
/// </summary> /// </summary>
/// <value>The remote trailers.</value> /// <value>The remote trailers.</value>
public List<MediaUrl> RemoteTrailers { get; set; } public MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// Gets the type of the media. /// Gets the type of the media.
@ -127,16 +127,5 @@ namespace MediaBrowser.Controller.Entities
return id; 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. /// Gets or sets the remote trailers.
/// </summary> /// </summary>
/// <value>The remote trailers.</value> /// <value>The remote trailers.</value>
List<MediaUrl> RemoteTrailers { get; set; } MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// Gets or sets the local trailer ids. /// Gets or sets the local trailer ids.
/// </summary> /// </summary>
/// <value>The local trailer ids.</value> /// <value>The local trailer ids.</value>
List<Guid> LocalTrailerIds { get; set; } Guid[] LocalTrailerIds { get; set; }
List<Guid> RemoteTrailerIds { get; set; } Guid[] RemoteTrailerIds { get; set; }
} }
public static class HasTrailerExtensions public static class HasTrailerExtensions

View File

@ -21,9 +21,9 @@ namespace MediaBrowser.Controller.Entities.Movies
public BoxSet() public BoxSet()
{ {
RemoteTrailers = new List<MediaUrl>(); RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = new List<Guid>(); LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = new List<Guid>(); RemoteTrailerIds = EmptyGuidArray;
DisplayOrder = ItemSortBy.PremiereDate; DisplayOrder = ItemSortBy.PremiereDate;
Shares = new List<Share>(); Shares = new List<Share>();
@ -47,14 +47,14 @@ namespace MediaBrowser.Controller.Entities.Movies
} }
} }
public List<Guid> LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public List<Guid> RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
/// <summary> /// <summary>
/// Gets or sets the remote trailers. /// Gets or sets the remote trailers.
/// </summary> /// </summary>
/// <value>The remote trailers.</value> /// <value>The remote trailers.</value>
public List<MediaUrl> RemoteTrailers { get; set; } public MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// Gets or sets the display order. /// Gets or sets the display order.
@ -147,17 +147,6 @@ namespace MediaBrowser.Controller.Entities.Movies
return true; 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> /// <summary>
/// Updates the official rating based on content and returns true or false indicating if it changed. /// Updates the official rating based on content and returns true or false indicating if it changed.
/// </summary> /// </summary>

View File

@ -24,15 +24,15 @@ namespace MediaBrowser.Controller.Entities.Movies
public Movie() public Movie()
{ {
SpecialFeatureIds = new List<Guid>(); SpecialFeatureIds = new List<Guid>();
RemoteTrailers = new List<MediaUrl>(); RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = new List<Guid>(); LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = new List<Guid>(); RemoteTrailerIds = EmptyGuidArray;
} }
public List<Guid> LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public List<Guid> RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
public List<MediaUrl> RemoteTrailers { get; set; } public MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name of the TMDB collection. /// Gets or sets the name of the TMDB collection.

View File

@ -17,14 +17,14 @@ namespace MediaBrowser.Controller.Entities.TV
{ {
public Episode() public Episode()
{ {
RemoteTrailers = new List<MediaUrl>(); RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = new List<Guid>(); LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = new List<Guid>(); RemoteTrailerIds = EmptyGuidArray;
} }
public List<Guid> LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public List<Guid> RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
public List<MediaUrl> RemoteTrailers { get; set; } public MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// Gets the season in which it aired. /// Gets the season in which it aired.

View File

@ -24,9 +24,9 @@ namespace MediaBrowser.Controller.Entities.TV
{ {
AirDays = new List<DayOfWeek>(); AirDays = new List<DayOfWeek>();
RemoteTrailers = new List<MediaUrl>(); RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = new List<Guid>(); LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = new List<Guid>(); RemoteTrailerIds = EmptyGuidArray;
} }
[IgnoreDataMember] [IgnoreDataMember]
@ -62,10 +62,10 @@ namespace MediaBrowser.Controller.Entities.TV
} }
} }
public List<Guid> LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public List<Guid> RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
public List<MediaUrl> RemoteTrailers { get; set; } public MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// airdate, dvd or absolute /// airdate, dvd or absolute
@ -225,17 +225,6 @@ namespace MediaBrowser.Controller.Entities.TV
return list; 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] [IgnoreDataMember]
public bool ContainsEpisodesWithoutSeasonFolders public bool ContainsEpisodesWithoutSeasonFolders
{ {

View File

@ -31,9 +31,9 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public string PrimaryVersionId { get; set; } public string PrimaryVersionId { get; set; }
public List<string> AdditionalParts { get; set; } public string[] AdditionalParts { get; set; }
public List<string> LocalAlternateVersions { get; set; } public string[] LocalAlternateVersions { get; set; }
public List<LinkedChild> LinkedAlternateVersions { get; set; } public LinkedChild[] LinkedAlternateVersions { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus
@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the subtitle paths. /// Gets or sets the subtitle paths.
/// </summary> /// </summary>
/// <value>The subtitle paths.</value> /// <value>The subtitle paths.</value>
public List<string> SubtitleFiles { get; set; } public string[] SubtitleFiles { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance has subtitles. /// Gets or sets a value indicating whether this instance has subtitles.
@ -177,10 +177,10 @@ namespace MediaBrowser.Controller.Entities
public Video() public Video()
{ {
AdditionalParts = new List<string>(); AdditionalParts = EmptyStringArray;
LocalAlternateVersions = new List<string>(); LocalAlternateVersions = EmptyStringArray;
SubtitleFiles = new List<string>(); SubtitleFiles = EmptyStringArray;
LinkedAlternateVersions = new List<LinkedChild>(); LinkedAlternateVersions = EmptyLinkedChildArray;
} }
public override bool CanDownload() public override bool CanDownload()
@ -214,20 +214,20 @@ namespace MediaBrowser.Controller.Entities
return item.MediaSourceCount; return item.MediaSourceCount;
} }
} }
return LinkedAlternateVersions.Count + LocalAlternateVersions.Count + 1; return LinkedAlternateVersions.Length + LocalAlternateVersions.Length + 1;
} }
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsStacked public bool IsStacked
{ {
get { return AdditionalParts.Count > 0; } get { return AdditionalParts.Length > 0; }
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool HasLocalAlternateVersions public bool HasLocalAlternateVersions
{ {
get { return LocalAlternateVersions.Count > 0; } get { return LocalAlternateVersions.Length > 0; }
} }
public IEnumerable<Guid> GetAdditionalPartIds() public IEnumerable<Guid> GetAdditionalPartIds()

View File

@ -166,7 +166,6 @@
<Compile Include="LiveTv\TimerEventInfo.cs" /> <Compile Include="LiveTv\TimerEventInfo.cs" />
<Compile Include="LiveTv\TimerInfo.cs" /> <Compile Include="LiveTv\TimerInfo.cs" />
<Compile Include="LiveTv\TunerChannelMapping.cs" /> <Compile Include="LiveTv\TunerChannelMapping.cs" />
<Compile Include="MediaEncoding\ChapterImageRefreshOptions.cs" />
<Compile Include="MediaEncoding\EncodingHelper.cs" /> <Compile Include="MediaEncoding\EncodingHelper.cs" />
<Compile Include="MediaEncoding\EncodingJobInfo.cs" /> <Compile Include="MediaEncoding\EncodingJobInfo.cs" />
<Compile Include="MediaEncoding\EncodingJobOptions.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; 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) 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 System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.MediaEncoding namespace MediaBrowser.Controller.MediaEncoding
{ {
@ -8,9 +11,6 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <summary> /// <summary>
/// Refreshes the chapter images. /// Refreshes the chapter images.
/// </summary> /// </summary>
/// <param name="options">The options.</param> Task<bool> RefreshChapterImages(Video video, List<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken);
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{System.Boolean}.</returns>
Task<bool> RefreshChapterImages(ChapterImageRefreshOptions options, CancellationToken cancellationToken);
} }
} }

View File

@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.Persistence
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
IEnumerable<ChapterInfo> GetChapters(Guid id); List<ChapterInfo> GetChapters(Guid id);
/// <summary> /// <summary>
/// Gets a single chapter for an item /// Gets a single chapter for an item
@ -78,11 +78,7 @@ namespace MediaBrowser.Controller.Persistence
/// <summary> /// <summary>
/// Saves the chapters. /// Saves the chapters.
/// </summary> /// </summary>
/// <param name="id">The id.</param> Task SaveChapters(Guid id, List<ChapterInfo> chapters);
/// <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);
/// <summary> /// <summary>
/// Gets the media streams. /// Gets the media streams.

View File

@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Playlists
if (query != null) if (query != null)
{ {
items = items.Where(i => UserViewBuilder.FilterItem(i, query)); items = items.Where(i => UserViewBuilder.FilterItem(i, query)).ToList();
} }
return items; return items;
@ -116,12 +116,12 @@ namespace MediaBrowser.Controller.Playlists
return GetLinkedChildrenInfos(); 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); 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) if (user != null)
{ {

View File

@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Providers
/// Gets or sets the album artist. /// Gets or sets the album artist.
/// </summary> /// </summary>
/// <value>The album artist.</value> /// <value>The album artist.</value>
public List<string> AlbumArtists { get; set; } public string[] AlbumArtists { get; set; }
/// <summary> /// <summary>
/// Gets or sets the artist provider ids. /// Gets or sets the artist provider ids.
@ -22,7 +22,7 @@ namespace MediaBrowser.Controller.Providers
{ {
ArtistProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); ArtistProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
SongInfos = new List<SongInfo>(); SongInfos = new List<SongInfo>();
AlbumArtists = new List<string>(); AlbumArtists = EmptyStringArray;
} }
} }
} }

View File

@ -6,6 +6,8 @@ namespace MediaBrowser.Controller.Providers
{ {
public class ItemLookupInfo : IHasProviderIds public class ItemLookupInfo : IHasProviderIds
{ {
protected static string[] EmptyStringArray = new string[] { };
/// <summary> /// <summary>
/// Gets or sets the name. /// Gets or sets the name.
/// </summary> /// </summary>

View File

@ -4,14 +4,14 @@ namespace MediaBrowser.Controller.Providers
{ {
public class SongInfo : ItemLookupInfo public class SongInfo : ItemLookupInfo
{ {
public List<string> AlbumArtists { get; set; } public string[] AlbumArtists { get; set; }
public string Album { get; set; } public string Album { get; set; }
public List<string> Artists { get; set; } public List<string> Artists { get; set; }
public SongInfo() public SongInfo()
{ {
Artists = new List<string>(); Artists = new List<string>();
AlbumArtists = new List<string>(); AlbumArtists = EmptyStringArray;
} }
} }
} }

View File

@ -467,7 +467,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
{ {
if (!string.IsNullOrWhiteSpace(val)) if (!string.IsNullOrWhiteSpace(val))
{ {
hasTrailers.AddTrailerUrl(val, false); hasTrailers.AddTrailerUrl(val);
} }
} }
break; break;
@ -1030,7 +1030,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
if (!string.IsNullOrWhiteSpace(val)) if (!string.IsNullOrWhiteSpace(val))
{ {
item.AddTrailerUrl(val, false); item.AddTrailerUrl(val);
} }
break; break;
} }

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Xml; using System.Xml;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Xml; using MediaBrowser.Model.Xml;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.LocalMetadata.Parsers namespace MediaBrowser.LocalMetadata.Parsers
{ {
@ -84,7 +85,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
} }
} }
item.Item.LinkedChildren = list; item.Item.LinkedChildren = list.ToArray(list.Count);
} }
public BoxSetXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem) public BoxSetXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)

View File

@ -8,6 +8,7 @@ using System.Linq;
using System.Xml; using System.Xml;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Xml; using MediaBrowser.Model.Xml;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.LocalMetadata.Parsers namespace MediaBrowser.LocalMetadata.Parsers
{ {
@ -124,7 +125,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
} }
} }
item.LinkedChildren = list; item.LinkedChildren = list.ToArray(list.Count);
} }
private void FetchFromSharesNode(XmlReader reader, Playlist item) private void FetchFromSharesNode(XmlReader reader, Playlist item)

View File

@ -364,7 +364,7 @@ namespace MediaBrowser.LocalMetadata.Savers
var hasTrailers = item as IHasTrailers; var hasTrailers = item as IHasTrailers;
if (hasTrailers != null) if (hasTrailers != null)
{ {
if (hasTrailers.RemoteTrailers.Count > 0) if (hasTrailers.RemoteTrailers.Length > 0)
{ {
writer.WriteStartElement("Trailers"); writer.WriteStartElement("Trailers");

View File

@ -298,7 +298,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the trailer urls. /// Gets or sets the trailer urls.
/// </summary> /// </summary>
/// <value>The trailer urls.</value> /// <value>The trailer urls.</value>
public List<MediaUrl> RemoteTrailers { get; set; } public MediaUrl[] RemoteTrailers { get; set; }
/// <summary> /// <summary>
/// Gets or sets the provider ids. /// Gets or sets the provider ids.
@ -503,7 +503,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the album artists. /// Gets or sets the album artists.
/// </summary> /// </summary>
/// <value>The album artists.</value> /// <value>The album artists.</value>
public List<NameIdPair> AlbumArtists { get; set; } public NameIdPair[] AlbumArtists { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name of the season. /// Gets or sets the name of the season.

View File

@ -7,6 +7,8 @@ namespace MediaBrowser.Model.MediaInfo
{ {
public class MediaInfo : MediaSourceInfo, IHasProviderIds public class MediaInfo : MediaSourceInfo, IHasProviderIds
{ {
private static readonly string[] EmptyStringArray = new string[] { };
public List<ChapterInfo> Chapters { get; set; } public List<ChapterInfo> Chapters { get; set; }
/// <summary> /// <summary>
@ -23,7 +25,7 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the album artists. /// Gets or sets the album artists.
/// </summary> /// </summary>
/// <value>The album artists.</value> /// <value>The album artists.</value>
public List<string> AlbumArtists { get; set; } public string[] AlbumArtists { get; set; }
/// <summary> /// <summary>
/// Gets or sets the studios. /// Gets or sets the studios.
/// </summary> /// </summary>
@ -56,7 +58,7 @@ namespace MediaBrowser.Model.MediaInfo
{ {
Chapters = new List<ChapterInfo>(); Chapters = new List<ChapterInfo>();
Artists = new List<string>(); Artists = new List<string>();
AlbumArtists = new List<string>(); AlbumArtists = EmptyStringArray;
Studios = new List<string>(); Studios = new List<string>();
Genres = new List<string>(); Genres = new List<string>();
People = new List<BaseItemPerson>(); People = new List<BaseItemPerson>();

View File

@ -6,12 +6,9 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Providers.Manager; using MediaBrowser.Providers.Manager;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Providers.BoxSets namespace MediaBrowser.Providers.BoxSets
{ {
@ -48,7 +45,7 @@ namespace MediaBrowser.Providers.BoxSets
var linkedChildren = sourceItem.LinkedChildren.ToList(); var linkedChildren = sourceItem.LinkedChildren.ToList();
linkedChildren.AddRange(sourceItem.LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut)); linkedChildren.AddRange(sourceItem.LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut));
targetItem.LinkedChildren = linkedChildren; targetItem.LinkedChildren = linkedChildren.ToArray(linkedChildren.Count);
targetItem.Shares = sourceItem.Shares; targetItem.Shares = sourceItem.Shares;
} }
} }

View File

@ -39,9 +39,9 @@ namespace MediaBrowser.Providers.Chapters
return _itemRepo.GetChapters(new Guid(itemId)); return _itemRepo.GetChapters(new Guid(itemId));
} }
public Task SaveChapters(string itemId, List<ChapterInfo> chapters, CancellationToken cancellationToken) public Task SaveChapters(string itemId, List<ChapterInfo> chapters)
{ {
return _itemRepo.SaveChapters(new Guid(itemId), chapters, cancellationToken); return _itemRepo.SaveChapters(new Guid(itemId), chapters);
} }
} }
} }

View File

@ -284,7 +284,7 @@ namespace MediaBrowser.Providers.Manager
if (sourceHasAlbumArtist != null && targetHasAlbumArtist != null) if (sourceHasAlbumArtist != null && targetHasAlbumArtist != null)
{ {
if (replaceData || targetHasAlbumArtist.AlbumArtists.Count == 0) if (replaceData || targetHasAlbumArtist.AlbumArtists.Length == 0)
{ {
targetHasAlbumArtist.AlbumArtists = sourceHasAlbumArtist.AlbumArtists; targetHasAlbumArtist.AlbumArtists = sourceHasAlbumArtist.AlbumArtists;
} }
@ -306,7 +306,7 @@ namespace MediaBrowser.Providers.Manager
if (sourceCast != null && targetCast != null) if (sourceCast != null && targetCast != null)
{ {
if (replaceData || targetCast.RemoteTrailers.Count == 0) if (replaceData || targetCast.RemoteTrailers.Length == 0)
{ {
targetCast.RemoteTrailers = sourceCast.RemoteTrailers; targetCast.RemoteTrailers = sourceCast.RemoteTrailers;
} }

View File

@ -234,16 +234,9 @@ namespace MediaBrowser.Providers.MediaInfo
extractDuringScan = libraryOptions.ExtractChapterImagesDuringLibraryScan; extractDuringScan = libraryOptions.ExtractChapterImagesDuringLibraryScan;
} }
await _encodingManager.RefreshChapterImages(new ChapterImageRefreshOptions await _encodingManager.RefreshChapterImages(video, chapters, extractDuringScan, false, cancellationToken).ConfigureAwait(false);
{
Chapters = chapters,
Video = video,
ExtractImages = extractDuringScan,
SaveChapters = false
}, cancellationToken).ConfigureAwait(false); await _chapterManager.SaveChapters(video.Id.ToString(), chapters).ConfigureAwait(false);
await _chapterManager.SaveChapters(video.Id.ToString(), chapters, cancellationToken).ConfigureAwait(false);
} }
} }
@ -513,7 +506,7 @@ namespace MediaBrowser.Providers.MediaInfo
} }
} }
video.SubtitleFiles = externalSubtitleStreams.Select(i => i.Path).OrderBy(i => i).ToList(); video.SubtitleFiles = externalSubtitleStreams.Select(i => i.Path).OrderBy(i => i).ToArray();
currentStreams.AddRange(externalSubtitleStreams); currentStreams.AddRange(externalSubtitleStreams);
} }

View File

@ -318,7 +318,7 @@ namespace MediaBrowser.Providers.Movies
Url = string.Format("https://www.youtube.com/watch?v={0}", i.source), Url = string.Format("https://www.youtube.com/watch?v={0}", i.source),
Name = i.name Name = i.name
}).ToList(); }).ToArray();
} }
} }
} }

View File

@ -87,7 +87,7 @@ namespace MediaBrowser.Providers.Music
.SelectMany(i => i.AlbumArtists) .SelectMany(i => i.AlbumArtists)
.Distinct(StringComparer.OrdinalIgnoreCase) .Distinct(StringComparer.OrdinalIgnoreCase)
.OrderBy(i => i) .OrderBy(i => i)
.ToList(); .ToArray();
if (!item.AlbumArtists.SequenceEqual(artists, StringComparer.OrdinalIgnoreCase)) if (!item.AlbumArtists.SequenceEqual(artists, StringComparer.OrdinalIgnoreCase))
{ {

View File

@ -74,7 +74,7 @@ namespace MediaBrowser.Providers.Music
{ {
if (!string.IsNullOrWhiteSpace(result.strArtist)) if (!string.IsNullOrWhiteSpace(result.strArtist))
{ {
item.AlbumArtists = new List<string> { result.strArtist }; item.AlbumArtists = new string[] { result.strArtist };
} }
if (!string.IsNullOrEmpty(result.intYearReleased)) if (!string.IsNullOrEmpty(result.intYearReleased))

View File

@ -134,7 +134,7 @@ namespace MediaBrowser.Providers.TV
if (video.site.Equals("youtube", System.StringComparison.OrdinalIgnoreCase)) if (video.site.Equals("youtube", System.StringComparison.OrdinalIgnoreCase))
{ {
var videoUrl = string.Format("http://www.youtube.com/watch?v={0}", video.key); var videoUrl = string.Format("http://www.youtube.com/watch?v={0}", video.key);
item.AddTrailerUrl(videoUrl, true); item.AddTrailerUrl(videoUrl);
} }
} }
} }

View File

@ -302,7 +302,7 @@ namespace MediaBrowser.Providers.TV
if (video.site.Equals("youtube", System.StringComparison.OrdinalIgnoreCase)) if (video.site.Equals("youtube", System.StringComparison.OrdinalIgnoreCase))
{ {
var videoUrl = string.Format("http://www.youtube.com/watch?v={0}", video.key); var videoUrl = string.Format("http://www.youtube.com/watch?v={0}", video.key);
series.AddTrailerUrl(videoUrl, true); series.AddTrailerUrl(videoUrl);
} }
} }
} }

View File

@ -96,8 +96,8 @@
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="ServiceStack.Text, Version=4.5.12.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.12\lib\net45\ServiceStack.Text.dll</HintPath> <HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">

View File

@ -54,8 +54,9 @@
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.Text, Version=4.5.12.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.12\lib\net45\ServiceStack.Text.dll</HintPath> <HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath> <HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath>

View File

@ -2,7 +2,7 @@
<packages> <packages>
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" /> <package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
<package id="NLog" version="4.4.12" targetFramework="net46" /> <package id="NLog" version="4.4.12" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.12" targetFramework="net46" /> <package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SharpCompress" version="0.14.0" targetFramework="net46" /> <package id="SharpCompress" version="0.14.0" targetFramework="net46" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" /> <package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
<package id="SkiaSharp" version="1.58.0" targetFramework="net46" /> <package id="SkiaSharp" version="1.58.0" targetFramework="net46" />

View File

@ -76,8 +76,9 @@
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.Text, Version=4.5.12.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.12\lib\net45\ServiceStack.Text.dll</HintPath> <HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath> <HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.4.12" targetFramework="net462" /> <package id="NLog" version="4.4.12" targetFramework="net462" />
<package id="ServiceStack.Text" version="4.5.12" targetFramework="net462" /> <package id="ServiceStack.Text" version="4.5.8" targetFramework="net462" />
<package id="SharpCompress" version="0.14.0" targetFramework="net462" /> <package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net462" /> <package id="SimpleInjector" version="4.0.8" targetFramework="net462" />
<package id="SkiaSharp" version="1.58.0" targetFramework="net462" /> <package id="SkiaSharp" version="1.58.0" targetFramework="net462" />

View File

@ -599,7 +599,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
val = val.Replace("plugin://plugin.video.youtube/?action=play_video&videoid=", "https://www.youtube.com/watch?v=", StringComparison.OrdinalIgnoreCase); val = val.Replace("plugin://plugin.video.youtube/?action=play_video&videoid=", "https://www.youtube.com/watch?v=", StringComparison.OrdinalIgnoreCase);
hasTrailer.AddTrailerUrl(val, false); hasTrailer.AddTrailerUrl(val);
} }
} }
break; break;

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.681</version>
<title>Emby.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
<projectUrl>https://github.com/MediaBrowser/Emby</projectUrl>
<iconUrl>http://www.mb3admin.com/images/mb3icons1-1.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.680" />
<dependency id="NLog" version="4.3.8" />
<dependency id="SimpleInjector" version="3.2.2" />
</dependencies>
</metadata>
<files>
<file src="dlls\MediaBrowser.Common.Implementations.dll" target="lib\net45\MediaBrowser.Common.Implementations.dll" />
<file src="..\ThirdParty\ServiceStack.Text\ServiceStack.Text.dll" target="lib\net45\ServiceStack.Text.dll" />
</files>
</package>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.716</version> <version>3.0.717</version>
<title>Emby.Common</title> <title>Emby.Common</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.716</version> <version>3.0.717</version>
<title>Emby.Server.Core</title> <title>Emby.Server.Core</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description> <description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright> <copyright>Copyright © Emby 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.716" /> <dependency id="MediaBrowser.Common" version="3.0.717" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>