""refactor"" basically everything
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { globalConfig } = require("../index.js")
|
||||
import { globalConfig } from "../index.js"
|
||||
|
||||
/**
|
||||
* Checks if a token exists in the sessions file (authentication) and if it has the correct permissions (authorization)
|
||||
@@ -27,4 +27,4 @@ async function checkToken(token,scope) {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {checkToken}
|
||||
export {checkToken}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { globalConfig } = require("../index.js")
|
||||
import { globalConfig } from "../index.js"
|
||||
|
||||
/**
|
||||
* Queries LastFM for user set in config file and returns formatted result
|
||||
@@ -30,4 +30,17 @@ async function queryLastfm() {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { queryLastfm }
|
||||
// async function queryJellyfin() {
|
||||
// return await fetch(`${globalConfig.nowplaying.jellyfin.host}/Sessions`, {
|
||||
// headers: {
|
||||
// "Authorization": `MediaBrowser Token=${globalConfig.nowplaying.jellyfin.apiKey}`
|
||||
// }
|
||||
// }).then(response => response.json()).then(response => {
|
||||
// for (x in response) {
|
||||
// if (response[x].UserName !== globalConfig.nowplaying.jellyfin.target) { break }
|
||||
// if (response[x].)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
export { queryLastfm }
|
||||
@@ -23,4 +23,4 @@ function logRequest(response,request,code,extra) {
|
||||
console.log(`${request.get("cf-connecting-ip") ?? request.ip}${actualAuth}${request.method} ${request.path} returned ${code}${actualExtra}`)
|
||||
}
|
||||
|
||||
module.exports = { logRequest }
|
||||
export { logRequest }
|
||||
Reference in New Issue
Block a user