node-hitomi
Version:
Hitomi.la API for Node.js
57 lines (54 loc) • 1.4 kB
JavaScript
import { Base } from '../internal/base.js';
class Title {
constructor(display, japanese = null) {
this.display = display;
this.japanese = japanese;
}
}
class GalleryReference extends Base {
constructor(hitomi, id) {
super(hitomi);
this.id = id;
}
retrieve() {
return this.hitomi.galleries.retrieve(this.id);
}
}
class TranslatedGallery extends GalleryReference {
constructor(hitomi, id, language, url) {
super(hitomi, id);
this.language = language;
this.url = url;
}
}
class Gallery extends TranslatedGallery {
constructor(hitomi, id, language, url, title, type, artists, groups, series, characters, tags, files, translations, relations, isBlocked, addedDate, publishedDate = null, video = null) {
super(hitomi, id, language, url);
this.title = title;
this.type = type;
this.artists = artists;
this.groups = groups;
this.series = series;
this.characters = characters;
this.tags = tags;
this.files = files;
this.translations = translations;
this.relations = relations;
this.isBlocked = isBlocked;
this.addedDate = addedDate;
this.publishedDate = publishedDate;
this.video = video;
}
getThumbnails() {
return [this.files[0], this.files[Math.floor(this.files.length / 2)]];
}
}
Gallery.TYPES = new Set([
'doujinshi',
'manga',
'artistcg',
'gamecg',
'imageset',
'anime'
]);
export { Gallery, GalleryReference, Title, TranslatedGallery };