Skip to content

Commit

Permalink
add: tag support for insert_playlist_entry endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanChrisBrown committed Mar 7, 2024
1 parent 8742373 commit ca2f66d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/library/playlists/playlistItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface PlaylistItemArgs {
orchestration: string
name: string
index: number
tag: string | undefined
id: string
uri: string
rows: number
Expand All @@ -29,6 +30,7 @@ class PlaylistItem {
public id: number
public index: number
public playlistName: string
public tag: string | undefined

constructor(args: {
hologram: HologramType
Expand Down Expand Up @@ -60,6 +62,7 @@ class PlaylistItem {
aspect: settings.aspect,
view_count: settings.viewCount,
isRGBD: 0,
tag: settings.tag ? settings.tag : "",
}
return playlistItem
} else if (this.hologram.type == "rgbd") {
Expand All @@ -81,6 +84,7 @@ class PlaylistItem {
chroma_depth: settings.chroma_depth,
depthiness: settings.depthiness,
zoom: settings.zoom,
tag: settings.tag ? settings.tag : "",
}
return playlistItem
}
Expand Down
2 changes: 2 additions & 0 deletions src/library/schemas/schema.hologram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const QuiltHologramArgs = z.object({
aspect: z.number(),
viewCount: z.number(),
focus: z.number().optional(),
tag: z.string().optional(),
})

export const RGBDHologramArgs = z.object({
Expand All @@ -36,6 +37,7 @@ export const RGBDHologramArgs = z.object({
depth_cutoff: z.union([z.literal(1), z.literal(0)]).optional(),
/**Zoom can be between 0.1 and 2 */
zoom: ZOOM.range,
tag: z.string().optional(),
})

export interface HologramClasses {
Expand Down
1 change: 1 addition & 0 deletions src/library/schemas/schema.requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const insert_playlist_entry = z.object({
chroma_depth: z.union([z.literal(0), z.literal(1)]).optional(),
depthiness: z.number().optional(),
zoom: z.number().optional(),
tag: z.string().optional(),
})

export type update_playlist_entry = {
Expand Down
3 changes: 2 additions & 1 deletion src/react-app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { PlaylistUI } from "./components/Playlist"

const quilt = new QuiltHologram({
uri: "https://s3.amazonaws.com/lkg-blocks/u/9aa4b54a7346471d/steampunk_qs8x13.jpg",
settings: { rows: 13, columns: 8, aspect: 0.75, viewCount: 8 * 13 },
settings: { rows: 13, columns: 8, aspect: 0.75, viewCount: 8 * 13, tag: "steampunk" },
})

const rgbd = new RGBDHologram({
Expand All @@ -32,6 +32,7 @@ const rgbd = new RGBDHologram({
depth_loc: 2,
depth_cutoff: 1,
zoom: 1,
tag: "flowers",
},
})

Expand Down

0 comments on commit ca2f66d

Please sign in to comment.