mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
Flatten lib/types/title.ts → lib/types.ts and update all imports
- Rename `lib/types/title.ts` → `lib/types.ts` (remove nested directory) - Update all imports across services, atoms, components, and utils from `@/lib/types/title` to `@/lib/types`
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import type { PersonCredit } from "@/lib/types/title";
|
||||
import type { PersonCredit } from "@/lib/types";
|
||||
|
||||
type Filter = "all" | "movie" | "tv";
|
||||
type Sort = "newest" | "rating";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { format, parseISO } from "date-fns";
|
||||
import Image from "next/image";
|
||||
import { ExpandableText } from "@/components/expandable-text";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import type { ResolvedPerson } from "@/lib/types/title";
|
||||
import type { ResolvedPerson } from "@/lib/types";
|
||||
|
||||
interface PersonHeroProps {
|
||||
person: ResolvedPerson;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { IconUser, IconUsers } from "@tabler/icons-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import type { CastMember } from "@/lib/types/title";
|
||||
import type { CastMember } from "@/lib/types";
|
||||
|
||||
interface CastCarouselProps {
|
||||
actors: CastMember[];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { IconThumbUp } from "@tabler/icons-react";
|
||||
import { TitleCard } from "@/components/title-card";
|
||||
import type { RecommendedTitle } from "@/lib/types/title";
|
||||
import type { RecommendedTitle } from "@/lib/types";
|
||||
|
||||
export function RecommendationsGrid({
|
||||
recommendations,
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
import type { AvailabilityOffer } from "@/lib/types/title";
|
||||
import type { AvailabilityOffer } from "@/lib/types";
|
||||
|
||||
const MAX_VISIBLE = 4;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CastMember } from "@/lib/types/title";
|
||||
import type { CastMember } from "@/lib/types";
|
||||
import { CastCarousel } from "./cast-carousel";
|
||||
|
||||
interface TitleCastProps {
|
||||
|
||||
@@ -12,7 +12,7 @@ import Image from "next/image";
|
||||
import type { ReactNode } from "react";
|
||||
import { ExpandableText } from "@/components/expandable-text";
|
||||
import { TmdbLogo } from "@/components/tmdb-logo";
|
||||
import type { ColorPalette, ResolvedTitle } from "@/lib/types/title";
|
||||
import type { ColorPalette, ResolvedTitle } from "@/lib/types";
|
||||
import { GenreCollapse } from "./genre-collapse";
|
||||
import { TrailerDialog } from "./trailer-dialog";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
userRatingAtom,
|
||||
userStatusAtom,
|
||||
} from "@/lib/atoms/title";
|
||||
import type { Season } from "@/lib/types/title";
|
||||
import type { Season } from "@/lib/types";
|
||||
|
||||
export function TitleProvider({
|
||||
titleId,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { cacheLife, cacheTag } from "next/cache";
|
||||
import { getSession } from "@/lib/auth/session";
|
||||
import { getRecommendationsForTitle } from "@/lib/services/discovery";
|
||||
import { getUserStatusesByTitleIds } from "@/lib/services/tracking";
|
||||
import type { RecommendedTitle } from "@/lib/types/title";
|
||||
import type { RecommendedTitle } from "@/lib/types";
|
||||
import { RecommendationsGrid } from "./recommendations-grid";
|
||||
|
||||
async function getCachedRecommendations(titleId: string) {
|
||||
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
userStatusAtom,
|
||||
watchingEpAtom,
|
||||
} from "@/lib/atoms/title";
|
||||
import type { Season } from "@/lib/types/title";
|
||||
import type { Season } from "@/lib/types";
|
||||
import { useTitleActions } from "./use-title-actions";
|
||||
|
||||
export function TitleSeasons({
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
userStatusAtom,
|
||||
watchingEpAtom,
|
||||
} from "@/lib/atoms/title";
|
||||
import type { Season } from "@/lib/types/title";
|
||||
import type { Season } from "@/lib/types";
|
||||
|
||||
export function useTitleActions() {
|
||||
const store = useStore();
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { atom } from "jotai";
|
||||
import type { Season } from "@/lib/types/title";
|
||||
import type { Season } from "@/lib/types";
|
||||
|
||||
export const titleIdAtom = atom("");
|
||||
export const titleTypeAtom = atom<"movie" | "tv">("movie");
|
||||
|
||||
@@ -5,7 +5,7 @@ import { persons, titleCast, titles } from "@/lib/db/schema";
|
||||
import { createLogger } from "@/lib/logger";
|
||||
import { getMovieCredits, getTvAggregateCredits } from "@/lib/tmdb/client";
|
||||
import { tmdbImageUrl } from "@/lib/tmdb/image";
|
||||
import type { CastMember } from "@/lib/types/title";
|
||||
import type { CastMember } from "@/lib/types";
|
||||
import { cacheProfilePhotos, imageCacheEnabled } from "./image-cache";
|
||||
|
||||
const log = createLogger("credits");
|
||||
|
||||
@@ -33,7 +33,7 @@ import type {
|
||||
Episode,
|
||||
ResolvedTitle,
|
||||
Season,
|
||||
} from "@/lib/types/title";
|
||||
} from "@/lib/types";
|
||||
import { refreshAvailability } from "./availability";
|
||||
import { extractAndStoreColors, parseColorPalette } from "./colors";
|
||||
import { getCastForTitle, refreshCredits } from "./credits";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { persons, titleCast, titles } from "@/lib/db/schema";
|
||||
import { createLogger } from "@/lib/logger";
|
||||
import { getPersonCombinedCredits, getPersonDetails } from "@/lib/tmdb/client";
|
||||
import { tmdbImageUrl } from "@/lib/tmdb/image";
|
||||
import type { PersonCredit, ResolvedPerson } from "@/lib/types/title";
|
||||
import type { PersonCredit, ResolvedPerson } from "@/lib/types";
|
||||
|
||||
const log = createLogger("person");
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import type {
|
||||
} from "./types";
|
||||
|
||||
const log = createLogger("tmdb");
|
||||
|
||||
function getApiKey() {
|
||||
const key = process.env.TMDB_API_READ_ACCESS_TOKEN;
|
||||
if (!key) throw new Error("TMDB_API_READ_ACCESS_TOKEN is not set");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ColorPalette } from "@/lib/types/title";
|
||||
import type { ColorPalette } from "@/lib/types";
|
||||
|
||||
/** @internal */
|
||||
export function hexToRelativeLuminance(hex: string): number {
|
||||
|
||||
Reference in New Issue
Block a user