Skip to content

Commit

Permalink
feat(app): go to pikpak
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Feb 29, 2024
1 parent 37cfd3d commit 1778331
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
42 changes: 34 additions & 8 deletions packages/app/src/components/ResourceTable.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,44 @@ function followSearch(params: Record<string, string>) {
resources.map((r) => (
<tr class="">
<td class="py2 text-center">
{formatInTimeZone(new Date(r.createdAt), 'Asia/Shanghai', 'yyyy-MM-dd HH:mm')}
<a
href={getDetailHref(r)}
class="text-link-active"
aria-label={`Go to resource detail of ${r.title}`}
>
{formatInTimeZone(new Date(r.createdAt), 'Asia/Shanghai', 'yyyy-MM-dd HH:mm')}
</a>
</td>
<td class="py2 pl2 lt-sm:pl1">
<div class="flex items-center justify-start">
<div class="flex-1">
<a
href={getDetailHref(r)}
class="text-link mr2"
aria-label={`Go to resources detail of ${r.title}`}
>
{r.title}
</a>
<span class="mr3">
{['動畫', '季度全集', '日劇', '特攝'].includes(r.type) ? (
<>
<a
href={getPikPakUrlChecker(r.magnet)}
class="text-link mr1"
aria-label={`Go to download resource of ${r.title}`}
target="_blank"
>
{r.title}
</a>
<a
href={getDetailHref(r)}
class="text-link i-carbon-launch vertical-middle"
aria-label={`Go to resource detail of ${r.title}`}
/>
</>
) : (
<a
href={getDetailHref(r)}
class="text-link"
aria-label={`Go to resource detail of ${r.title}`}
>
{r.title}
</a>
)}
</span>
<a
href={`/resources/1?${followSearch({ type: r.type })}`}
class="inline-block select-none"
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export function getRuntimeEnv(locals: App.Locals): Env | undefined {
}

export function getPikPakUrlChecker(magnet: string) {
return `https://mypikpak.com/drive/url-checker?url=${magnet}`;
const prefix = magnet.split('&')[0];
return `https://mypikpak.com/drive/url-checker?url=${prefix}`;
}

0 comments on commit 1778331

Please sign in to comment.