mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
commit
d52ee1e637
10 changed files with 213 additions and 90 deletions
|
@ -432,17 +432,12 @@ namespace Emby.Drawing
|
||||||
return GetResult(croppedImagePath);
|
return GetResult(croppedImagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageProcessingLockTaken = false;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(croppedImagePath));
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(croppedImagePath));
|
||||||
var tmpPath = Path.ChangeExtension(Path.Combine(_appPaths.TempDirectory, Guid.NewGuid().ToString("N")), Path.GetExtension(croppedImagePath));
|
var tmpPath = Path.ChangeExtension(Path.Combine(_appPaths.TempDirectory, Guid.NewGuid().ToString("N")), Path.GetExtension(croppedImagePath));
|
||||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(tmpPath));
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(tmpPath));
|
||||||
|
|
||||||
await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
|
|
||||||
imageProcessingLockTaken = true;
|
|
||||||
|
|
||||||
_imageEncoder.CropWhiteSpace(originalImagePath, tmpPath);
|
_imageEncoder.CropWhiteSpace(originalImagePath, tmpPath);
|
||||||
CopyFile(tmpPath, croppedImagePath);
|
CopyFile(tmpPath, croppedImagePath);
|
||||||
return GetResult(tmpPath);
|
return GetResult(tmpPath);
|
||||||
|
@ -459,13 +454,6 @@ namespace Emby.Drawing
|
||||||
|
|
||||||
return new Tuple<string, DateTime>(originalImagePath, dateModified);
|
return new Tuple<string, DateTime>(originalImagePath, dateModified);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (imageProcessingLockTaken)
|
|
||||||
{
|
|
||||||
_imageProcessingSemaphore.Release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Tuple<string, DateTime> GetResult(string path)
|
private Tuple<string, DateTime> GetResult(string path)
|
||||||
|
@ -903,10 +891,6 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task CreateImageCollage(ImageCollageOptions options)
|
public async Task CreateImageCollage(ImageCollageOptions options)
|
||||||
{
|
|
||||||
await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
_logger.Info("Creating image collage and saving to {0}", options.OutputPath);
|
_logger.Info("Creating image collage and saving to {0}", options.OutputPath);
|
||||||
|
|
||||||
|
@ -914,11 +898,6 @@ namespace Emby.Drawing
|
||||||
|
|
||||||
_logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
|
_logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
_imageProcessingSemaphore.Release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType)
|
public IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -149,6 +149,11 @@ namespace Emby.Server.Implementations.Images
|
||||||
|
|
||||||
var mimeType = MimeTypes.GetMimeType(outputPath);
|
var mimeType = MimeTypes.GetMimeType(outputPath);
|
||||||
|
|
||||||
|
if (string.Equals(mimeType, "application/octet-stream", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
mimeType = "image/png";
|
||||||
|
}
|
||||||
|
|
||||||
await ProviderManager.SaveImage(item, outputPath, mimeType, imageType, null, false, cancellationToken).ConfigureAwait(false);
|
await ProviderManager.SaveImage(item, outputPath, mimeType, imageType, null, false, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
return ItemUpdateType.ImageUpdate;
|
return ItemUpdateType.ImageUpdate;
|
||||||
|
|
|
@ -1069,6 +1069,11 @@ namespace Emby.Server.Implementations.Library
|
||||||
{
|
{
|
||||||
_logger.Info("Validating media library");
|
_logger.Info("Validating media library");
|
||||||
|
|
||||||
|
// Ensure these objects are lazy loaded.
|
||||||
|
// Without this there is a deadlock that will need to be investigated
|
||||||
|
var rootChildren = RootFolder.Children.ToList();
|
||||||
|
rootChildren = GetUserRootFolder().Children.ToList();
|
||||||
|
|
||||||
await RootFolder.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
await RootFolder.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
progress.Report(.5);
|
progress.Report(.5);
|
||||||
|
|
|
@ -151,38 +151,22 @@ namespace Emby.Server.Implementations.UserViews
|
||||||
string[] collectionStripViewTypes =
|
string[] collectionStripViewTypes =
|
||||||
{
|
{
|
||||||
CollectionType.Movies,
|
CollectionType.Movies,
|
||||||
CollectionType.TvShows,
|
CollectionType.TvShows
|
||||||
CollectionType.Music,
|
|
||||||
CollectionType.Games,
|
|
||||||
CollectionType.Books,
|
|
||||||
CollectionType.MusicVideos,
|
|
||||||
CollectionType.HomeVideos,
|
|
||||||
CollectionType.BoxSets,
|
|
||||||
CollectionType.LiveTv,
|
|
||||||
CollectionType.Playlists,
|
|
||||||
CollectionType.Photos,
|
|
||||||
string.Empty
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return collectionStripViewTypes.Contains(view.ViewType ?? string.Empty);
|
return collectionStripViewTypes.Contains(view.ViewType ?? string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task<string> CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
protected override async Task<string> CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||||
{
|
|
||||||
var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ".png");
|
|
||||||
|
|
||||||
var view = (UserView)item;
|
|
||||||
if (imageType == ImageType.Primary && IsUsingCollectionStrip(view))
|
|
||||||
{
|
{
|
||||||
if (itemsWithImages.Count == 0)
|
if (itemsWithImages.Count == 0)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ".png");
|
||||||
|
|
||||||
return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540).ConfigureAwait(false);
|
return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await base.CreateImage(item, itemsWithImages, outputPath, imageType, imageIndex).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,9 +114,10 @@ namespace MediaBrowser.Providers.People
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -142,6 +143,10 @@ namespace MediaBrowser.Providers.People
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,12 +163,14 @@ namespace MediaBrowser.Providers.People
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
private RemoteImageInfo FetchImageInfoFromActorNode(string personName, XmlReader reader)
|
private RemoteImageInfo FetchImageInfoFromActorNode(string personName, XmlReader reader)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
|
||||||
|
|
||||||
string name = null;
|
string name = null;
|
||||||
string image = null;
|
string image = null;
|
||||||
|
|
||||||
while (reader.Read())
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -186,6 +193,10 @@ namespace MediaBrowser.Providers.People
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(image) &&
|
if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(image) &&
|
||||||
|
|
|
@ -340,9 +340,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -368,6 +369,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,16 +395,15 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
switch (reader.Name)
|
switch (reader.Name)
|
||||||
{
|
{
|
||||||
|
|
||||||
case "FirstAired":
|
case "FirstAired":
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
var val = reader.ReadElementContentAsString();
|
||||||
|
@ -423,6 +427,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,12 +446,13 @@ namespace MediaBrowser.Providers.TV
|
||||||
// Use XmlReader for best performance
|
// Use XmlReader for best performance
|
||||||
using (reader)
|
using (reader)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
|
||||||
|
|
||||||
result.ResetPeople();
|
result.ResetPeople();
|
||||||
|
|
||||||
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -506,11 +515,11 @@ namespace MediaBrowser.Providers.TV
|
||||||
}
|
}
|
||||||
|
|
||||||
case "EpisodeNumber":
|
case "EpisodeNumber":
|
||||||
{
|
|
||||||
if (!item.IndexNumber.HasValue)
|
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
var val = reader.ReadElementContentAsString();
|
||||||
|
|
||||||
|
if (!item.IndexNumber.HasValue)
|
||||||
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
int rval;
|
int rval;
|
||||||
|
@ -527,11 +536,11 @@ namespace MediaBrowser.Providers.TV
|
||||||
}
|
}
|
||||||
|
|
||||||
case "SeasonNumber":
|
case "SeasonNumber":
|
||||||
{
|
|
||||||
if (!item.ParentIndexNumber.HasValue)
|
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
var val = reader.ReadElementContentAsString();
|
||||||
|
|
||||||
|
if (!item.ParentIndexNumber.HasValue)
|
||||||
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
int rval;
|
int rval;
|
||||||
|
@ -621,9 +630,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
|
|
||||||
case "EpisodeName":
|
case "EpisodeName":
|
||||||
{
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
if (!item.LockedFields.Contains(MetadataFields.Name))
|
if (!item.LockedFields.Contains(MetadataFields.Name))
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
item.Name = val;
|
item.Name = val;
|
||||||
|
@ -634,9 +643,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
|
|
||||||
case "Overview":
|
case "Overview":
|
||||||
{
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
if (!item.LockedFields.Contains(MetadataFields.Overview))
|
if (!item.LockedFields.Contains(MetadataFields.Overview))
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
item.Overview = val;
|
item.Overview = val;
|
||||||
|
@ -756,6 +765,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -809,9 +822,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (reader)
|
using (reader)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -821,9 +835,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
{
|
{
|
||||||
case "EpisodeName":
|
case "EpisodeName":
|
||||||
{
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
if (!item.LockedFields.Contains(MetadataFields.Name))
|
if (!item.LockedFields.Contains(MetadataFields.Name))
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
item.Name += ", " + val;
|
item.Name += ", " + val;
|
||||||
|
@ -834,9 +848,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
|
|
||||||
case "Overview":
|
case "Overview":
|
||||||
{
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
if (!item.LockedFields.Contains(MetadataFields.Overview))
|
if (!item.LockedFields.Contains(MetadataFields.Overview))
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
item.Overview += Environment.NewLine + Environment.NewLine + val;
|
item.Overview += Environment.NewLine + Environment.NewLine + val;
|
||||||
|
@ -892,6 +906,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,9 +126,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -149,6 +150,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,7 +200,11 @@ namespace MediaBrowser.Providers.TV
|
||||||
int? voteCount = null;
|
int? voteCount = null;
|
||||||
string thumbnailUrl = null;
|
string thumbnailUrl = null;
|
||||||
|
|
||||||
while (reader.Read())
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -296,6 +305,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(url) && bannerSeason.HasValue && bannerSeason.Value == seasonNumber)
|
if (!string.IsNullOrEmpty(url) && bannerSeason.HasValue && bannerSeason.Value == seasonNumber)
|
||||||
|
|
|
@ -113,9 +113,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -136,6 +137,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +186,11 @@ namespace MediaBrowser.Providers.TV
|
||||||
int? voteCount = null;
|
int? voteCount = null;
|
||||||
string thumbnailUrl = null;
|
string thumbnailUrl = null;
|
||||||
|
|
||||||
while (reader.Read())
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -283,6 +292,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(url) && !bannerSeason.HasValue)
|
if (!string.IsNullOrEmpty(url) && !bannerSeason.HasValue)
|
||||||
|
|
|
@ -303,9 +303,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -324,6 +325,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -541,9 +546,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -570,6 +576,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -594,8 +604,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
string seriesId = null;
|
string seriesId = null;
|
||||||
|
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
while (reader.Read())
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -675,6 +687,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var title in titles)
|
foreach (var title in titles)
|
||||||
|
@ -770,9 +786,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -808,6 +825,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -825,9 +846,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
int? seasonNumber = null;
|
int? seasonNumber = null;
|
||||||
|
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -874,6 +896,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seasonNumber.HasValue && seasonNumber.Value != 0)
|
if (seasonNumber.HasValue && seasonNumber.Value != 0)
|
||||||
|
@ -905,9 +931,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -926,6 +953,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -943,7 +974,11 @@ namespace MediaBrowser.Providers.TV
|
||||||
|
|
||||||
var personInfo = new PersonInfo();
|
var personInfo = new PersonInfo();
|
||||||
|
|
||||||
while (reader.Read())
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -963,6 +998,7 @@ namespace MediaBrowser.Providers.TV
|
||||||
|
|
||||||
case "id":
|
case "id":
|
||||||
{
|
{
|
||||||
|
reader.Skip();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,6 +1034,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
personInfo.Type = PersonType.Actor;
|
personInfo.Type = PersonType.Actor;
|
||||||
|
@ -1013,9 +1053,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
Series item = result.Item;
|
Series item = result.Item;
|
||||||
|
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -1241,6 +1282,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1267,9 +1312,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -1288,6 +1334,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1313,9 +1363,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
using (var reader = XmlReader.Create(streamReader, settings))
|
using (var reader = XmlReader.Create(streamReader, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -1374,6 +1425,10 @@ namespace MediaBrowser.Providers.TV
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,9 +120,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
item.ResetPeople();
|
item.ResetPeople();
|
||||||
|
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -130,6 +131,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
{
|
{
|
||||||
FetchDataFromXmlNode(reader, item);
|
FetchDataFromXmlNode(reader, item);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,9 +200,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
using (var reader = XmlReader.Create(ms, settings))
|
using (var reader = XmlReader.Create(ms, settings))
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
// Loop through each element
|
// Loop through each element
|
||||||
while (reader.Read())
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
@ -205,6 +211,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
{
|
{
|
||||||
FetchDataFromXmlNode(reader, item);
|
FetchDataFromXmlNode(reader, item);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -944,8 +954,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
private void FetchFromResumeNode(XmlReader reader, T item, UserItemData userData)
|
private void FetchFromResumeNode(XmlReader reader, T item, UserItemData userData)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
while (reader.Read())
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -971,14 +983,20 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FetchFromFileInfoNode(XmlReader reader, T item)
|
private void FetchFromFileInfoNode(XmlReader reader, T item)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
while (reader.Read())
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -998,14 +1016,20 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FetchFromStreamDetailsNode(XmlReader reader, T item)
|
private void FetchFromStreamDetailsNode(XmlReader reader, T item)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
while (reader.Read())
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -1025,14 +1049,20 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FetchFromVideoNode(XmlReader reader, T item)
|
private void FetchFromVideoNode(XmlReader reader, T item)
|
||||||
{
|
{
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
while (reader.Read())
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -1040,12 +1070,12 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
{
|
{
|
||||||
case "format3d":
|
case "format3d":
|
||||||
{
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
|
|
||||||
var video = item as Video;
|
var video = item as Video;
|
||||||
|
|
||||||
if (video != null)
|
if (video != null)
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
|
||||||
|
|
||||||
if (string.Equals("HSBS", val, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals("HSBS", val, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
video.Video3DFormat = Video3DFormat.HalfSideBySide;
|
video.Video3DFormat = Video3DFormat.HalfSideBySide;
|
||||||
|
@ -1075,6 +1105,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,8 +1125,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
int? sortOrder = null;
|
int? sortOrder = null;
|
||||||
|
|
||||||
reader.MoveToContent();
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
while (reader.Read())
|
// Loop through each element
|
||||||
|
while (!reader.EOF)
|
||||||
{
|
{
|
||||||
if (reader.NodeType == XmlNodeType.Element)
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
{
|
{
|
||||||
|
@ -1143,6 +1179,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PersonInfo
|
return new PersonInfo
|
||||||
|
|
Loading…
Reference in a new issue