Skip to content

Commit

Permalink
mediaUtils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
joshholly committed Jun 13, 2024
1 parent 0332a99 commit b5ff18c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/utils/mediaUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// mediaUtils.ts
import { Media } from "@/utils/discover";
import { MediaItem } from "@/utils/mediaTypes";

export function convertToMediaItem(
media: Media,
type: "movie" | "show",
): MediaItem {
return {
id: media.id.toString(),
title: media.title || media.name || "Untitled",
poster: `https://image.tmdb.org/t/p/w342/${media.poster_path}`,
type,
year: undefined, // You can set this based on your requirements
release_date: undefined, // You can set this based on your requirements
};
}

0 comments on commit b5ff18c

Please sign in to comment.