4 * Class to build video attributes/join names we want to fetch from the database
7 export class VideoTables {
9 constructor (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 () {
96 let playlistKeys = [ 'id', 'playlistUrl', 'playlistFilename', 'type' ]
98 if (this.mode === 'get') {
99 playlistKeys = playlistKeys.concat([
100 'p2pMediaLoaderInfohashes',
101 'p2pMediaLoaderPeerVersion',
102 'segmentsSha256Filename',
114 getUserHistoryAttributes () {
115 return [ 'id', 'currentTime' ]
118 getPlaylistAttributes () {
130 getTagAttributes () {
131 return [ 'id', 'name' ]
134 getVideoTagAttributes () {
135 return [ 'videoId', 'tagId', 'createdAt', 'updatedAt' ]
138 getBlacklistedAttributes () {
139 return [ 'id', 'reason', 'unfederated' ]
142 getBlocklistAttributes () {
146 getScheduleUpdateAttributes () {
157 getLiveAttributes () {
169 getTrackerAttributes () {
170 return [ 'id', 'url' ]
173 getVideoTrackerAttributes () {
182 getRedundancyAttributes () {
183 return [ 'id', 'fileUrl' ]
186 getActorAttributes () {
187 let attributeKeys = [
195 if (this.mode === 'get') {
196 attributeKeys = attributeKeys.concat([
214 getAvatarAttributes () {
215 let attributeKeys = [
225 if (this.mode === 'get') {
226 attributeKeys = attributeKeys.concat([
236 getServerAttributes () {
237 return [ 'id', 'host' ]
240 getVideoAttributes () {
264 'originallyPublishedAt',