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',
94 getStreamingPlaylistAttributes () {
95 let playlistKeys = [ 'id', 'playlistUrl', 'playlistFilename', 'type' ]
97 if (this.mode === 'get') {
98 playlistKeys = playlistKeys.concat([
99 'p2pMediaLoaderInfohashes',
100 'p2pMediaLoaderPeerVersion',
101 '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 getScheduleUpdateAttributes () {
151 getLiveAttributes () {
163 getTrackerAttributes () {
164 return [ 'id', 'url' ]
167 getVideoTrackerAttributes () {
176 getRedundancyAttributes () {
177 return [ 'id', 'fileUrl' ]
180 getActorAttributes () {
181 let attributeKeys = [
189 if (this.mode === 'get') {
190 attributeKeys = attributeKeys.concat([
208 getAvatarAttributes () {
209 let attributeKeys = [
219 if (this.mode === 'get') {
220 attributeKeys = attributeKeys.concat([
230 getServerAttributes () {
231 return [ 'id', 'host' ]
234 getVideoAttributes () {
258 'originallyPublishedAt',