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 getChannelAttributes () {
21 if (this.mode === 'get') {
22 attributeKeys = attributeKeys.concat([
32 getAccountAttributes () {
33 let attributeKeys = [ 'id', 'name', 'actorId' ]
35 if (this.mode === 'get') {
36 attributeKeys = attributeKeys.concat([
46 getThumbnailAttributes () {
47 let attributeKeys = [ 'id', 'type', 'filename' ]
49 if (this.mode === 'get') {
50 attributeKeys = attributeKeys.concat([
54 'automaticallyGenerated',
65 getFileAttributes () {
80 'videoStreamingPlaylistId',
85 getStreamingPlaylistAttributes () {
86 let playlistKeys = [ 'id', 'playlistUrl', 'type' ]
88 if (this.mode === 'get') {
89 playlistKeys = playlistKeys.concat([
90 'p2pMediaLoaderInfohashes',
91 'p2pMediaLoaderPeerVersion',
102 getUserHistoryAttributes () {
103 return [ 'id', 'currentTime' ]
106 getPlaylistAttributes () {
118 getTagAttributes () {
119 return [ 'id', 'name' ]
122 getVideoTagAttributes () {
123 return [ 'videoId', 'tagId', 'createdAt', 'updatedAt' ]
126 getBlacklistedAttributes () {
127 return [ 'id', 'reason', 'unfederated' ]
130 getScheduleUpdateAttributes () {
141 getLiveAttributes () {
153 getTrackerAttributes () {
154 return [ 'id', 'url' ]
157 getVideoTrackerAttributes () {
166 getRedundancyAttributes () {
167 return [ 'id', 'fileUrl' ]
170 getActorAttributes () {
171 let attributeKeys = [
179 if (this.mode === 'get') {
180 attributeKeys = attributeKeys.concat([
198 getAvatarAttributes () {
199 let attributeKeys = [
209 if (this.mode === 'get') {
210 attributeKeys = attributeKeys.concat([
220 getServerAttributes () {
221 return [ 'id', 'host' ]
224 getVideoAttributes () {
248 'originallyPublishedAt',