|
|
@ -202,14 +202,19 @@ namespace MediaBrowser.Api
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
Logger.Info("Setting provider id's to item {0}-{1}: {2}", item.Id, item.Name, _json.SerializeToString(request.ProviderIds));
|
|
|
|
Logger.Info("Setting provider id's to item {0}-{1}: {2}", item.Id, item.Name, _json.SerializeToString(request.ProviderIds));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Since the refresh process won't erase provider Ids, we need to set this explicitly now.
|
|
|
|
item.ProviderIds = request.ProviderIds;
|
|
|
|
item.ProviderIds = request.ProviderIds;
|
|
|
|
|
|
|
|
//item.ProductionYear = request.ProductionYear;
|
|
|
|
|
|
|
|
//item.Name = request.Name;
|
|
|
|
|
|
|
|
|
|
|
|
var task = _providerManager.RefreshFullItem(item, new MetadataRefreshOptions(_fileSystem)
|
|
|
|
var task = _providerManager.RefreshFullItem(item, new MetadataRefreshOptions(_fileSystem)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MetadataRefreshMode = MetadataRefreshMode.FullRefresh,
|
|
|
|
MetadataRefreshMode = MetadataRefreshMode.FullRefresh,
|
|
|
|
ImageRefreshMode = ImageRefreshMode.FullRefresh,
|
|
|
|
ImageRefreshMode = ImageRefreshMode.FullRefresh,
|
|
|
|
ReplaceAllMetadata = true,
|
|
|
|
ReplaceAllMetadata = true,
|
|
|
|
ReplaceAllImages = request.ReplaceAllImages
|
|
|
|
ReplaceAllImages = request.ReplaceAllImages,
|
|
|
|
|
|
|
|
SearchResult = request
|
|
|
|
|
|
|
|
|
|
|
|
}, CancellationToken.None);
|
|
|
|
}, CancellationToken.None);
|
|
|
|
Task.WaitAll(task);
|
|
|
|
Task.WaitAll(task);
|
|
|
@ -234,7 +239,7 @@ namespace MediaBrowser.Api
|
|
|
|
contentPath = await reader.ReadToEndAsync().ConfigureAwait(false);
|
|
|
|
contentPath = await reader.ReadToEndAsync().ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (_fileSystem.FileExists(contentPath))
|
|
|
|
if (_fileSystem.FileExists(contentPath))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ToStaticFileResult(contentPath);
|
|
|
|
return ToStaticFileResult(contentPath);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -275,7 +280,7 @@ namespace MediaBrowser.Api
|
|
|
|
|
|
|
|
|
|
|
|
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
|
|
|
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
|
|
|
|
|
|
|
|
|
|
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(fullCachePath));
|
|
|
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(fullCachePath));
|
|
|
|
using (var stream = result.Content)
|
|
|
|
using (var stream = result.Content)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
|
|
|
|
using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
|
|
|
@ -284,7 +289,7 @@ namespace MediaBrowser.Api
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
|
|
|
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
|
|
|
|
using (var writer = new StreamWriter(pointerCachePath))
|
|
|
|
using (var writer = new StreamWriter(pointerCachePath))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await writer.WriteAsync(fullCachePath).ConfigureAwait(false);
|
|
|
|
await writer.WriteAsync(fullCachePath).ConfigureAwait(false);
|
|
|
|