Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(gogoanime): Optimize otherName algorithm anime info #573

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions dist/providers/anime/gogoanime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/providers/anime/gogoanime.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/providers/anime/zoro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/providers/anime/zoro.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/providers/manga/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import FlameScans from './flamescans';
import MangaHost from './mangahost';
import BRMangas from './brmangas';
import ReadManga from './readmanga';
import VyvyManga from './vyvymanga';
declare const _default: {
MangaDex: typeof MangaDex;
ComicK: typeof ComicK;
Expand All @@ -25,5 +26,6 @@ declare const _default: {
MangaHost: typeof MangaHost;
BRMangas: typeof BRMangas;
ReadManga: typeof ReadManga;
VyvyManga: typeof VyvyManga;
};
export default _default;
2 changes: 2 additions & 0 deletions dist/providers/manga/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/providers/manga/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions dist/providers/manga/vyvymanga.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { IMangaChapterPage, IMangaInfo, IMangaResult, ISearch, MangaParser } from '../../models';
declare class VyvyManga extends MangaParser {
readonly name: string;
protected baseUrl: string;
protected logo: string;
protected classPath: string;
protected baseWebsiteUrl: string;
search: (query: string, page?: number) => Promise<ISearch<IMangaResult>>;
searchApi: (query: string) => Promise<ISearch<IMangaResult>>;
fetchMangaInfo: (mangaId: string) => Promise<IMangaInfo>;
fetchChapterPages: (chapterId: string) => Promise<IMangaChapterPage[]>;
private formatSearchResultData;
}
export default VyvyManga;
181 changes: 181 additions & 0 deletions dist/providers/manga/vyvymanga.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/providers/manga/vyvymanga.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions src/providers/anime/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ class Gogoanime extends AnimeParser {
animeInfo.status = MediaStatus.UNKNOWN;
break;
}
animeInfo.otherName = $('div.anime_info_body_bg > p:nth-child(10)')
.text()
.replace('Other name: ', '')
.replace(/;/g, ',');
animeInfo.otherName = $('.other-name a').text().trim();

$('div.anime_info_body_bg > p:nth-child(7) > a').each((i, el) => {
animeInfo.genres?.push($(el).attr('title')!.toString());
Expand Down
6 changes: 5 additions & 1 deletion src/providers/anime/zoro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class Zoro extends AnimeParser {

constructor(customBaseURL?: string) {
super(...arguments);
this.baseUrl = customBaseURL ? (customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://') ? customBaseURL : `http://${customBaseURL}`) : this.baseUrl;
this.baseUrl = customBaseURL
? customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://')
? customBaseURL
: `http://${customBaseURL}`
: this.baseUrl;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/providers/manga/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export default {
MangaHost,
BRMangas,
ReadManga,
VyvyManga
VyvyManga,
};
Loading
Loading