Skip to content

Commit

Permalink
add show artwork to show by timestamp api endpoint and make it previe…
Browse files Browse the repository at this point in the history
…w temporarily for testing puroposes (#160)
  • Loading branch information
antiantivirus authored Dec 12, 2024
1 parent 8a6b2e8 commit d9a9b17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/contentful/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const createPastShowSchema = (show: TypeShow): PastShowSchema => ({
mixcloudLink: show.fields.mixcloudLink,
coverImage: show.fields.coverImage.fields.file.url,
genres: show.fields.genres.map((genre) => genre.fields?.name).filter(Boolean),
showArtwork: show.fields.socialImage?.fields.file.url,
});

export async function getPastShows(
Expand Down Expand Up @@ -156,7 +157,7 @@ export async function getPastShows(

export async function getShowByTime(time) {
console.log(time);
const { items } = await client.getEntries<TypeShowFields>({
const { items } = await previewClient.getEntries<TypeShowFields>({
"fields.date[lte]": time,
"fields.dateEnd[gte]": time,
content_type: "show",
Expand Down
1 change: 1 addition & 0 deletions types/contentful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export interface TypeShowFields {
artists: Contentful.Entry<TypeArtistFields>[];
genres: Contentful.Entry<TypeGenreFields>[];
content?: CFRichTextTypes.Block | CFRichTextTypes.Inline;
socialImage?: Contentful.Asset;
}

export type TypeShow = Contentful.Entry<TypeShowFields>;
1 change: 1 addition & 0 deletions types/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export type PastShowSchema = {
coverImage: string;
mixcloudLink: string;
genres: string[];
showArtwork?: string;
};

export type ScheduleShow = {
Expand Down

0 comments on commit d9a9b17

Please sign in to comment.