improve handling of deleted images

pull/702/head
Luke Pulverenti 9 years ago
parent 4936ebf74c
commit 67f9a986a7

@ -359,12 +359,13 @@ namespace MediaBrowser.Providers.Manager
private void ClearImages(IHasImages item, ImageType type)
{
var deleted = false;
var deletedImages = new List<ItemImageInfo>();
foreach (var image in item.GetImages(type).ToList())
{
if (!image.IsLocalFile)
{
// TODO: Need to get this image removed
deletedImages.Add(image);
continue;
}
@ -384,6 +385,11 @@ namespace MediaBrowser.Providers.Manager
}
}
foreach (var image in deletedImages)
{
item.RemoveImage(image);
}
if (deleted)
{
item.ValidateImages(new DirectoryService(_logger, _fileSystem));

@ -15,6 +15,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
@ -130,6 +131,8 @@ namespace MediaBrowser.Providers.Subtitles
try
{
//var isText = MediaStream.IsTextFormat(response.Format);
using (var fs = _fileSystem.GetFileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
{
await stream.CopyToAsync(fs).ConfigureAwait(false);

Loading…
Cancel
Save