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([
54 getThumbnailAttributes () {
55 let attributeKeys = [ 'id', 'type', 'filename' ]
57 if (this.mode === 'get') {
58 attributeKeys = attributeKeys.concat([
62 'automaticallyGenerated',
73 getFileAttributes () {
88 'videoStreamingPlaylistId',
93 getStreamingPlaylistAttributes () {
94 let playlistKeys = [ 'id', 'playlistUrl', 'type' ]
96 if (this.mode === 'get') {
97 playlistKeys = playlistKeys.concat([
98 'p2pMediaLoaderInfohashes',
99 'p2pMediaLoaderPeerVersion',
110 getUserHistoryAttributes () {
111 return [ 'id', 'currentTime' ]
114 getPlaylistAttributes () {
126 getTagAttributes () {
127 return [ 'id', 'name' ]
130 getVideoTagAttributes () {
131 return [ 'videoId', 'tagId', 'createdAt', 'updatedAt' ]
134 getBlacklistedAttributes () {
135 return [ 'id', 'reason', 'unfederated' ]
138 getScheduleUpdateAttributes () {
149 getLiveAttributes () {
161 getTrackerAttributes () {
162 return [ 'id', 'url' ]
165 getVideoTrackerAttributes () {
174 getRedundancyAttributes () {
175 return [ 'id', 'fileUrl' ]
178 getActorAttributes () {
179 let attributeKeys = [
187 if (this.mode === 'get') {
188 attributeKeys = attributeKeys.concat([
206 getAvatarAttributes () {
207 let attributeKeys = [
217 if (this.mode === 'get') {
218 attributeKeys = attributeKeys.concat([
228 getServerAttributes () {
229 return [ 'id', 'host' ]
232 getVideoAttributes () {
256 'originallyPublishedAt',