fix: SITE_URL
This commit is contained in:
1 parent
1fe912f4bd
commit
dfdfb79169
66 files changed
+1352
-240
No files matched your search
@@ -1,5 +0,0 @@
|
||||
import UsersList from '@/components/UsersLists';
|
||||
|
||||
const Container = () => <UsersList list='favorite' label='favorites' />;
|
||||
|
||||
export default Container;
|
||||
@@ -1,29 +1,31 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import { session } from '@/api';
|
||||
import usersShowsQuery from '@/api/queries/usersShows';
|
||||
import UsersList from '@/components/UsersLists';
|
||||
import { session as getSession } from '@/data';
|
||||
import usersShowsQuery from '@/data/queries/usersShows';
|
||||
import { TITLE } from '@/env';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'My Favorite Shows - Movie Advisor',
|
||||
description:
|
||||
'View your favorite shows on Movie Advisor. Keep track of films you’ve added and revisit your top picks anytime.'
|
||||
title: `My Favorite Shows - ${TITLE}`,
|
||||
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`
|
||||
};
|
||||
|
||||
const Favorites = () => {
|
||||
const Favorites = async () => {
|
||||
const session = await getSession();
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const list = 'favorite';
|
||||
const showType = 'movie';
|
||||
|
||||
queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session: session() }));
|
||||
if (session) {
|
||||
await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session }));
|
||||
}
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<Container />
|
||||
<UsersList session={session} list={list} label='favorites' />
|
||||
</HydrationBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
|
||||
import randomQuery from '@/api/queries/random';
|
||||
import randomQuery from '@/data/queries/random';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
const Random = () => {
|
||||
const Random = async () => {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
queryClient.prefetchInfiniteQuery(randomQuery());
|
||||
await queryClient.prefetchInfiniteQuery(randomQuery());
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import popularQuery from '@/api/queries/popular';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import { TITLE } from '@/env';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Popular Movies | Movie Advisor',
|
||||
description:
|
||||
'Check out the most popular movies right now on Movie Advisor. See what’s trending and don’t miss out on the latest hits.'
|
||||
title: `Popular Movies | ${TITLE}`,
|
||||
description: `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.`
|
||||
};
|
||||
|
||||
const Popular = () => {
|
||||
const Popular = async () => {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
queryClient.prefetchInfiniteQuery(popularQuery());
|
||||
await queryClient.prefetchInfiniteQuery(popularQuery());
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import popularQuery from '@/api/queries/popular';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import useInfiniteList from '@/hooks/useInfiniteList';
|
||||
|
||||
const usePopular = () => useInfiniteList(popularQuery());
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
|
||||
import similarQuery from '@/api/queries/similar';
|
||||
import similarQuery from '@/data/queries/similar';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
const Similar = ({ searchParams }: { searchParams: Record<string, string> }) => {
|
||||
const Similar = async ({ searchParams }: { searchParams: Record<string, string> }) => {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const { id, type } = searchParams || {};
|
||||
|
||||
queryClient.prefetchInfiniteQuery(similarQuery({ showId: id, showType: type as Show['type'] }));
|
||||
await queryClient.prefetchInfiniteQuery(similarQuery({ showId: id, showType: type as Show['type'] }));
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import similarQuery from '@/api/queries/similar';
|
||||
import similarQuery from '@/data/queries/similar';
|
||||
import useInfiniteList from '@/hooks/useInfiniteList';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
|
||||
import popularQuery from '@/api/queries/popular';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
const Starring = ({ searchParams }: { searchParams: Record<string, string> }) => {
|
||||
const Starring = async ({ searchParams }: { searchParams: Record<string, string> }) => {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const { actorId } = searchParams || {};
|
||||
|
||||
queryClient.prefetchInfiniteQuery(popularQuery({ sortBy: 'vote_average.desc', starring: actorId }));
|
||||
await queryClient.prefetchInfiniteQuery(popularQuery({ sortBy: 'vote_average.desc', starring: actorId }));
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import popularQuery from '@/api/queries/popular';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import useInfiniteList from '@/hooks/useInfiniteList';
|
||||
|
||||
const useStarring = ({ actorId }: { actorId?: string }) =>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import popularQuery from '@/api/queries/popular';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import { TITLE } from '@/env';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Top Rated Movies | Movie Advisor',
|
||||
description:
|
||||
'Discover the top-rated movies on Movie Advisor. Find the highest-rated films and make informed viewing choices.'
|
||||
title: `Top Rated Movies | ${TITLE}`,
|
||||
description: `Discover the top-rated movies on ${TITLE}. Find the highest-rated films and make informed viewing choices.`
|
||||
};
|
||||
|
||||
const Top = () => {
|
||||
const Top = async () => {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
queryClient.prefetchInfiniteQuery(popularQuery({ sortBy: 'vote_average.desc' }));
|
||||
await queryClient.prefetchInfiniteQuery(popularQuery({ sortBy: 'vote_average.desc' }));
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import popularQuery from '@/api/queries/popular';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import useInfiniteList from '@/hooks/useInfiniteList';
|
||||
|
||||
const useTop = () => useInfiniteList(popularQuery({ sortBy: 'vote_average.desc' }));
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import UsersList from '@/components/UsersLists';
|
||||
|
||||
const Container = () => <UsersList list='watchlist' label='watch' />;
|
||||
|
||||
export default Container;
|
||||
@@ -1,29 +1,31 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import { session } from '@/api';
|
||||
import usersShowsQuery from '@/api/queries/usersShows';
|
||||
import UsersList from '@/components/UsersLists';
|
||||
import { session as getSession } from '@/data';
|
||||
import usersShowsQuery from '@/data/queries/usersShows';
|
||||
import { TITLE } from '@/env';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import Container from './container';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'My watch list - Movie Advisor',
|
||||
description:
|
||||
'View your favorite shows on Movie Advisor. Keep track of films you’ve added and revisit your top picks anytime.'
|
||||
title: `My watch list - ${TITLE}`,
|
||||
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`
|
||||
};
|
||||
|
||||
const WatchList = () => {
|
||||
const WatchList = async () => {
|
||||
const session = await getSession();
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const list = 'watchlist';
|
||||
const showType = 'movie';
|
||||
|
||||
queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session: session() }));
|
||||
if (session) {
|
||||
await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session }));
|
||||
}
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<Container />
|
||||
<UsersList session={session} list={list} label='watch' />
|
||||
</HydrationBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import tlk from '@/api/parsers/tlk';
|
||||
import tlk from '@/data/parsers/tlk';
|
||||
|
||||
export async function GET({ nextUrl: { searchParams } }: NextRequest) {
|
||||
const url = searchParams.get('url') as string;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { MOVIE_DB_TOKEN } from '@/env';
|
||||
|
||||
type TMDBParams = {
|
||||
params: {
|
||||
path: string[];
|
||||
@@ -11,7 +13,7 @@ export async function GET({ nextUrl: { searchParams } }: NextRequest, { params:
|
||||
const response = await fetch(`https://api.themoviedb.org/3/${path.join('/')}?${searchParams.toString()}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${process.env.MOVIE_DB_TOKEN}`
|
||||
Authorization: `Bearer ${MOVIE_DB_TOKEN}`
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { Sort } from '@/api/parsers';
|
||||
import tlk from '@/api/parsers/tlk';
|
||||
import tpb from '@/api/parsers/tpb';
|
||||
import yts from '@/api/parsers/yts';
|
||||
import { Sort } from '@/data/parsers';
|
||||
import tlk from '@/data/parsers/tlk';
|
||||
import tpb from '@/data/parsers/tpb';
|
||||
import yts from '@/data/parsers/yts';
|
||||
|
||||
export async function GET({ nextUrl: { searchParams } }: NextRequest) {
|
||||
const key = searchParams.get('key') as keyof typeof providers;
|
||||
|
||||
+14
-14
@@ -4,20 +4,20 @@ import { Jost } from 'next/font/google';
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import Header from '@/components/Header';
|
||||
import { SITE_URL, TITLE } from '@/env';
|
||||
import Providers from '@/providers';
|
||||
|
||||
import '@/styles/index.css';
|
||||
|
||||
const title = 'Movie Advisor';
|
||||
const productionUrl = `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: `${title} | Discover Your Next Favorite Movie`,
|
||||
description: `Explore a diverse selection of movies with ${title}. Get random movie recommendations and find out top-rated, popular, and user-favorite films.`
|
||||
title: `${TITLE} | Discover Your Next Favorite Movie`,
|
||||
description: `Explore a diverse selection of movies with ${TITLE}. Get random movie recommendations and find out top-rated, popular, and user-favorite films.`
|
||||
};
|
||||
|
||||
export const viewport: Viewport = {
|
||||
width: 'device-width'
|
||||
width: 'device-width',
|
||||
initialScale: 1,
|
||||
viewportFit: 'cover'
|
||||
};
|
||||
|
||||
const font = Jost({ subsets: ['latin', 'cyrillic'], weight: ['400'] });
|
||||
@@ -34,22 +34,22 @@ const RootLayout = ({ children }: { children: ReactNode }) => {
|
||||
<link rel='icon' type='image/svg+xml' href='/favicon.svg' />
|
||||
<link rel='shortcut icon' href='/favicon.ico' />
|
||||
<link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' />
|
||||
<meta name='apple-mobile-web-app-title' content='Movie Advisor' />
|
||||
<meta name='apple-mobile-web-app-title' content={TITLE} />
|
||||
|
||||
<link rel='manifest' href='/manifest.json' />
|
||||
|
||||
<meta name='twitter:card' content={metadata.description!} />
|
||||
<meta name='twitter:url' content={productionUrl} />
|
||||
<meta name='twitter:title' content={title} />
|
||||
<meta name='twitter:url' content={SITE_URL} />
|
||||
<meta name='twitter:title' content={TITLE} />
|
||||
<meta name='twitter:description' content={metadata.description!} />
|
||||
<meta name='twitter:image' content={`${productionUrl}/web-app-manifest-512x512.png`} />
|
||||
<meta name='twitter:image' content={`${SITE_URL}/web-app-manifest-512x512.png`} />
|
||||
<meta name='twitter:creator' content='https://github.com/noisy5ilence' />
|
||||
<meta property='og:type' content='website' />
|
||||
<meta property='og:title' content={title} />
|
||||
<meta property='og:title' content={TITLE} />
|
||||
<meta property='og:description' content={metadata.description!} />
|
||||
<meta property='og:site_name' content={title} />
|
||||
<meta property='og:url' content={productionUrl} />
|
||||
<meta property='og:image' content={`${productionUrl}/apple-touch-icon.png`} />
|
||||
<meta property='og:site_name' content={TITLE} />
|
||||
<meta property='og:url' content={SITE_URL} />
|
||||
<meta property='og:image' content={`${SITE_URL}/apple-touch-icon.png`} />
|
||||
</head>
|
||||
<body className={font.className}>
|
||||
<Providers theme={theme}>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import type { MetadataRoute } from 'next';
|
||||
|
||||
const manifest = (): MetadataRoute.Manifest => ({
|
||||
name: 'Movie Advisor',
|
||||
short_name: 'Movie Advisor',
|
||||
description:
|
||||
'Explore a diverse selection of movies with Movie Advisor. Get random movie recommendations and find out top-rated, popular, and user-favorite films.',
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#ffffff',
|
||||
theme_color: '#000000',
|
||||
icons: [
|
||||
{
|
||||
src: '/web-app-manifest-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: '/web-app-manifest-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
export default manifest;
|
||||
Reference in new issue
Block a user