File tree 3 files changed +12
-0
lines changed
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ module Teletube
71
71
@client .create_file
72
72
when " upload"
73
73
@client .upload_file
74
+ else
75
+ @client .get_files
74
76
end
75
77
when " videos"
76
78
case context.command
Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ module Teletube
150
150
@context .params[" upload_id" ] = JSON ::Any .new(upload.id)
151
151
end
152
152
153
+ def get_files
154
+ handle_response(@http .get(path: " /api/v1/videos/#{ @context .params[" video_id" ]} /files" ))
155
+ end
156
+
153
157
def get_videos
154
158
handle_response(@http .get(path: " /api/v1/channels/#{ @context .params[" channel_id" ]} /videos" ))
155
159
end
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ module Teletube
82
82
83
83
parser.on(" files" , " Interact with files." ) do
84
84
context.resource = " files"
85
+ parser.on(" list" , " List all files uploaded for a video." ) do
86
+ context.command = " list"
87
+ parser.on(" --video-id ID" , " The identifier of the video." ) do |video_id |
88
+ context.params[" video_id" ] = JSON ::Any .new(video_id)
89
+ end
90
+ end
85
91
parser.on(" create" , " Create a file." ) do
86
92
context.command = " create"
87
93
end
You can’t perform that action at this time.
0 commit comments