mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-01 18:31:35 +00:00
Hopefully the final assistants changes
This commit is contained in:
parent
dc91575e1c
commit
41cbffa95a
9 changed files with 97 additions and 29 deletions
|
|
@ -7,7 +7,7 @@ module.exports = [
|
|||
{route: `/u/(${constants.external.username_regex})/(rss|atom)\\.xml`, methods: ["GET"], code: ({fill}) => {
|
||||
if (constants.settings.rss_enabled) {
|
||||
const kind = fill[1]
|
||||
return fetchUser(fill[0], true).then(async user => {
|
||||
return fetchUser(fill[0], constants.symbols.fetch_context.RSS).then(async user => {
|
||||
const feed = await user.timeline.fetchFeed()
|
||||
if (kind === "rss") {
|
||||
var data = {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ module.exports = [
|
|||
}
|
||||
|
||||
const params = url.searchParams
|
||||
return fetchUser(fill[0], false).then(async user => {
|
||||
return fetchUser(fill[0]).then(async user => {
|
||||
const page = +params.get("page")
|
||||
if (typeof page === "number" && !isNaN(page) && page >= 1) {
|
||||
await user.timeline.fetchUpToPage(page - 1)
|
||||
|
|
@ -97,7 +97,7 @@ module.exports = [
|
|||
},
|
||||
{
|
||||
route: `/fragment/user/(${constants.external.username_regex})/(\\d+)`, methods: ["GET"], code: async ({url, fill}) => {
|
||||
return fetchUser(fill[0], false).then(async user => {
|
||||
return fetchUser(fill[0]).then(async user => {
|
||||
const pageNumber = +fill[1]
|
||||
const pageIndex = pageNumber - 1
|
||||
await user.timeline.fetchUpToPage(pageIndex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue