Skip to content

Commit

Permalink
fix leviatanscans
Browse files Browse the repository at this point in the history
  • Loading branch information
Yentis committed Oct 19, 2022
1 parent 4c91293 commit 323037d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/classes/sites/baseSite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export abstract class BaseSite {
manga.image = this.getImage(data)
manga.title = this.getTitle(data)

if (manga.title === '') {
if (manga.title === '' || manga.chapter === 'Unknown') {
throw Error('Could not parse site')
}
return manga
Expand Down
4 changes: 2 additions & 2 deletions src/enums/siteEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export enum SiteType {
Mangakakalot = 'mangakakalot.com',
MangaDex = 'mangadex.org',
MangaKomi = 'mangakomi.io',
LeviatanScans = 'leviatanscans.com',
LeviatanScans = 'en.leviatanscans.com',
HiperDEX = 'hiperdex.com',
ReaperScans = 'reaperscans.com',
AsuraScans = 'asura.gg',
Expand Down Expand Up @@ -36,7 +36,7 @@ export enum SiteName {
'mangakakalot.com' = 'Mangakakalot',
'mangadex.org' = 'MangaDex',
'mangakomi.io' = 'Manga Komi',
'leviatanscans.com' = 'Leviatan Scans',
'en.leviatanscans.com' = 'Leviatan Scans',
'hiperdex.com' = 'HiperDEX',
'reaperscans.com' = 'Reaper Scans',
'asura.gg' = 'Asura Scans',
Expand Down
14 changes: 7 additions & 7 deletions src/services/test/leviatanscans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ async function readUrl (site: BaseSite): Promise<void> {
desired.chapter = 'Chapter 143'
desired.image = 'https://en.leviatanscans.com/wp-content/uploads/2022/08/cover-iatsk.png'
desired.title = 'I Am the Sorcerer King'
desired.chapterUrl = 'https://en.leviatanscans.com/hb/manga/i-am-the-sorcerer-king/chapter-143/'
desired.chapterUrl = 'https://en.leviatanscans.com/hcd/manga/i-am-the-sorcerer-king/chapter-143/'
desired.chapterNum = 143
desired.chapterDate = 'a month ago'
desired.chapterDate = '2 months ago'

mangaEqual(manga, desired)
}

async function readUrlCorrectSeasonOrder (): Promise<void> {
const url = 'https://leviatanscans.com/manga/tale-of-a-scribe-who-retires-to-the-countryside/'
const url = 'https://en.leviatanscans.com/manga/tale-of-a-scribe-who-retires-to-the-countryside/'
const manga = await getMangaInfo(url, SITE_TYPE)
const desired = new Manga(url, SITE_TYPE)
desired.chapter = 'Chapter 123'
desired.chapter = 'Chapter 125'
desired.image = 'https://en.leviatanscans.com/wp-content/uploads/2022/08/cover-TSWRC.png'
desired.title = 'Tale of a Scribe Who Retires to the Countryside'
desired.chapterUrl = 'https://en.leviatanscans.com/hb/manga/tale-of-a-scribe-who-retires-to-the-countryside/chapter-123/'
desired.chapterNum = 123
desired.chapterUrl = 'https://en.leviatanscans.com/hcd/manga/tale-of-a-scribe-who-retires-to-the-countryside/chapter-125/'
desired.chapterNum = 125

mangaEqual(manga, desired)
}
Expand All @@ -47,7 +47,7 @@ async function search (site: BaseSite): Promise<void> {
const desired = new Manga(site.getTestUrl(), SITE_TYPE)
desired.image = 'https://en.leviatanscans.com/wp-content/uploads/2022/08/cover-BE-193x278.png'
desired.chapter = 'Chapter 212'
desired.url = 'https://en.leviatanscans.com/hb/manga/burning-effect/'
desired.url = 'https://en.leviatanscans.com/hcd/manga/burning-effect/'

return searchValid(results, desired, QUERY)
}
3 changes: 2 additions & 1 deletion src/utils/siteUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const siteAliases = [
{ url: Guya, site: SiteType.Cubari },
{ url: 'mangakomi.com', site: SiteType.MangaKomi },
{ url: 'www.asurascans.com', site: SiteType.AsuraScans },
{ url: 'asurascans.com', site: SiteType.AsuraScans }
{ url: 'asurascans.com', site: SiteType.AsuraScans },
{ url: 'leviatanscans.com', site: SiteType.LeviatanScans }
]

export function getUrl (url: string) {
Expand Down

0 comments on commit 323037d

Please sign in to comment.