mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-28 23:31:37 +00:00
Auto-refresh expired profile pictures
This commit is contained in:
parent
f4969f86db
commit
9fd9a00932
7 changed files with 143 additions and 16 deletions
|
|
@ -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>}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue