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', 'type' ]
97 if (this.mode === 'get') {
98 playlistKeys = playlistKeys.concat([
99 'p2pMediaLoaderInfohashes',
100 'p2pMediaLoaderPeerVersion',
111 getUserHistoryAttributes () {
112 return [ 'id', 'currentTime' ]
115 getPlaylistAttributes () {
127 getTagAttributes () {
128 return [ 'id', 'name' ]
131 getVideoTagAttributes () {
132 return [ 'videoId', 'tagId', 'createdAt', 'updatedAt' ]
135 getBlacklistedAttributes () {
136 return [ 'id', 'reason', 'unfederated' ]
139 getScheduleUpdateAttributes () {
150 getLiveAttributes () {
162 getTrackerAttributes () {
163 return [ 'id', 'url' ]
166 getVideoTrackerAttributes () {
175 getRedundancyAttributes () {
176 return [ 'id', 'fileUrl' ]
179 getActorAttributes () {
180 let attributeKeys = [
188 if (this.mode === 'get') {
189 attributeKeys = attributeKeys.concat([
207 getAvatarAttributes () {
208 let attributeKeys = [
218 if (this.mode === 'get') {
219 attributeKeys = attributeKeys.concat([
229 getServerAttributes () {
230 return [ 'id', 'host' ]
233 getVideoAttributes () {
257 'originallyPublishedAt',