Skip to content

Commit

Permalink
fix: svelte-check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushSehrawat committed Nov 6, 2024
1 parent 9d501a7 commit d2cc15d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/lib/tmdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export async function getMovieDetails(
fetch: any,
language: string = 'en-US',
append_to_response: string | null = null,
movieId: number
movieId: string
) {
const params = { language, append_to_response };
const queryString = dictToQueryString(params);
Expand Down Expand Up @@ -190,7 +190,7 @@ export async function getTVDetails(
fetch: any,
language: string = 'en-US',
append_to_response: string | null = null,
tvId: number
tvId: string
) {
const params = { language, append_to_response };
const queryString = dictToQueryString(params);
Expand All @@ -209,7 +209,7 @@ export async function getTVSeasonDetails(
fetch: any,
language: string = 'en-US',
append_to_response: string | null = null,
tvId: number,
tvId: string,
seasonNumber: number
) {
const params = { language, append_to_response };
Expand Down
4 changes: 2 additions & 2 deletions src/routes/[type=mediaType]/[id]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { RivenItem } from '$lib/types';

export const load = (async ({ fetch, params }) => {
const type = params.type;
const id = Number(params.id);
const id = String(params.id);

const { data } = await ItemsService.getItem({
path: {
Expand All @@ -16,7 +16,7 @@ export const load = (async ({ fetch, params }) => {
}
});

async function getDetails(type: string, id: number) {
async function getDetails(type: string, id: string) {
switch (type) {
case 'movie':
// TODO: Remove the ones that are not needed in future
Expand Down
8 changes: 4 additions & 4 deletions src/routes/[type=mediaType]/[id]/[season]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import { ItemsService } from '$lib/client';

export const load = (async ({ fetch, params }) => {
const type = params.type;
const id = Number(params.id);
const id = String(params.id);
const season = Number(params.season);

if (type === 'movie') {
error(404, 'No seasons or episodes for movies');
}

async function getDetails(tvID: number, seasonNumber: number) {
async function getDetails(tvID: string, seasonNumber: number) {
return await getTVSeasonDetails(fetch, 'en-US', null, tvID, seasonNumber);
}

// not using parent data since it will be fetched again with useless data
async function mediaDetails(tvID: number) {
async function mediaDetails(tvID: string) {
return await getTVDetails(fetch, 'en-US', null, tvID);
}

async function getMediaItemDetails(tvID: number): Promise<any[]> {
async function getMediaItemDetails(tvID: string): Promise<any[]> {
const { data } = await ItemsService.getItem({
path: {
id: tvID
Expand Down

0 comments on commit d2cc15d

Please sign in to comment.