Compare commits
3 Commits
prevent-AP
...
show-broad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41a9e83fb2 | ||
|
|
7c828b4cd2 | ||
|
|
6bd0439471 |
@@ -4,7 +4,6 @@ require './lib/knock_monkeypatch'
|
|||||||
|
|
||||||
class Api::UserTokenController < Knock::AuthTokenController
|
class Api::UserTokenController < Knock::AuthTokenController
|
||||||
include Oath::ControllerHelpers
|
include Oath::ControllerHelpers
|
||||||
include RememberMe::Controller
|
|
||||||
|
|
||||||
skip_before_action :verify_authenticity_token
|
skip_before_action :verify_authenticity_token
|
||||||
before_action :sign_in_user
|
before_action :sign_in_user
|
||||||
|
|||||||
@@ -18,4 +18,8 @@ class BroadcastRecording < ApplicationRecord
|
|||||||
def download_file_name
|
def download_file_name
|
||||||
"#{broadcast_name}_Date_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%Y-%m-%d")}_Time_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%T")}".parameterize
|
"#{broadcast_name}_Date_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%Y-%m-%d")}_Time_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%T")}".parameterize
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def thumbnail_url(width = 300)
|
||||||
|
"https://image.mux.com/#{asset_playback_uid}/thumbnail.jpg?width=#{width}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
<ul class="mt-2">
|
<ul class="mt-2">
|
||||||
<% recordings.each do |recording| %>
|
<% recordings.each do |recording| %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %>
|
<%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %>
|
||||||
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
|
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
|
||||||
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
|
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= image_tag(recording.thumbnail_url, class: 'img-thumbnail img-fluid mt-2 mb-2') %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
Rails.application.config.session_store :cookie_store, key: '_easy_release_session', expire_after: 1.month
|
|
||||||
@@ -9,6 +9,20 @@ SET xmloption = content;
|
|||||||
SET client_min_messages = warning;
|
SET client_min_messages = warning;
|
||||||
SET row_security = off;
|
SET row_security = off;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
|
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
|
||||||
--
|
--
|
||||||
@@ -1489,7 +1503,6 @@ CREATE TABLE public.settings (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE SEQUENCE public.settings_id_seq
|
CREATE SEQUENCE public.settings_id_seq
|
||||||
AS integer
|
|
||||||
START WITH 1
|
START WITH 1
|
||||||
INCREMENT BY 1
|
INCREMENT BY 1
|
||||||
NO MINVALUE
|
NO MINVALUE
|
||||||
@@ -1525,7 +1538,6 @@ CREATE TABLE public.taggings (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE SEQUENCE public.taggings_id_seq
|
CREATE SEQUENCE public.taggings_id_seq
|
||||||
AS integer
|
|
||||||
START WITH 1
|
START WITH 1
|
||||||
INCREMENT BY 1
|
INCREMENT BY 1
|
||||||
NO MINVALUE
|
NO MINVALUE
|
||||||
@@ -1556,7 +1568,6 @@ CREATE TABLE public.tags (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE SEQUENCE public.tags_id_seq
|
CREATE SEQUENCE public.tags_id_seq
|
||||||
AS integer
|
|
||||||
START WITH 1
|
START WITH 1
|
||||||
INCREMENT BY 1
|
INCREMENT BY 1
|
||||||
NO MINVALUE
|
NO MINVALUE
|
||||||
|
|||||||
@@ -223,6 +223,18 @@ feature 'User managing broadcasts' do
|
|||||||
expect(page).to have_content("Recording of the live stream will appear here")
|
expect(page).to have_content("Recording of the live stream will appear here")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'Broadcast recording preview thumbnail is shown' do
|
||||||
|
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||||
|
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
|
||||||
|
|
||||||
|
visit project_broadcast_path(project, broadcast)
|
||||||
|
|
||||||
|
click_on 'Previous Sessions'
|
||||||
|
|
||||||
|
expect(page).to have_css('img.img-thumbnail')
|
||||||
|
expect(page.find('img.img-thumbnail')['src']).to match recording.asset_playback_uid
|
||||||
|
end
|
||||||
|
|
||||||
context 'When the user is associate' do
|
context 'When the user is associate' do
|
||||||
let(:current_user) { create(:user, :associate) }
|
let(:current_user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user