Skip to content
Merged

Dev #320

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
100 changes: 50 additions & 50 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "akari",
"version": "2.0.9",
"version": "2.0.10",
"homepage": "https://github.com/sn0w12/Akari#readme",
"engines": {
"node": ">=20"
Expand Down Expand Up @@ -40,7 +40,7 @@
"embla-carousel-react": "^8.6.0",
"js-cookie": "^3.0.5",
"lucide-react": "^1.7.0",
"next": "^16.2.2",
"next": "^16.2.3",
"next-themes": "^0.4.6",
"openapi-fetch": "^0.17.0",
"radix-ui": "^1.4.3",
Expand All @@ -64,7 +64,7 @@
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"eslint": "^9",
"eslint-config-next": "16.2.2",
"eslint-config-next": "16.2.3",
"mjml": "5.0.0-beta.2",
"openapi-typescript": "^7.13.0",
"prettier": "3.8.1",
Expand Down
2 changes: 1 addition & 1 deletion src/app/(default)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default async function Home() {
}

async function HomePopular() {
const { data, error } = await getPopularData(1, 7);
const { data, error } = await getPopularData(1, 7, ["Hentai", "Adult"]);

if (error || !data) {
return null;
Expand Down
4 changes: 3 additions & 1 deletion src/app/(default)/popular/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MangaGrid } from "@/components/manga/manga-grid";
import { PageWrapper } from "@/components/page-wrapper";
import { ServerPagination } from "@/components/ui/pagination/server-pagination";
import { client, serverHeaders } from "@/lib/api";
import { Genre } from "@/lib/api/search";
import {
createJsonLd,
createMetadata,
Expand Down Expand Up @@ -60,7 +61,7 @@ const CACHE_TIMES: Record<
"365": { stale: 14400, revalidate: 86400, expire: 604800 }, // 4 hours stale, 1 day revalidate, 1 week expire
};

export const getPopularData = async (page: number, days: number = 30) => {
export const getPopularData = async (page: number, days: number = 30, excludedGenres: Genre[] = []) => {
"use cache";
cacheLife(CACHE_TIMES[days.toString()]);
cacheTag("popular");
Expand All @@ -71,6 +72,7 @@ export const getPopularData = async (page: number, days: number = 30) => {
page: page,
pageSize: 24,
days: days,
excludedGenres: excludedGenres
},
},
headers: serverHeaders,
Expand Down
23 changes: 4 additions & 19 deletions src/components/header/desktop-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ export function DesktopHeader({ notification }: HeaderProps) {
});
}, [pathname, overrides]);

const getSegmentDisplayName = (
segment: string,
index: number,
segments: string[],
maxLength: number = 35,
) => {
const getSegmentDisplayName = (segment: string, maxLength: number = 35) => {
segment = segment.replace(/-s-/g, "'s ");
segment = segment.replace(/-/g, " ");

Expand All @@ -82,7 +77,7 @@ export function DesktopHeader({ notification }: HeaderProps) {
return (
<header
className={cn(
`hidden md:block top-0 left-0 z-50 bg-sidebar border-b sticky md:border-b-0 h-12 md:h-10`,
`hidden top-0 left-0 z-50 bg-sidebar border-b sticky md:border-b-0 h-12 md:h-10`,
borderClass,
)}
>
Expand Down Expand Up @@ -133,28 +128,18 @@ export function DesktopHeader({ notification }: HeaderProps) {
.join("/")}`}
title={getSegmentDisplayName(
segment,
index,
segments,
9999,
)}
tabIndex={-1}
transitionTypes={[
"transition-backwards",
]}
>
{getSegmentDisplayName(
segment,
index,
segments,
)}
{getSegmentDisplayName(segment)}
</BreadcrumbLink>
) : (
<span>
{getSegmentDisplayName(
segment,
index,
segments,
)}
{getSegmentDisplayName(segment)}
</span>
)}
</BreadcrumbItem>
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/mobile-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function MobileHeader() {
const pathname = usePathname();

return (
<TabBar className="md:hidden">
<TabBar>
<TabBarList className="mb-[var(--safe-bottom)]">
<TabBarTrigger
aria-label="Open Sidebar"
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/tab-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ function TabBar({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
function TabBarList({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) {
}: React.HTMLAttributes<HTMLElement>) {
return (
<div
<nav
className={cn("flex h-14 items-center justify-around", className)}
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/auth/secondary-accounts/ani.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class AniAccount extends SecondaryAccountBase {
}

async handleCallback(
params: Record<string, string>,
_params: Record<string, string>,
hash: string,
): Promise<boolean> {
const hashParams = new URLSearchParams(hash);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/auth/secondary-accounts/mal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class MalAccount extends SecondaryAccountBase {

async handleCallback(
params: Record<string, string>,
hash: string,
_hash: string,
origin: string,
): Promise<boolean> {
const code = params.code;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type CookieCategory = keyof CookieConsent;
export const setCookie = (
name: string,
value: string,
category: CookieCategory,
_category: CookieCategory,
maxAge = 31536000,
) => {
if (typeof window === "undefined") return false;
Expand Down
4 changes: 4 additions & 0 deletions src/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2264,6 +2264,10 @@ export interface paths {
query?: {
/** @description The number of days to look back for views. */
days?: number;
/** @description Filter by genres. */
genres?: string[];
/** @description Exclude by genres. */
excludedGenres?: string[];
/** @description The page number. */
page?: number;
/** @description The number of items per page. */
Expand Down
Loading
Loading