Skip to content

Commit

Permalink
Try this
Browse files Browse the repository at this point in the history
  • Loading branch information
milesoc committed Jun 18, 2024
1 parent 849fa6e commit ebe1522
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/MangaDex/MangaDexParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export const parseMangaList = async (object: MangaItem[], source: any, thumbnail

const countryFlag = getCountryFlag(mangaDetails.originalLanguage)

const title = countryFlag + ' ' + source.decodeHTMLEntity(mangaDetails.title.en ?? mangaDetails.altTitles.map(x => Object.values(x).find((v) => v !== undefined)).find((t) => t !== undefined))
const rawTitle = source.decodeHTMLEntity(mangaDetails.title.en ?? mangaDetails.altTitles.map(x => Object.values(x).find((v) => v !== undefined)).find((t) => t !== undefined))
const title = countryFlag + ' ' + rawTitle;
const coverFileName = manga.relationships.filter((x) => x.type == 'cover_art').map((x) => x.attributes?.fileName)[0]
const image = coverFileName ? `${source.COVER_BASE_URL}/${mangaId}/${coverFileName}${MDImageQuality.getEnding(thumbnailSelectorState)}` : 'https://mangadex.org/_nuxt/img/cover-placeholder.d12c3c5.jpg'
const subtitle = `${mangaDetails.lastVolume ? `Vol. ${mangaDetails.lastVolume}` : ''} ${mangaDetails.lastChapter ? `Ch. ${mangaDetails.lastChapter}` : ''}`
Expand Down Expand Up @@ -48,7 +49,8 @@ export const parseChapterListToManga = async (chapters: ChapterItem[], source: a

const countryFlag = getCountryFlag(mangaDetails.originalLanguage)

const title = countryFlag + ' ' + source.decodeHTMLEntity(mangaDetails.title.en ?? mangaDetails.altTitles.map(x => Object.values(x).find((v) => v !== undefined)).find((t) => t !== undefined))
const rawTitle = source.decodeHTMLEntity(mangaDetails.title.en ?? mangaDetails.altTitles.map(x => Object.values(x).find((v) => v !== undefined)).find((t) => t !== undefined))
const title = countryFlag + ' ' + rawTitle;
const image = 'https://mangadex.org/_nuxt/img/cover-placeholder.d12c3c5.jpg'
const subtitle = `${mangaDetails.lastVolume ? `Vol. ${mangaDetails.lastVolume}` : ''} ${mangaDetails.lastChapter ? `Ch. ${mangaDetails.lastChapter}` : ''}`

Expand Down

0 comments on commit ebe1522

Please sign in to comment.