File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ def webhook
9
9
puts params [ :broadcast ]
10
10
broadcast_id = params [ :broadcast ] [ 'id' ]
11
11
@stream = Stream . joins ( :user ) . find_by! ( 'users.username' => params [ :streamer ] , :recording_id => broadcast_id )
12
- @stream . update! ( recording_started_at : Time . parse ( params [ :broadcast ] [ 'snippet' ] [ 'actual_start_time' ] ) )
12
+ @stream . update! (
13
+ recording_started_at : Time . parse ( params [ :broadcast ] [ 'snippet' ] [ 'actual_start_time' ] ) ,
14
+ )
13
15
end
14
16
render nothing : true , status : :ok
15
17
end
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ def new
11
11
@stream . body = old_stream . body
12
12
@stream . tags = old_stream . tags
13
13
end
14
+ elsif @stream . published? && !@stream . archived?
15
+ return redirect_to profile_stream_path ( current_user . username )
14
16
end
15
17
if current_user . stream_key . blank?
16
18
current_user . generate_stream_key
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ def active
47
47
end
48
48
49
49
def preview_image_url
50
- "https://api.quickstream.io/coderwall/streams/#{ user . username } .png?size=400x"
50
+ if archived?
51
+ "https://i.ytimg.com/vi/#{ recording_id } /sddefault_live.jpg"
52
+ else
53
+ "https://api.quickstream.io/coderwall/streams/#{ user . username } .png?size=400x"
54
+ end
51
55
end
52
56
53
57
def source
You can’t perform that action at this time.
0 commit comments