mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-06 07:04:13 -04:00
Changed how covers are merged together. Now a cover image will always be generated for reading list and collections. Fixed reading list page being a bit laggy due to a missing trackby function. Reading list page will now show the cover image always. Collection detail page will only hide the image if there is no summary on the collection.
37 lines
782 B
C#
37 lines
782 B
C#
namespace API.Entities.Enums;
|
|
|
|
public enum CoverImageSize
|
|
{
|
|
/// <summary>
|
|
/// Default Size: 320x455 (wxh)
|
|
/// </summary>
|
|
Default = 1,
|
|
/// <summary>
|
|
/// 640x909
|
|
/// </summary>
|
|
Medium = 2,
|
|
/// <summary>
|
|
/// 900x1277
|
|
/// </summary>
|
|
Large = 3,
|
|
/// <summary>
|
|
/// 1265x1795
|
|
/// </summary>
|
|
XLarge = 4
|
|
}
|
|
|
|
public static class CoverImageSizeExtensions
|
|
{
|
|
public static (int Width, int Height) GetDimensions(this CoverImageSize size)
|
|
{
|
|
return size switch
|
|
{
|
|
CoverImageSize.Default => (320, 455),
|
|
CoverImageSize.Medium => (640, 909),
|
|
CoverImageSize.Large => (900, 1277),
|
|
CoverImageSize.XLarge => (1265, 1795),
|
|
_ => (320, 455)
|
|
};
|
|
}
|
|
}
|