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 () {
168 getTrackerAttributes () {
169 return [ 'id', 'url' ]
172 getVideoTrackerAttributes () {
181 getRedundancyAttributes () {
182 return [ 'id', 'fileUrl' ]
185 getActorAttributes () {
186 let attributeKeys = [
193 if (this.mode === 'get') {
194 attributeKeys = attributeKeys.concat([
212 getAvatarAttributes () {
213 let attributeKeys = [
224 if (this.mode === 'get') {
225 attributeKeys = attributeKeys.concat([
235 getServerAttributes () {
236 return [ 'id', 'host' ]
239 getVideoAttributes () {
263 'originallyPublishedAt',