import { AccountModel } from '../account/account'
import { AvatarModel } from '../avatar/avatar'
import { ServerModel } from '../server/server'
-import { throwIfNotValid } from '../utils'
+import { isOutdated, throwIfNotValid } from '../utils'
import { VideoChannelModel } from '../video/video-channel'
import { ActorFollowModel } from './actor-follow'
import { VideoModel } from '../video/video'
id: this.url,
following: this.getFollowingUrl(),
followers: this.getFollowersUrl(),
+ playlists: this.getPlaylistsUrl(),
inbox: this.inboxUrl,
outbox: this.outboxUrl,
preferredUsername: this.preferredUsername,
return this.url + '/followers'
}
+ getPlaylistsUrl () {
+ return this.url + '/playlists'
+ }
+
getPublicKeyUrl () {
return this.url + '#main-key'
}
isOutdated () {
if (this.isOwned()) return false
- const now = Date.now()
- const createdAtTime = this.createdAt.getTime()
- const updatedAtTime = this.updatedAt.getTime()
-
- return (now - createdAtTime) > ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL &&
- (now - updatedAtTime) > ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL
+ return isOutdated(this, ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL)
}
}