mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
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++;
|
||||||
}
|
}
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
||||||
foreach (var image in item.ScreenshotImagePaths)
|
foreach (var image in item.ScreenshotImagePaths)
|
||||||
@ -422,7 +422,7 @@ namespace MediaBrowser.Api.Images
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified request.
|
/// Gets the specified request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -765,7 +765,7 @@ namespace MediaBrowser.Api.Images
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Don't save locally if there's no parent (special feature, trailer, etc)
|
// 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)
|
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);
|
var imagePath = _providerManager.GetSavePath(entity, filename + "." + extension, saveLocally);
|
||||||
|
|
||||||
// Save to file system
|
// Save to file system
|
||||||
|
@ -325,7 +325,7 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
item.AddTrailerUrl(val);
|
//item.AddTrailerUrl(val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -336,10 +336,10 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(val))
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
{
|
{
|
||||||
int ProductionYear;
|
int productionYear;
|
||||||
if (int.TryParse(val, out ProductionYear) && ProductionYear > 1850)
|
if (int.TryParse(val, out productionYear) && productionYear > 1850)
|
||||||
{
|
{
|
||||||
item.ProductionYear = ProductionYear;
|
item.ProductionYear = productionYear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,9 +18,10 @@ namespace MediaBrowser.Controller.Resolvers
|
|||||||
/// The third
|
/// The third
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Third = 3,
|
Third = 3,
|
||||||
|
Fourth = 4,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The last
|
/// The last
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Last = 4
|
Last = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ namespace MediaBrowser.Server.Implementations.Providers
|
|||||||
{
|
{
|
||||||
return (saveLocally && item.MetaLocation != null) ?
|
return (saveLocally && item.MetaLocation != null) ?
|
||||||
Path.Combine(item.MetaLocation, targetFileName) :
|
Path.Combine(item.MetaLocation, targetFileName) :
|
||||||
_remoteImageCache.GetResourcePath(item.GetType().FullName + item.Path.ToLower(), targetFileName);
|
_remoteImageCache.GetResourcePath(item.GetType().FullName + item.Id.ToString(), targetFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user