chore: debug
This commit is contained in:
parent
93f61608ef
commit
d8cdb21b2e
3 changed files with 27 additions and 3 deletions
3
.env
3
.env
|
@ -8,4 +8,5 @@ API_KEY_MOVIEDB=
|
|||
API_TOKEN_READWISE=
|
||||
SECRET_FEED_ALBUM_RELEASES=
|
||||
COOKIE_STORYGRAPH=
|
||||
LISTENBRAINZ_TOKEN=
|
||||
LISTENBRAINZ_TOKEN=
|
||||
ACCOUNT_ID_PLEX =
|
|
@ -1,8 +1,30 @@
|
|||
import { getStore } from '@netlify/blobs'
|
||||
|
||||
export default async (request, context) => {
|
||||
console.log(request)
|
||||
console.log(context)
|
||||
const ACCOUNT_ID_PLEX = Netlify.env.get("ACCOUNT_ID_PLEX");
|
||||
const id = params.get('id')
|
||||
const params = new URL(request['url']).searchParams
|
||||
const data = await request.formData()
|
||||
const payload = data['payload']
|
||||
console.log(data)
|
||||
console.log(payload)
|
||||
|
||||
if (!id) return new Response(JSON.stringify({
|
||||
status: 'Bad request',
|
||||
}),
|
||||
{ headers: { "Content-Type": "application/json" } }
|
||||
)
|
||||
|
||||
if (id !== ACCOUNT_ID_PLEX) return new Response(JSON.stringify({
|
||||
status: 'Forbidden',
|
||||
}),
|
||||
{ headers: { "Content-Type": "application/json" } }
|
||||
)
|
||||
|
||||
if (payload?.event === 'media.scrobble') {
|
||||
console.log('scrobble')
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify({
|
||||
status: 'success',
|
||||
}),
|
||||
|
|
|
@ -3,6 +3,7 @@ export default {
|
|||
'aesop rock': 'aba64937-3334-4c65-90a1-4e6b9d4d7ada',
|
||||
afi: '1c3919b2-43ca-4a4a-935d-9d50135ec0ef',
|
||||
aset: '5dac39d3-beb8-4c99-9cdc-3e647a594af6',
|
||||
ataraxy: 'f17a2c62-51cf-4e7e-9640-a5da5b1178a3',
|
||||
augury: 'd651baba-5ce1-4315-b884-d951e0435418',
|
||||
autopsy: '1d097d38-d5ca-4cd4-9200-7f08eedd0875',
|
||||
basement: 'a8c7ff7a-ebc0-42c7-8828-475decf0ccdd',
|
||||
|
|
Reference in a new issue