From a89285354b0a52a55d73ad5dcb01fe725f3e1beb Mon Sep 17 00:00:00 2001 From: Jiyu Omine Date: Sat, 8 Dec 2018 16:25:21 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:MySQL=E3=81=AE=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=AB=E3=82=88=E3=82=8A=E5=8B=95?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/video.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/video.rb b/app/models/video.rb index e3463e9..9202a4e 100644 --- a/app/models/video.rb +++ b/app/models/video.rb @@ -291,6 +291,8 @@ def self.get_dl_video_info(id) model_name ,disp_name ,distribution + ,extension + ,status ORDER BY extension ASC ,model_name ASC; From a50fa8364ec8d229e3bc4f5b33993900b4673aec Mon Sep 17 00:00:00 2001 From: Jiyu Omine Date: Sat, 8 Dec 2018 16:37:09 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:turbolinks=E3=81=8C=E6=82=AA=E3=81=95?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=AE=E3=81=A7=E7=84=A1=E5=8A=B9=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/videos_controller.rb | 3 +-- app/views/videos/index.html.slim | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/videos_controller.rb b/app/controllers/videos_controller.rb index 34b2584..a5fcc2f 100644 --- a/app/controllers/videos_controller.rb +++ b/app/controllers/videos_controller.rb @@ -90,8 +90,7 @@ def destroy_all # zipファイルDL def zip dl_file = Video.create_dl_zip(@video.id) - stat = File::stat(dl_file) - send_file(dl_file, :filename => ERB::Util.url_encode(@video.name)+ '_' + Time.now.strftime('%Y%m%d%H%M%S') + '.zip', :length => stat.size) + send_file(dl_file, type: 'application/zip', :filename => ERB::Util.url_encode(@video.name)+ '_' + Time.now.strftime('%Y%m%d%H%M%S') + '.zip') end private diff --git a/app/views/videos/index.html.slim b/app/views/videos/index.html.slim index c4dff21..4a2d8b0 100644 --- a/app/views/videos/index.html.slim +++ b/app/views/videos/index.html.slim @@ -48,7 +48,7 @@ td.text-right = video.yets td - = link_to zip_video_path(video), class: "btn btn-default btn-sm" do + = link_to zip_video_path(video), class: "btn btn-default btn-sm", data: { turbolinks: false } do i.glyphicon.glyphicon-download-alt | ダウンロード = paginate(@videos)