feat(widgets): add media release widget (#3219)

This commit is contained in:
Meier Lukas
2025-07-20 16:59:03 +02:00
committed by GitHub
parent fa8e704112
commit 66ebb5061f
27 changed files with 1117 additions and 24 deletions

View File

@@ -0,0 +1,76 @@
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;
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[]>;
}