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 getScheduleUpdateAttributes () {
153 getLiveAttributes () {
165 getTrackerAttributes () {
166 return [ 'id', 'url' ]
169 getVideoTrackerAttributes () {
178 getRedundancyAttributes () {
179 return [ 'id', 'fileUrl' ]
182 getActorAttributes () {
183 let attributeKeys = [
191 if (this.mode === 'get') {
192 attributeKeys = attributeKeys.concat([
210 getAvatarAttributes () {
211 let attributeKeys = [
221 if (this.mode === 'get') {
222 attributeKeys = attributeKeys.concat([
232 getServerAttributes () {
233 return [ 'id', 'host' ]
236 getVideoAttributes () {
260 'originallyPublishedAt',