fix jellyfin and add new endpoint

This commit is contained in:
Enstrayed
2024-10-16 22:33:56 -07:00
parent fa2ef6927a
commit 69a06bc1c3
2 changed files with 22 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import { app, globalConfig } from "../index.js"
import { queryLastfm } from "../liberals/libnowplaying.js"
import { queryLastfm, queryJellyfin } from "../liberals/libnowplaying.js"
var timeSinceLastLastfmQuery = Date.now()-5000
var cachedLastfmResult = {}
@@ -23,4 +23,12 @@ app.get("/api/nowplaying", (rreq,rres) => {
})
app.get("/api/nowplayingbeta", (rreq,rres) => {
queryJellyfin().then(response => {
rres.send(response[rreq.query.format] ?? response.json)
})
})
export {app}