From cb1a17def22f16ebcbab272249e46e2c25a76a32 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 5 Jan 2026 12:28:43 +0100 Subject: [PATCH] Organize imports --- api/src/controllers/shows/shows.ts | 4 ++-- api/src/controllers/studios.ts | 2 +- api/src/db/schema/images.ts | 1 - api/src/db/schema/staff.ts | 2 +- api/src/db/utils.ts | 7 +++---- api/src/otel.ts | 5 +---- api/tests/misc/images.test.ts | 4 ++-- front/src/components/items/context-menus.tsx | 3 +-- front/src/components/items/watchlist-info.tsx | 2 +- front/src/ui/details/header.tsx | 1 - front/src/ui/home/header.tsx | 2 +- front/src/ui/home/recommended.tsx | 6 +++--- 12 files changed, 16 insertions(+), 23 deletions(-) diff --git a/api/src/controllers/shows/shows.ts b/api/src/controllers/shows/shows.ts index 8d86da2f..0e5e49d0 100644 --- a/api/src/controllers/shows/shows.ts +++ b/api/src/controllers/shows/shows.ts @@ -1,5 +1,6 @@ import { and, isNull, sql } from "drizzle-orm"; import { Elysia, t } from "elysia"; +import type { NonEmptyArray } from "elysia/dist/type-system/types"; import { auth } from "~/auth"; import { prefix } from "~/base"; import { db } from "~/db"; @@ -14,6 +15,7 @@ import { processLanguages, } from "~/models/utils"; import { desc } from "~/models/utils/descriptions"; +import { toQueryStr } from "~/utils"; import { collectionRelations, getShows, @@ -23,8 +25,6 @@ import { showRelations, showSort, } from "./logic"; -import type { NonEmptyArray } from "elysia/dist/type-system/types"; -import { toQueryStr } from "~/utils"; export const showsH = new Elysia({ prefix: "/shows", tags: ["shows"] }) .model({ diff --git a/api/src/controllers/studios.ts b/api/src/controllers/studios.ts index 6d22ddbe..f8a9d71a 100644 --- a/api/src/controllers/studios.ts +++ b/api/src/controllers/studios.ts @@ -33,8 +33,8 @@ import { sortToSql, } from "~/models/utils"; import { desc } from "~/models/utils/descriptions"; -import { getShows, showFilters, showSort } from "./shows/logic"; import { toQueryStr } from "~/utils"; +import { getShows, showFilters, showSort } from "./shows/logic"; const studioSort = Sort( { diff --git a/api/src/db/schema/images.ts b/api/src/db/schema/images.ts index ca42c639..4330a8ce 100644 --- a/api/src/db/schema/images.ts +++ b/api/src/db/schema/images.ts @@ -1,4 +1,3 @@ -import { sql } from "drizzle-orm"; import { index, integer, diff --git a/api/src/db/schema/staff.ts b/api/src/db/schema/staff.ts index 27d7d04e..5449a7ea 100644 --- a/api/src/db/schema/staff.ts +++ b/api/src/db/schema/staff.ts @@ -1,4 +1,4 @@ -import { relations, sql } from "drizzle-orm"; +import { relations } from "drizzle-orm"; import { index, integer, diff --git a/api/src/db/utils.ts b/api/src/db/utils.ts index 2aa05ec3..49d28cb9 100644 --- a/api/src/db/utils.ts +++ b/api/src/db/utils.ts @@ -1,8 +1,10 @@ import { - Column, + type Column, type ColumnsSelection, getTableColumns, + type InferSelectModel, is, + isSQLWrapper, type SQL, type SQLWrapper, type Subquery, @@ -11,9 +13,6 @@ import { type TableConfig, View, ViewBaseConfig, - InferSelectModel, - isTable, - isSQLWrapper, } from "drizzle-orm"; import type { CasingCache } from "drizzle-orm/casing"; import type { AnyMySqlSelect } from "drizzle-orm/mysql-core"; diff --git a/api/src/otel.ts b/api/src/otel.ts index c37ee1fd..c2278102 100644 --- a/api/src/otel.ts +++ b/api/src/otel.ts @@ -24,10 +24,7 @@ import { MeterProvider, PeriodicExportingMetricReader, } from "@opentelemetry/sdk-metrics"; -import type { - SpanExporter, - SpanProcessor, -} from "@opentelemetry/sdk-trace-base"; +import type { SpanExporter } from "@opentelemetry/sdk-trace-base"; import { BatchSpanProcessor, NodeTracerProvider, diff --git a/api/tests/misc/images.test.ts b/api/tests/misc/images.test.ts index 72e2c016..3fe1e3e3 100644 --- a/api/tests/misc/images.test.ts +++ b/api/tests/misc/images.test.ts @@ -26,8 +26,8 @@ describe("images", () => { where: eq(shows.slug, madeInAbyss.slug), }); expect(ret!.slug).toBe(madeInAbyss.slug); - expect(ret!.original.poster!.blurhash).toBeString(); - expect(ret!.original.poster!.blurhash).not.toBe(defaultBlurhash); + expect(ret.original.poster!.blurhash).toBeString(); + expect(ret.original.poster!.blurhash).not.toBe(defaultBlurhash); }); it("Download 404 image", async () => { diff --git a/front/src/components/items/context-menus.tsx b/front/src/components/items/context-menus.tsx index d7e569cd..f46cbea8 100644 --- a/front/src/components/items/context-menus.tsx +++ b/front/src/components/items/context-menus.tsx @@ -1,4 +1,3 @@ -import Refresh from "@material-symbols/svg-400/rounded/autorenew.svg"; // import Download from "@material-symbols/svg-400/rounded/download.svg"; import Info from "@material-symbols/svg-400/rounded/info.svg"; import MoreVert from "@material-symbols/svg-400/rounded/more_vert.svg"; @@ -8,7 +7,7 @@ import { useTranslation } from "react-i18next"; import { Platform } from "react-native"; import { useYoshiki } from "yoshiki/native"; import { WatchStatusV } from "~/models"; -import { HR, IconButton, Menu, tooltip } from "~/primitives"; +import { IconButton, Menu, tooltip } from "~/primitives"; import { useAccount } from "~/providers/account-context"; import { useMutation } from "~/query"; import { watchListIcon } from "./watchlist-info"; diff --git a/front/src/components/items/watchlist-info.tsx b/front/src/components/items/watchlist-info.tsx index bcf854f6..c2ef4600 100644 --- a/front/src/components/items/watchlist-info.tsx +++ b/front/src/components/items/watchlist-info.tsx @@ -4,7 +4,7 @@ import BookmarkRemove from "@material-symbols/svg-400/rounded/bookmark_remove.sv import Bookmark from "@material-symbols/svg-400/rounded/bookmark-fill.svg"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { Movie, Serie } from "~/models"; +import type { Serie } from "~/models"; import { IconButton, Menu, tooltip } from "~/primitives"; import { useAccount } from "~/providers/account-context"; import { useMutation } from "~/query"; diff --git a/front/src/ui/details/header.tsx b/front/src/ui/details/header.tsx index f56d8498..01f2d1c6 100644 --- a/front/src/ui/details/header.tsx +++ b/front/src/ui/details/header.tsx @@ -1,4 +1,3 @@ -import Refresh from "@material-symbols/svg-400/rounded/autorenew.svg"; import BookmarkAdd from "@material-symbols/svg-400/rounded/bookmark_add.svg"; import MoreHoriz from "@material-symbols/svg-400/rounded/more_horiz.svg"; import MovieInfo from "@material-symbols/svg-400/rounded/movie_info.svg"; diff --git a/front/src/ui/home/header.tsx b/front/src/ui/home/header.tsx index f5378b69..7931d90e 100644 --- a/front/src/ui/home/header.tsx +++ b/front/src/ui/home/header.tsx @@ -3,7 +3,7 @@ import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; import { LinearGradient } from "expo-linear-gradient"; import { useTranslation } from "react-i18next"; import { View } from "react-native"; -import { min, percent, px, rem, useYoshiki, vh } from "yoshiki/native"; +import { min, percent, px, rem, vh } from "yoshiki/native"; import { type KImage, Show } from "~/models"; import { ContrastArea, diff --git a/front/src/ui/home/recommended.tsx b/front/src/ui/home/recommended.tsx index b9af0111..8373c0f6 100644 --- a/front/src/ui/home/recommended.tsx +++ b/front/src/ui/home/recommended.tsx @@ -2,11 +2,11 @@ import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { ScrollView, View } from "react-native"; -import { type Theme, calc, percent, px, rem, useYoshiki } from "yoshiki/native"; +import { calc, percent, px, rem, type Theme, useYoshiki } from "yoshiki/native"; import { ItemGrid } from "~/components/items"; import { ItemContext } from "~/components/items/context-menus"; +import { ItemWatchStatus } from "~/components/items/item-helpers"; import { type Genre, type KImage, Show, type WatchStatusV } from "~/models"; -import { getDisplayDate } from "~/utils"; import { Chip, focusReset, @@ -21,7 +21,7 @@ import { ts, } from "~/primitives"; import { InfiniteFetch, type Layout, type QueryIdentifier } from "~/query"; -import { ItemWatchStatus } from "~/components/items/item-helpers"; +import { getDisplayDate } from "~/utils"; export const ItemDetails = ({ slug,