Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

1.5 KB
Raw Blame
import type { MantineColor } from "@mantine/core";

export const mediaTypeConfigurations = {
  movie: {
    color: "blue",
  },
  tv: {
    color: "violet",
  },
  music: {
    color: "green",
  },
  book: {
    color: "orange",
  },
  game: {
    color: "yellow",
  },
  video: {
    color: "red",
  },
  article: {
    color: "pink",
  },
  unknown: {
    color: "gray",
  },
} satisfies Record<string, { color: MantineColor }>;

export type MediaType = keyof typeof mediaTypeConfigurations;

export interface MediaRelease {
  id: string;
  type: MediaType;
  title: string;
  /**
   * The subtitle of the media item, if applicable.
   * Can also contain the season number for TV shows.
   */
  subtitle?: string;
  description?: string;
  releaseDate: Date;
  /** The source supplied a calendar date without a time or timezone. */
  releaseDateIsDateOnly?: boolean;
  imageUrls: {
    poster: string | undefined;
    backdrop: string | undefined;
  };
  /**
   * The name of the studio, publisher or author.
   */
  producer?: string;
  /**
   * Price in USD
   */
  price?: number;
  /**
   * Rating in any format (e.g. 5/10, 4.5/5, 90%, etc.)
   */
  rating?: string;
  /**
   * List of tags / genres / categories
   */
  tags: string[];
  /**
   * Link to the media item
   */
  href: string;
  /*
   * Video / Music: duration in seconds
   * Book: number of pages
   */
  length?: number;
}

export interface IMediaReleasesIntegration {
  getMediaReleasesAsync(): Promise<MediaRelease[]>;
}