mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
revert servicestack.text update
This commit is contained in:
@@ -1344,7 +1344,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
var hasAlbumArtists = item as IHasAlbumArtist;
|
||||
if (hasAlbumArtists != null)
|
||||
{
|
||||
hasAlbumArtists.AlbumArtists = info.AlbumArtists;
|
||||
hasAlbumArtists.AlbumArtists = info.AlbumArtists.ToArray(info.AlbumArtists.Count);
|
||||
}
|
||||
|
||||
var trailer = item as Trailer;
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
||||
namespace Emby.Server.Implementations.Collections
|
||||
{
|
||||
@@ -190,7 +191,9 @@ namespace Emby.Server.Implementations.Collections
|
||||
|
||||
if (list.Count > 0)
|
||||
{
|
||||
collection.LinkedChildren.AddRange(list);
|
||||
var newList = collection.LinkedChildren.ToList();
|
||||
newList.AddRange(list);
|
||||
collection.LinkedChildren = newList.ToArray(newList.Count);
|
||||
|
||||
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();
|
||||
|
||||
@@ -1037,9 +1037,9 @@ namespace Emby.Server.Implementations.Data
|
||||
var hasAlbumArtists = item as IHasAlbumArtist;
|
||||
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);
|
||||
@@ -1927,7 +1927,7 @@ namespace Emby.Server.Implementations.Data
|
||||
var hasAlbumArtists = item as IHasAlbumArtist;
|
||||
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++;
|
||||
}
|
||||
@@ -1995,7 +1995,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <param name="id">The id.</param>
|
||||
/// <returns>IEnumerable{ChapterInfo}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">id</exception>
|
||||
public IEnumerable<ChapterInfo> GetChapters(Guid id)
|
||||
public List<ChapterInfo> GetChapters(Guid id)
|
||||
{
|
||||
CheckDisposed();
|
||||
if (id == Guid.Empty)
|
||||
@@ -2091,18 +2091,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <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>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// id
|
||||
/// or
|
||||
/// chapters
|
||||
/// or
|
||||
/// cancellationToken
|
||||
/// </exception>
|
||||
public async Task SaveChapters(Guid id, List<ChapterInfo> chapters, CancellationToken cancellationToken)
|
||||
public async Task SaveChapters(Guid id, List<ChapterInfo> chapters)
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
@@ -2116,8 +2105,6 @@ namespace Emby.Server.Implementations.Data
|
||||
throw new ArgumentNullException("chapters");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var index = 0;
|
||||
|
||||
using (WriteLock.Write())
|
||||
@@ -2826,7 +2813,7 @@ namespace Emby.Server.Implementations.Data
|
||||
var slowThreshold = 1000;
|
||||
|
||||
#if DEBUG
|
||||
slowThreshold = 2;
|
||||
slowThreshold = 10;
|
||||
#endif
|
||||
|
||||
if (elapsed >= slowThreshold)
|
||||
|
||||
@@ -993,7 +993,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
{
|
||||
dto.RemoteTrailers = hasTrailers != null ?
|
||||
hasTrailers.RemoteTrailers :
|
||||
new List<MediaUrl>();
|
||||
new MediaUrl[] {};
|
||||
}
|
||||
|
||||
dto.Name = item.Name;
|
||||
@@ -1172,8 +1172,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
// })
|
||||
// .ToList();
|
||||
|
||||
dto.AlbumArtists = new List<NameIdPair>();
|
||||
dto.AlbumArtists.AddRange(hasAlbumArtist.AlbumArtists
|
||||
dto.AlbumArtists = hasAlbumArtist.AlbumArtists
|
||||
//.Except(foundArtists, new DistinctNameComparer())
|
||||
.Select(i =>
|
||||
{
|
||||
@@ -1198,7 +1197,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
|
||||
return null;
|
||||
|
||||
}).Where(i => i != null));
|
||||
}).Where(i => i != null).ToArray();
|
||||
}
|
||||
|
||||
// Add video info
|
||||
@@ -1214,9 +1213,9 @@ namespace Emby.Server.Implementations.Dto
|
||||
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))
|
||||
|
||||
@@ -367,8 +367,9 @@
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Text, Version=4.5.12.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ServiceStack.Text.4.5.12\lib\net45\ServiceStack.Text.dll</HintPath>
|
||||
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<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>
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Emby.Server.Implementations.Library
|
||||
});
|
||||
|
||||
var trailerIds = trailers.Select(i => i.Id)
|
||||
.ToList();
|
||||
.ToArray();
|
||||
|
||||
if (!trailerIds.SequenceEqual(item.RemoteTrailerIds))
|
||||
{
|
||||
|
||||
@@ -159,8 +159,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
||||
IsInMixedFolder = isInMixedFolder,
|
||||
ProductionYear = video.Year,
|
||||
Name = video.Name,
|
||||
AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToList(),
|
||||
LocalAlternateVersions = video.AlternateVersions.Select(i => i.Path).ToList()
|
||||
AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToArray(),
|
||||
LocalAlternateVersions = video.AlternateVersions.Select(i => i.Path).ToArray()
|
||||
};
|
||||
|
||||
SetVideoType(videoItem, firstVideo);
|
||||
@@ -503,7 +503,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
||||
{
|
||||
Path = folderPaths[0],
|
||||
|
||||
AdditionalParts = folderPaths.Skip(1).ToList(),
|
||||
AdditionalParts = folderPaths.Skip(1).ToArray(),
|
||||
|
||||
VideoType = videoTypes[0],
|
||||
|
||||
|
||||
@@ -84,13 +84,8 @@ namespace Emby.Server.Implementations.MediaEncoder
|
||||
/// </summary>
|
||||
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))
|
||||
{
|
||||
extractImages = false;
|
||||
@@ -179,7 +174,7 @@ namespace Emby.Server.Implementations.MediaEncoder
|
||||
|
||||
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);
|
||||
|
||||
@@ -12,10 +12,9 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
||||
namespace Emby.Server.Implementations.Playlists
|
||||
{
|
||||
@@ -164,7 +163,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||
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);
|
||||
|
||||
@@ -206,7 +205,9 @@ namespace Emby.Server.Implementations.Playlists
|
||||
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);
|
||||
|
||||
@@ -234,7 +235,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||
|
||||
playlist.LinkedChildren = children.Except(removals)
|
||||
.Select(i => i.Item1)
|
||||
.ToList();
|
||||
.ToArray();
|
||||
|
||||
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
@@ -265,17 +266,21 @@ namespace Emby.Server.Implementations.Playlists
|
||||
|
||||
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
|
||||
{
|
||||
playlist.LinkedChildren.Insert(newIndex, item);
|
||||
newList.Insert(newIndex, item);
|
||||
}
|
||||
|
||||
playlist.LinkedChildren = newList.ToArray(newList.Count);
|
||||
|
||||
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,16 +124,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
try
|
||||
{
|
||||
var chapters = _itemRepo.GetChapters(video.Id).ToList();
|
||||
var chapters = _itemRepo.GetChapters(video.Id);
|
||||
|
||||
var success = await _encodingManager.RefreshChapterImages(new ChapterImageRefreshOptions
|
||||
{
|
||||
SaveChapters = true,
|
||||
ExtractImages = extract,
|
||||
Video = video,
|
||||
Chapters = chapters
|
||||
|
||||
}, CancellationToken.None);
|
||||
var success = await _encodingManager.RefreshChapterImages(video, chapters, extract, true, CancellationToken.None);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<package id="Emby.XmlTv" version="1.0.9" targetFramework="net46" />
|
||||
<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="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="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net46" />
|
||||
|
||||
Reference in New Issue
Block a user