@@ -19,7 +19,7 @@ const newCurationId = "89576";
19
19
*/
20
20
export type OpenProcessingCurationResponse = Array < {
21
21
/** Sketch ID used for constructing URLs */
22
- visualID : string ;
22
+ visualID : number ;
23
23
/** Title of sketch */
24
24
title : string ;
25
25
/** Description of sketch */
@@ -85,7 +85,7 @@ export const getCurationSketches = memoize(async (
85
85
*/
86
86
export type OpenProcessingSketchResponse = {
87
87
/** Sketch ID used for constructing URLs */
88
- visualID : string ;
88
+ visualID : number ;
89
89
/** Title of sketch */
90
90
title : string ;
91
91
/** Description of sketch */
@@ -108,7 +108,7 @@ export type OpenProcessingSketchResponse = {
108
108
* @returns
109
109
*/
110
110
export const getSketch = memoize (
111
- async ( id : string ) : Promise < OpenProcessingSketchResponse > => {
111
+ async ( id : number ) : Promise < OpenProcessingSketchResponse > => {
112
112
// check for memoized sketch in curation sketches
113
113
const curationSketches = await getCurationSketches ( ) ;
114
114
const memoizedSketch = curationSketches . find ( ( el ) => el . visualID === id ) ;
@@ -134,7 +134,7 @@ export const getSketch = memoize(
134
134
* But only uses the width and height properties from this call
135
135
* Width and height should instead be added to properties for `/api/sketch/:id` or `api/curation/:curationId/sketches` instead
136
136
*/
137
- export const getSketchSize = memoize ( async ( id : string ) => {
137
+ export const getSketchSize = memoize ( async ( id : number ) => {
138
138
const sketch = await getSketch ( id )
139
139
if ( sketch . mode !== 'p5js' ) {
140
140
return { width : undefined , height : undefined } ;
@@ -164,16 +164,16 @@ export const getSketchSize = memoize(async (id: string) => {
164
164
return { width : undefined , height : undefined } ;
165
165
} ) ;
166
166
167
- export const makeSketchLinkUrl = ( id : string ) =>
167
+ export const makeSketchLinkUrl = ( id : number ) =>
168
168
`https://openprocessing.org/sketch/${ id } ` ;
169
169
170
- export const makeSketchEmbedUrl = ( id : string ) =>
170
+ export const makeSketchEmbedUrl = ( id : number ) =>
171
171
`https://openprocessing.org/sketch/${ id } /embed/?plusEmbedFullscreen=true&plusEmbedInstructions=false` ;
172
172
173
- export const makeThumbnailUrl = ( id : string ) =>
173
+ export const makeThumbnailUrl = ( id : number ) =>
174
174
`https://openprocessing-usercontent.s3.amazonaws.com/thumbnails/visualThumbnail${ id } @2x.jpg` ;
175
175
176
- export const getSketchThumbnailSource = async ( id : string ) => {
176
+ export const getSketchThumbnailSource = async ( id : number ) => {
177
177
const manualThumbs = import . meta. glob < ImageMetadata > ( './images/*' , { import : 'default' } )
178
178
const key = `./images/${ id } .png` ;
179
179
if ( manualThumbs [ key ] ) {
0 commit comments