mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
update schedules direct page
This commit is contained in:
@@ -53,10 +53,23 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
return ItemUpdateType.None;
|
||||
}
|
||||
|
||||
var primaryResult = await FetchAsync(item, ImageType.Primary, options, cancellationToken).ConfigureAwait(false);
|
||||
var thumbResult = await FetchAsync(item, ImageType.Thumb, options, cancellationToken).ConfigureAwait(false);
|
||||
var updateType = ItemUpdateType.None;
|
||||
var supportedImages = GetSupportedImages(item).ToList();
|
||||
|
||||
return primaryResult | thumbResult;
|
||||
if (supportedImages.Contains(ImageType.Primary))
|
||||
{
|
||||
var primaryResult = await FetchAsync(item, ImageType.Primary, options, cancellationToken).ConfigureAwait(false);
|
||||
updateType = updateType | primaryResult;
|
||||
}
|
||||
|
||||
if (supportedImages.Contains(ImageType.Thumb))
|
||||
{
|
||||
var thumbResult = await FetchAsync(item, ImageType.Thumb, options, cancellationToken).ConfigureAwait(false);
|
||||
updateType = updateType | thumbResult;
|
||||
}
|
||||
|
||||
|
||||
return updateType;
|
||||
}
|
||||
|
||||
protected async Task<ItemUpdateType> FetchAsync(IHasImages item, ImageType imageType, MetadataRefreshOptions options, CancellationToken cancellationToken)
|
||||
@@ -168,7 +181,7 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
return false;
|
||||
}
|
||||
|
||||
var drawText = !(item is UserView);
|
||||
var drawText = !(item is UserView) && !(item is ICollectionFolder);
|
||||
|
||||
if (imageType == ImageType.Thumb)
|
||||
{
|
||||
@@ -181,14 +194,11 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
{
|
||||
return await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
}
|
||||
else if (item is PhotoAlbum || item is Playlist)
|
||||
if (item is PhotoAlbum || item is Playlist)
|
||||
{
|
||||
return await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return await CreatePosterCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
|
||||
}
|
||||
return await CreatePosterCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
throw new ArgumentException("Unexpected image type");
|
||||
@@ -203,15 +213,35 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item is UserView)
|
||||
var supportedImages = GetSupportedImages(item).ToList();
|
||||
|
||||
if (item is UserView || item is ICollectionFolder)
|
||||
{
|
||||
return HasChanged(item, ImageType.Primary);
|
||||
if (supportedImages.Contains(ImageType.Primary) && HasChanged(item, ImageType.Primary))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (supportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var items = GetItemsWithImages(item).Result;
|
||||
var cacheKey = GetConfigurationCacheKey(items, item.Name);
|
||||
|
||||
return HasChanged(item, ImageType.Primary, cacheKey) || HasChanged(item, ImageType.Thumb, cacheKey);
|
||||
if (supportedImages.Contains(ImageType.Primary) && HasChanged(item, ImageType.Primary, cacheKey))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (supportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb, cacheKey))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected bool HasChanged(IHasImages item, ImageType type, string cacheKey)
|
||||
|
||||
Reference in New Issue
Block a user