Skip to content

Commit

Permalink
backwards compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yentis committed Jul 9, 2022
1 parent 322bdc2 commit f1a4565
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quasar-manga-reader",
"version": "2.19.4",
"version": "2.19.5",
"description": "Manga reader that scrapes manga sites for updates",
"productName": "Manga Reader",
"author": "Yentis#5218",
Expand Down
2 changes: 1 addition & 1 deletion src-cordova/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.cordova.manga.reader" version="2.19.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="org.cordova.manga.reader" version="2.19.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Manga Reader</name>
<description>Manga reader that scrapes manga sites for updates</description>
<author email="[email protected]" href="http://cordova.io">
Expand Down
11 changes: 9 additions & 2 deletions src/services/siteService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,16 @@ export async function getMangaInfo (
): Promise <Error | Manga> {
let error: Error | undefined

const site = siteMap.get(siteType)
let site = siteMap.get(siteType)
if (!site) {
const urlSiteType = getSiteByUrl(url)
if (urlSiteType) site = siteMap.get(urlSiteType)
}

if (site) {
const result = await requestQueue.add(() => site.readUrl(url))
const finalSite = site
const result = await requestQueue.add(() => finalSite.readUrl(url))

if (result instanceof Manga) return result
if (result.message.startsWith(constants.REDIRECT_PREFIX) && redirectCount < 5) {
return getMangaInfoByUrl(result.message.replace(constants.REDIRECT_PREFIX, ''), altSources, redirectCount + 1)
Expand Down

0 comments on commit f1a4565

Please sign in to comment.