diff --git a/src/AsuraScans/AsuraScans.ts b/src/AsuraScans/AsuraScans.ts index 670cc31..c53e6da 100644 --- a/src/AsuraScans/AsuraScans.ts +++ b/src/AsuraScans/AsuraScans.ts @@ -48,7 +48,7 @@ const ASURASCANS_DOMAIN = 'https://asuracomic.net' const ASURASCANS_API_DOMAIN = 'https://gg.asuracomic.net' export const AsuraScansInfo: SourceInfo = { - version: '4.1.2', + version: '4.1.3', name: 'AsuraScans', description: 'Extension that pulls manga from AsuraScans', author: 'Seyden', @@ -292,7 +292,7 @@ export class AsuraScans implements ChapterProviding, HomePageSectionsProviding, async getMangaDetails(mangaId: string): Promise { const data = await this.getMangaRequest(mangaId) - return this.parser.parseMangaDetails(data, mangaId, this) + return await this.parser.parseMangaDetails(data, mangaId, this) } async getChapters(mangaId: string): Promise { diff --git a/src/AsuraScans/AsuraScansParser.ts b/src/AsuraScans/AsuraScansParser.ts index 3fe8336..e48a10f 100644 --- a/src/AsuraScans/AsuraScansParser.ts +++ b/src/AsuraScans/AsuraScansParser.ts @@ -14,7 +14,7 @@ import { import entities = require('entities') export class AsuraScansParser { - parseMangaDetails(data: string, mangaId: string, source: any): SourceManga { + async parseMangaDetails(data: string, mangaId: string, source: any): Promise { const obj = extractMangaData(data.replace(/\\"/g, '"').replace(/\\\\"/g, '\\"'), "comic") ?? '' if (obj == '') { throw new Error(`Failed to parse comic object for manga ${mangaId}`) // If null, throw error, else parse data to json. @@ -33,6 +33,11 @@ export class AsuraScansParser { const covers = [comicObj.comic.cover] const description = this.decodeHTMLEntity($('span.font-medium').text().trim().replace(/\\r\\n/gm, '\n')) const rating = comicObj.comic.rating + + const slug = comicObj.comic.slug?.trim() + if (slug) { + await source.setMangaSlug(mangaId, `series/${slug}`) + } const rawStatus = comicObj.comic.status.name.trim() let status