Normalize to double quotes across all files with Prettier
This commit is contained in:
1 parent
73bff72cec
commit
a5659cf4c8
190 files changed
+9523
-8859
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { api } from '@/lib/api';
|
||||
import { normalizeCollection } from '@/lib/normalizers';
|
||||
import type { Collection } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import { normalizeCollection } from "@/lib/normalizers";
|
||||
import type { Collection } from "@/types";
|
||||
|
||||
export const collectionsApi = {
|
||||
getAll: () =>
|
||||
api
|
||||
.get<Collection[]>('/collections')
|
||||
.get<Collection[]>("/collections")
|
||||
.then((r) => r.data.map(normalizeCollection)),
|
||||
|
||||
getById: (id: number) =>
|
||||
@@ -14,23 +14,26 @@ export const collectionsApi = {
|
||||
.then((r) => normalizeCollection(r.data)),
|
||||
|
||||
create: (data: Partial<Collection>) =>
|
||||
api.post<Collection>('/collections', data).then((r) => r.data),
|
||||
api.post<Collection>("/collections", data).then((r) => r.data),
|
||||
|
||||
update: (id: number, data: Partial<Collection>) =>
|
||||
api.put<Collection>(`/collections/${id}`, data).then((r) => normalizeCollection(r.data)),
|
||||
api
|
||||
.put<Collection>(`/collections/${id}`, data)
|
||||
.then((r) => normalizeCollection(r.data)),
|
||||
|
||||
updateWithMedia: (id: number, formData: FormData) =>
|
||||
api
|
||||
.put<Collection>(`/collections/${id}`, formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
})
|
||||
.then((r) => normalizeCollection(r.data)),
|
||||
|
||||
delete: (id: number) =>
|
||||
api.delete(`/collections/${id}`).then((r) => r.data),
|
||||
delete: (id: number) => api.delete(`/collections/${id}`).then((r) => r.data),
|
||||
|
||||
getCollectionParts: (id: number) =>
|
||||
api.put<Collection>(`/collections/${id}/parts`).then((r) => normalizeCollection(r.data)),
|
||||
api
|
||||
.put<Collection>(`/collections/${id}/parts`)
|
||||
.then((r) => normalizeCollection(r.data)),
|
||||
|
||||
addEntry: (collectionId: number, entryId: number) =>
|
||||
api
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
import { api } from '@/lib/api';
|
||||
import { normalizeEntry, normalizeCredit } from '@/lib/normalizers';
|
||||
import type { Entry, Credit, TmdbPreview } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import { normalizeEntry, normalizeCredit } from "@/lib/normalizers";
|
||||
import type { Entry, Credit, TmdbPreview } from "@/types";
|
||||
|
||||
export const entriesApi = {
|
||||
getAll: () =>
|
||||
api.get<Entry[]>('/entries').then((r) => r.data.map(normalizeEntry)),
|
||||
api.get<Entry[]>("/entries").then((r) => r.data.map(normalizeEntry)),
|
||||
|
||||
getById: (id: number) =>
|
||||
api.get<Entry>(`/entries/${id}`).then((r) => normalizeEntry(r.data)),
|
||||
|
||||
create: (tmdb_id: number, is_tvserie: boolean) =>
|
||||
api.post<Entry>('/entries', { tmdb_id, is_tvserie }).then((r) => normalizeEntry(r.data)),
|
||||
api
|
||||
.post<Entry>("/entries", { tmdb_id, is_tvserie })
|
||||
.then((r) => normalizeEntry(r.data)),
|
||||
|
||||
update: (id: number, data: Partial<Entry>) =>
|
||||
api.put<Entry>(`/entries/${id}`, { entryData: data }).then((r) => normalizeEntry(r.data)),
|
||||
api
|
||||
.put<Entry>(`/entries/${id}`, { entryData: data })
|
||||
.then((r) => normalizeEntry(r.data)),
|
||||
|
||||
updateRatings: (
|
||||
id: number,
|
||||
@@ -23,39 +27,48 @@ export const entriesApi = {
|
||||
tmdb_rating?: number | null;
|
||||
imdb_rating?: number | null;
|
||||
rotten_tomatoes_rating?: number | null;
|
||||
}
|
||||
) => api.put(`/entries/${id}/ratings`, { entryRatings: ratings }).then((r) => r.data),
|
||||
},
|
||||
) =>
|
||||
api
|
||||
.put(`/entries/${id}/ratings`, { entryRatings: ratings })
|
||||
.then((r) => r.data),
|
||||
|
||||
updateIds: (
|
||||
id: number,
|
||||
ids: { tmdb_id?: number; imdb_id?: string; tvdb_id?: number }
|
||||
ids: { tmdb_id?: number; imdb_id?: string; tvdb_id?: number },
|
||||
) => api.put(`/entries/${id}/ids`, ids).then((r) => r.data),
|
||||
|
||||
delete: (id: number) => api.delete(`/entries/${id}`).then((r) => r.data),
|
||||
|
||||
refresh: (id: number) =>
|
||||
api.put<Entry>(`/entries/${id}/refresh`).then((r) => normalizeEntry(r.data)),
|
||||
api
|
||||
.put<Entry>(`/entries/${id}/refresh`)
|
||||
.then((r) => normalizeEntry(r.data)),
|
||||
|
||||
fetchCollection: (id: number) =>
|
||||
api.put(`/entries/${id}/fetch-collection`).then((r) => r.data),
|
||||
|
||||
getSeasons: (id: number) =>
|
||||
api.get(`/entries/${id}/seasons`).then((r) => Array.isArray(r.data) ? r.data : []),
|
||||
api
|
||||
.get(`/entries/${id}/seasons`)
|
||||
.then((r) => (Array.isArray(r.data) ? r.data : [])),
|
||||
|
||||
getCredits: (id: number) =>
|
||||
api
|
||||
.get<Credit[]>(`/entries/${id}/credits`)
|
||||
.then((r) => (Array.isArray(r.data) ? r.data.map(normalizeCredit) : [])),
|
||||
|
||||
syncSeries: () => api.get('/entries/sync-series').then((r) => r.data),
|
||||
syncSeries: () => api.get("/entries/sync-series").then((r) => r.data),
|
||||
|
||||
previewTmdb: (tmdbId: number, type: 'movie' | 'tv') =>
|
||||
api.get<TmdbPreview>(`/entries/tmdb/preview/${type}/${tmdbId}`).then((r) => r.data),
|
||||
previewTmdb: (tmdbId: number, type: "movie" | "tv") =>
|
||||
api
|
||||
.get<TmdbPreview>(`/entries/tmdb/preview/${type}/${tmdbId}`)
|
||||
.then((r) => r.data),
|
||||
|
||||
uploadMedia: (id: number, formData: FormData) =>
|
||||
api
|
||||
.post(`/entries/${id}/media`, formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { EntrySeen } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { EntrySeen } from "@/types";
|
||||
|
||||
export const entrySeenApi = {
|
||||
getAll: () => api.get<EntrySeen[]>('/entry-seen').then((r) => r.data),
|
||||
getAll: () => api.get<EntrySeen[]>("/entry-seen").then((r) => r.data),
|
||||
|
||||
getById: (id: number) =>
|
||||
api.get<EntrySeen>(`/entry-seen/${id}`).then((r) => r.data),
|
||||
@@ -16,8 +16,12 @@ export const entrySeenApi = {
|
||||
throw err;
|
||||
}),
|
||||
|
||||
create: (data: { entry_id: number; date_seen: string; seen_with?: string; accuracy?: string }) =>
|
||||
api.post<EntrySeen>('/entry-seen', data).then((r) => r.data),
|
||||
create: (data: {
|
||||
entry_id: number;
|
||||
date_seen: string;
|
||||
seen_with?: string;
|
||||
accuracy?: string;
|
||||
}) => api.post<EntrySeen>("/entry-seen", data).then((r) => r.data),
|
||||
|
||||
update: (id: number, data: Partial<EntrySeen>) =>
|
||||
api.put<EntrySeen>(`/entry-seen/${id}`, data).then((r) => r.data),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { EpisodeSeen } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { EpisodeSeen } from "@/types";
|
||||
|
||||
export const episodeSeenApi = {
|
||||
getAll: () => api.get<EpisodeSeen[]>('/episode-seen').then((r) => r.data),
|
||||
getAll: () => api.get<EpisodeSeen[]>("/episode-seen").then((r) => r.data),
|
||||
|
||||
getById: (id: number) =>
|
||||
api.get<EpisodeSeen>(`/episode-seen/${id}`).then((r) => r.data),
|
||||
@@ -22,11 +22,10 @@ export const episodeSeenApi = {
|
||||
date_seen: string;
|
||||
seen_with?: string;
|
||||
accuracy?: string;
|
||||
}) => api.post<EpisodeSeen>('/episode-seen', data).then((r) => r.data),
|
||||
}) => api.post<EpisodeSeen>("/episode-seen", data).then((r) => r.data),
|
||||
|
||||
update: (id: number, data: Partial<EpisodeSeen>) =>
|
||||
api.put<EpisodeSeen>(`/episode-seen/${id}`, data).then((r) => r.data),
|
||||
|
||||
delete: (id: number) =>
|
||||
api.delete(`/episode-seen/${id}`).then((r) => r.data),
|
||||
delete: (id: number) => api.delete(`/episode-seen/${id}`).then((r) => r.data),
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { Episode } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { Episode } from "@/types";
|
||||
|
||||
export const episodesApi = {
|
||||
getByMonth: (startDate: string, endDate: string) =>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { People, Credit } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { People, Credit } from "@/types";
|
||||
|
||||
export interface TmdbFilmographyItem {
|
||||
id: number;
|
||||
@@ -8,7 +8,7 @@ export interface TmdbFilmographyItem {
|
||||
poster_path: string | null;
|
||||
release_date?: string;
|
||||
first_air_date?: string;
|
||||
media_type: 'movie' | 'tv';
|
||||
media_type: "movie" | "tv";
|
||||
character?: string;
|
||||
job?: string;
|
||||
department?: string;
|
||||
@@ -44,31 +44,38 @@ export interface PaginatedPeopleResponse {
|
||||
}
|
||||
|
||||
export const peopleApi = {
|
||||
getAll: () => api.get<People[]>('/people').then((r) => r.data),
|
||||
getAll: () => api.get<People[]>("/people").then((r) => r.data),
|
||||
|
||||
getAllPaginated: (page: number, limit: number, search?: string) =>
|
||||
api
|
||||
.get<PaginatedPeopleResponse>('/people', { params: { page, limit, ...(search ? { search } : {}) } })
|
||||
.get<PaginatedPeopleResponse>("/people", {
|
||||
params: { page, limit, ...(search ? { search } : {}) },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getById: (id: number) =>
|
||||
api.get<People>(`/people/${id}`).then((r) => r.data),
|
||||
getById: (id: number) => api.get<People>(`/people/${id}`).then((r) => r.data),
|
||||
|
||||
getCredits: (id: number) =>
|
||||
api.get<Credit[]>(`/people/${id}/credits`).then((r) => r.data),
|
||||
|
||||
getTmdbFilmography: (id: number) =>
|
||||
api.get<TmdbFilmographyResponse>(`/people/${id}/tmdb-filmography`).then((r) => r.data),
|
||||
api
|
||||
.get<TmdbFilmographyResponse>(`/people/${id}/tmdb-filmography`)
|
||||
.then((r) => r.data),
|
||||
|
||||
previewTmdb: (tmdbId: number) =>
|
||||
api.get<TmdbPersonPreview>(`/people/tmdb/preview/${tmdbId}`).then((r) => r.data),
|
||||
api
|
||||
.get<TmdbPersonPreview>(`/people/tmdb/preview/${tmdbId}`)
|
||||
.then((r) => r.data),
|
||||
|
||||
fetchByTmdbId: (tmdb_id: number, pinned = false) =>
|
||||
api.post<People>('/people/fetch', { tmdb_id, pinned }).then((r) => r.data),
|
||||
api.post<People>("/people/fetch", { tmdb_id, pinned }).then((r) => r.data),
|
||||
|
||||
update: (id: number, data: Partial<People>) =>
|
||||
api.put<People>(`/people/${id}`, data).then((r) => r.data),
|
||||
|
||||
search: (query: string) =>
|
||||
api.get<People[]>('/people/search', { params: { query } }).then((r) => r.data),
|
||||
api
|
||||
.get<People[]>("/people/search", { params: { query } })
|
||||
.then((r) => r.data),
|
||||
};
|
||||
@@ -1,8 +1,8 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { Season, Episode } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { Season, Episode } from "@/types";
|
||||
|
||||
export const seasonsApi = {
|
||||
getAll: () => api.get<Season[]>('/seasons').then((r) => r.data),
|
||||
getAll: () => api.get<Season[]>("/seasons").then((r) => r.data),
|
||||
|
||||
getById: (id: number) =>
|
||||
api.get<Season>(`/seasons/${id}`).then((r) => r.data),
|
||||
@@ -11,7 +11,7 @@ export const seasonsApi = {
|
||||
api.get<Episode[]>(`/seasons/${id}/episodes`).then((r) => r.data),
|
||||
|
||||
create: (data: Partial<Season>) =>
|
||||
api.post<Season>('/seasons', data).then((r) => r.data),
|
||||
api.post<Season>("/seasons", data).then((r) => r.data),
|
||||
|
||||
update: (id: number, data: Partial<Season>) =>
|
||||
api.put<Season>(`/seasons/${id}`, data).then((r) => r.data),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { Settings } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { Settings } from "@/types";
|
||||
|
||||
export const settingsApi = {
|
||||
get: () => api.get<Settings>('/settings').then((r) => r.data),
|
||||
get: () => api.get<Settings>("/settings").then((r) => r.data),
|
||||
|
||||
update: (data: Partial<Settings>) =>
|
||||
api.put<Settings>('/settings', data).then((r) => r.data),
|
||||
api.put<Settings>("/settings", data).then((r) => r.data),
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import { api } from '@/lib/api';
|
||||
import { api } from "@/lib/api";
|
||||
|
||||
export interface MonthlyCountItem {
|
||||
month: number;
|
||||
@@ -37,11 +37,17 @@ export interface AllTimeWatchTime {
|
||||
|
||||
export const statisticsApi = {
|
||||
getAllTimeWatchTime: () =>
|
||||
api.get<AllTimeWatchTime>('/statistics/watch-time').then((r) => r.data),
|
||||
api.get<AllTimeWatchTime>("/statistics/watch-time").then((r) => r.data),
|
||||
getYearlyWatchCount: (year: number) =>
|
||||
api.get<YearlyWatchCount>(`/statistics/watch-count/year/${year}`).then((r) => r.data),
|
||||
api
|
||||
.get<YearlyWatchCount>(`/statistics/watch-count/year/${year}`)
|
||||
.then((r) => r.data),
|
||||
getYearlyWatchTime: (year: number) =>
|
||||
api.get<YearlyWatchTime>(`/statistics/watch-time/year/${year}`).then((r) => r.data),
|
||||
api
|
||||
.get<YearlyWatchTime>(`/statistics/watch-time/year/${year}`)
|
||||
.then((r) => r.data),
|
||||
getWatchdayDistribution: () =>
|
||||
api.get<WatchdayDistribution>('/statistics/watch-weekday').then((r) => r.data),
|
||||
api
|
||||
.get<WatchdayDistribution>("/statistics/watch-weekday")
|
||||
.then((r) => r.data),
|
||||
};
|
||||
@@ -1,73 +1,73 @@
|
||||
import { api } from '@/lib/api';
|
||||
import type { TmdbEntry, TmdbPaginatedResponse, TmdbPerson } from '@/types';
|
||||
import { api } from "@/lib/api";
|
||||
import type { TmdbEntry, TmdbPaginatedResponse, TmdbPerson } from "@/types";
|
||||
|
||||
export const tmdbApi = {
|
||||
getPopularMovies: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/popular/movie', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/popular/movie", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getPopularTv: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/popular/tv', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/popular/tv", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getTrendingMovies: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/trending/movie', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/trending/movie", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getTrendingTv: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/trending/tv', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/trending/tv", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getTopRatedMovies: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/top-rated/movie', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/top-rated/movie", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getTopRatedTv: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/top-rated/tv', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/top-rated/tv", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getUpcomingMovies: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/upcoming/movie', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/upcoming/movie", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
search: (query: string, page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/search', {
|
||||
.get<TmdbPaginatedResponse<TmdbEntry>>("/entries/tmdb/search", {
|
||||
params: { query, page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
getPopularPeople: (page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbPerson>>('/people/tmdb/popular', {
|
||||
.get<TmdbPaginatedResponse<TmdbPerson>>("/people/tmdb/popular", {
|
||||
params: { page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
searchPeople: (query: string, page = 1) =>
|
||||
api
|
||||
.get<TmdbPaginatedResponse<TmdbPerson>>('/people/tmdb/search', {
|
||||
.get<TmdbPaginatedResponse<TmdbPerson>>("/people/tmdb/search", {
|
||||
params: { query, page },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
Reference in new issue
Block a user