-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEHentaiImageGalleryInfo.cs
49 lines (43 loc) · 1.82 KB
/
EHentaiImageGalleryInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using EHentaiAPI.Client;
using EHentaiAPI.Client.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wbooru.Models.Gallery;
using WbooruPlugin.EHentai.Utils;
namespace WbooruPlugin.EHentai
{
public class EHentaiImageGalleryInfo : GalleryItem
{
public static GalleryItem Create(EhUrl ehUrl, GalleryInfo galleryInfo)
{
var item = new EHentaiImageGalleryInfo()
{
DetailLink = ehUrl.GetGalleryDetailUrl(galleryInfo),
GalleryItemID = galleryInfo.ConvertToWbooruId(),
GalleryName = galleryInfo.AvaliableTitle,
PreviewImageSize = new Wbooru.Models.ImageSize(galleryInfo.ThumbWidth, galleryInfo.ThumbHeight),
PreviewImageDownloadLink = galleryInfo.Thumb,
DownloadFileName = $"{galleryInfo.ConvertToWbooruId()} {galleryInfo.AvaliableTitle}",
};
return item;
}
public static GalleryItem Create(EhUrl ehUrl, GalleryDetail detail)
{
var item = new EHentaiImageGalleryInfo()
{
DetailLink = ehUrl.GetGalleryDetailUrl(detail),
GalleryItemID = detail.ConvertToWbooruId(),
GalleryName = detail.AvaliableTitle,
PreviewImageSize = new Wbooru.Models.ImageSize(detail.ThumbWidth, detail.ThumbHeight),
PreviewImageDownloadLink = detail.Thumb,
DownloadFileName = $"{detail.ConvertToWbooruId()} {detail.AvaliableTitle}",
};
item.CachedGalleryDetail = new EHentaiImageGalleryImageDetail(detail);
return item;
}
public EHentaiImageGalleryImageDetail CachedGalleryDetail { get; set; }
}
}