fixed image uploading for virtual items
This commit is contained in:
parent
032bf6b8c6
commit
4cd7030248
|
@ -361,7 +361,7 @@ namespace MediaBrowser.Api.Images
|
|||
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
index = 0;
|
||||
|
||||
foreach (var image in item.ScreenshotImagePaths)
|
||||
|
@ -422,7 +422,7 @@ namespace MediaBrowser.Api.Images
|
|||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified request.
|
||||
/// </summary>
|
||||
|
@ -765,7 +765,7 @@ namespace MediaBrowser.Api.Images
|
|||
}
|
||||
|
||||
// Don't save locally if there's no parent (special feature, trailer, etc)
|
||||
var saveLocally = (!(entity is Audio) && entity.Parent != null && !string.IsNullOrEmpty(entity.MetaLocation)) || entity is User;
|
||||
var saveLocally = !(entity is Audio) && entity.Parent != null && !string.IsNullOrEmpty(entity.MetaLocation) || entity is User;
|
||||
|
||||
if (imageType != ImageType.Primary)
|
||||
{
|
||||
|
@ -775,6 +775,11 @@ namespace MediaBrowser.Api.Images
|
|||
}
|
||||
}
|
||||
|
||||
if (entity.LocationType != LocationType.FileSystem)
|
||||
{
|
||||
saveLocally = false;
|
||||
}
|
||||
|
||||
var imagePath = _providerManager.GetSavePath(entity, filename + "." + extension, saveLocally);
|
||||
|
||||
// Save to file system
|
||||
|
|
|
@ -325,7 +325,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
item.AddTrailerUrl(val);
|
||||
//item.AddTrailerUrl(val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -336,10 +336,10 @@ namespace MediaBrowser.Controller.Providers
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
int ProductionYear;
|
||||
if (int.TryParse(val, out ProductionYear) && ProductionYear > 1850)
|
||||
int productionYear;
|
||||
if (int.TryParse(val, out productionYear) && productionYear > 1850)
|
||||
{
|
||||
item.ProductionYear = ProductionYear;
|
||||
item.ProductionYear = productionYear;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,10 @@ namespace MediaBrowser.Controller.Resolvers
|
|||
/// The third
|
||||
/// </summary>
|
||||
Third = 3,
|
||||
Fourth = 4,
|
||||
/// <summary>
|
||||
/// The last
|
||||
/// </summary>
|
||||
Last = 4
|
||||
Last = 5
|
||||
}
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ namespace MediaBrowser.Server.Implementations.Providers
|
|||
{
|
||||
return (saveLocally && item.MetaLocation != null) ?
|
||||
Path.Combine(item.MetaLocation, targetFileName) :
|
||||
_remoteImageCache.GetResourcePath(item.GetType().FullName + item.Path.ToLower(), targetFileName);
|
||||
_remoteImageCache.GetResourcePath(item.GetType().FullName + item.Id.ToString(), targetFileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue
Block a user