mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2025-12-18 03:58:49 +00:00
Auto-refresh expired profile pictures
This commit is contained in:
@@ -5,6 +5,13 @@ function proxyImage(url, width) {
|
||||
return "/imageproxy?"+params.toString()
|
||||
}
|
||||
|
||||
function proxyProfilePic(url, userID) {
|
||||
const params = new URLSearchParams()
|
||||
params.set("userID", userID)
|
||||
params.set("url", url)
|
||||
return "/imageproxy?"+params.toString()
|
||||
}
|
||||
|
||||
function proxyVideo(url) {
|
||||
const params = new URLSearchParams()
|
||||
params.set("url", url)
|
||||
@@ -21,5 +28,6 @@ function proxyExtendedOwner(owner) {
|
||||
}
|
||||
|
||||
module.exports.proxyImage = proxyImage
|
||||
module.exports.proxyProfilePic = proxyProfilePic
|
||||
module.exports.proxyVideo = proxyVideo
|
||||
module.exports.proxyExtendedOwner = proxyExtendedOwner
|
||||
|
||||
@@ -25,7 +25,8 @@ class Got {
|
||||
*/
|
||||
response() {
|
||||
return this.send().instance.then(res => ({
|
||||
status: res.statusCode
|
||||
status: res.statusCode,
|
||||
headers: new Map(Object.entries(res.headers))
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @typedef GrabResponse
|
||||
* @property {number} status
|
||||
* @property {Map<string, string|string[]} headers
|
||||
*/
|
||||
|
||||
// @ts-nocheck
|
||||
@@ -14,7 +15,7 @@ class GrabReference {
|
||||
throw new Error("This is the reference class, do not instantiate it.")
|
||||
}
|
||||
|
||||
// Please help me type this
|
||||
// Please help me write typings for stream()
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user