Store more in database for complete fallback
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
const constants = require("../constants")
|
||||
const {proxyImage} = require("../utils/proxyurl")
|
||||
const {structure} = require("../utils/structuretext")
|
||||
const Timeline = require("./Timeline")
|
||||
require("../testimports")(constants, Timeline)
|
||||
|
||||
class ReelUser {
|
||||
/**
|
||||
* @param {import("../types").GraphUser} data
|
||||
*/
|
||||
constructor(data) {
|
||||
/** @type {import("../types").GraphUser} */
|
||||
this.data = data
|
||||
this.fromReel = true
|
||||
this.following = 0
|
||||
this.followedBy = 0
|
||||
this.posts = 0
|
||||
this.following = data.edge_follow ? data.edge_follow.count : 0
|
||||
this.followedBy = data.edge_followed_by ? data.edge_followed_by.count : 0
|
||||
/** @type {import("./Timeline")} */
|
||||
this.timeline = new Timeline(this)
|
||||
this.cachedAt = Date.now()
|
||||
@@ -20,7 +19,8 @@ class ReelUser {
|
||||
}
|
||||
|
||||
getStructuredBio() {
|
||||
return null
|
||||
if (!this.data.biography) return null
|
||||
return structure(this.data.biography)
|
||||
}
|
||||
|
||||
getTtl(scale = 1) {
|
||||
|
||||
@@ -51,6 +51,7 @@ class Timeline {
|
||||
addPage(page) {
|
||||
this.pages.push(transformEdges(page.edges))
|
||||
this.page_info = page.page_info
|
||||
this.user.posts = page.count
|
||||
}
|
||||
|
||||
async fetchFeed() {
|
||||
|
||||
Reference in New Issue
Block a user