diff --git a/src/fetchers.ts b/src/fetchers.ts index 4a16707..6b97e7d 100644 --- a/src/fetchers.ts +++ b/src/fetchers.ts @@ -74,8 +74,8 @@ export const fetchGallery = async (galleryID: string): Promise => { if (!postDataMatches || postDataMatches.length < 2) { throw new Error('Could not parse gallery data'); } - const postData = JSON.parse(JSON.parse(postDataMatches[1])); - return postData; + const body = postDataMatches[1].replace(/\\'/g, "'"); + return JSON.parse(JSON.parse(body)); }; export const fetchMedia = async (filename: string): Promise> => diff --git a/src/handlers.ts b/src/handlers.ts index 6e8d815..27c80ca 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -33,7 +33,6 @@ export const handleAlbum = async (request: Hapi.Request, h: Hapi.ResponseToolkit pageTitle: CONFIG.page_title, util, }); - }; export const handleUser = (request: Hapi.Request, h: Hapi.ResponseToolkit) => {