Skip to content

Commit

Permalink
feat: ✨ ehentai 下载将使用日文标题命名
Browse files Browse the repository at this point in the history
  • Loading branch information
hymbz committed Oct 25, 2024
1 parent e2ea67a commit ef317b4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const DownloadButton = () => {
level: 0,
comment: window.location.href,
});
saveAs(new Blob([zipped]), `${document.title}.zip`);
saveAs(new Blob([zipped]), `${store.title ?? document.title}.zip`);
setStatu('button.download_completed');
toast.success(t('button.download_completed'));
};
Expand Down
3 changes: 3 additions & 0 deletions src/components/Manga/hooks/useInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export const useInit = (props: MangaProps) => {
commentList(state) {
state.commentList = props.commentList;
},
title(state) {
state.title = props.title ?? '';
},
};
for (const [key, fn] of Object.entries(watchProps)) {
createEffect(
Expand Down
2 changes: 2 additions & 0 deletions src/components/Manga/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export interface MangaProps {
show?: boolean;
/** 评论列表 */
commentList?: string[];
/** 漫画标题 */
title?: string | null;

/** 点击结束页按钮时触发的回调 */
onExit?: State['prop']['Exit'];
Expand Down
2 changes: 2 additions & 0 deletions src/components/Manga/store/other.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const otherState = {
title: '',

rootSize: { width: 0, height: 0 },
scrollbarSize: { width: 0, height: 0 },

Expand Down
2 changes: 2 additions & 0 deletions src/site/ehentai/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ export type PageType = 'gallery' | 'mytags' | 'mpv' | ListPageType;
if (i === -1) return;
return reloadImg(i);
},
title:
querySelector('#gj')?.textContent || querySelector('#gn')?.textContent,
});

setFab('initialShow', options.autoShow);
Expand Down

0 comments on commit ef317b4

Please sign in to comment.