From 3c79fb2256c6864726db84c2970750651cd203e3 Mon Sep 17 00:00:00 2001 From: osc-bot Date: Fri, 1 Sep 2023 02:17:14 +0000 Subject: [PATCH] lint a random file --- .../app/controllers/transfers_controller.rb | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/dashboard/app/controllers/transfers_controller.rb b/apps/dashboard/app/controllers/transfers_controller.rb index 2ebf2dc4ed..971cc6c354 100644 --- a/apps/dashboard/app/controllers/transfers_controller.rb +++ b/apps/dashboard/app/controllers/transfers_controller.rb @@ -1,11 +1,12 @@ -require "rclone_util" +# frozen_string_literal: true + +require 'rclone_util' # The controller for transfer pages /dashboard/transfers class TransfersController < ApplicationController - def show @transfer = Transfer.find(params[:id]) - if(@transfer) + if @transfer respond_to do |format| format.html format.json @@ -13,7 +14,7 @@ def show else respond_to do |format| format.html - format.json { render json:{ }, status: 404 } + format.json { render json: {}, status: 404 } end end end @@ -27,23 +28,24 @@ def create if from_fs == RcloneUtil::LOCAL_FS_NAME && to_fs == RcloneUtil::LOCAL_FS_NAME @transfer = PosixTransfer.build(action: body_params[:command], files: body_params[:files]) elsif ::Configuration.remote_files_enabled? - @transfer = RemoteTransfer.build(action: body_params[:command], files: body_params[:files], src_remote: from_fs, dest_remote: to_fs) + @transfer = RemoteTransfer.build(action: body_params[:command], files: body_params[:files], src_remote: from_fs, + dest_remote: to_fs) else - render json: { error_message: "Remote file support is not enabled" } + render json: { error_message: 'Remote file support is not enabled' } end - if ! @transfer.valid? + if !@transfer.valid? # error render json: { error_message: @transfer.errors.full_messages.join('. ') } elsif @transfer.synchronous? - logger.info "files: executing synchronous commmand in directory #{@transfer.from.to_s}: #{@transfer.command_str}" + logger.info "files: executing synchronous commmand in directory #{@transfer.from}: #{@transfer.command_str}" @transfer.perform respond_to do |format| format.json { render :show } end else - logger.info "files: initiating asynchronous commmand in directory #{@transfer.from.to_s}: #{@transfer.command_str}" + logger.info "files: initiating asynchronous commmand in directory #{@transfer.from}: #{@transfer.command_str}" @transfer.perform_later respond_to do |format|