UNPKG

hanime-crave

Version:
36 lines (34 loc) 1.06 kB
const { fixImageUrl } = require('../core.js'); module.exports = class HentaiEpisodeInfo { constructor(name, slug, created, createdUnix, released, releasedUnix, description, views, interests, poster, cover, brand, censored, likes, dislikes, downloads, bannedIn, tags, streams) { this.title = { name: name, slug: slug }; this.created = { date: created, unix: createdUnix }; this.released = { date: released, unix: releasedUnix }; this.description = !!description ? description.replace(/<(p|br)>/g, '') : undefined; this.views = views; this.interests = interests; this.artwork = { poster: !!poster ? fixImageUrl(poster) : poster, cover: !!cover ? fixImageUrl(cover) : cover }; this.brand = brand; this.censored = censored; this.rates = { likes: likes, dislikes: dislikes }; this.downloads = downloads; this.banned_in = bannedIn; this.tags = tags.map(m => m.text); this.streams = streams; } }