4 * Class to build video attributes/join names we want to fetch from the database
7 export class VideoTableAttributes {
9 constructor (private readonly mode: 'get' | 'list') {
13 getChannelAttributesForUser () {
14 return [ 'id', 'accountId' ]
17 getChannelAttributes () {
25 if (this.mode === 'get') {
26 attributeKeys = attributeKeys.concat([
36 getUserAccountAttributes () {
37 return [ 'id', 'userId' ]
40 getAccountAttributes () {
41 let attributeKeys = [ 'id', 'name', 'actorId' ]
43 if (this.mode === 'get') {
44 attributeKeys = attributeKeys.concat([
55 getThumbnailAttributes () {
56 let attributeKeys = [ 'id', 'type', 'filename' ]
58 if (this.mode === 'get') {
59 attributeKeys = attributeKeys.concat([
63 'automaticallyGenerated',
74 getFileAttributes () {
89 'videoStreamingPlaylistId',
95 getStreamingPlaylistAttributes () {
101 'p2pMediaLoaderInfohashes',
102 'p2pMediaLoaderPeerVersion',
103 'segmentsSha256Filename',
112 getUserHistoryAttributes () {
113 return [ 'id', 'currentTime' ]
116 getPlaylistAttributes () {
128 getTagAttributes () {
129 return [ 'id', 'name' ]
132 getVideoTagAttributes () {
133 return [ 'videoId', 'tagId', 'createdAt', 'updatedAt' ]
136 getBlacklistedAttributes () {
137 return [ 'id', 'reason', 'unfederated' ]
140 getBlocklistAttributes () {
144 getScheduleUpdateAttributes () {
155 getLiveAttributes () {
169 getTrackerAttributes () {
170 return [ 'id', 'url' ]
173 getVideoTrackerAttributes () {
182 getRedundancyAttributes () {
183 return [ 'id', 'fileUrl' ]
186 getActorAttributes () {
187 let attributeKeys = [
194 if (this.mode === 'get') {
195 attributeKeys = attributeKeys.concat([
213 getAvatarAttributes () {
214 let attributeKeys = [
225 if (this.mode === 'get') {
226 attributeKeys = attributeKeys.concat([
236 getServerAttributes () {
237 return [ 'id', 'host' ]
240 getVideoAttributes () {
264 'originallyPublishedAt',