-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the GUI and system checks that handle uploading video data
- Loading branch information
Showing
8 changed files
with
104 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div class="bg-processes"> | ||
<%= render ProcessComponent.new worker: ScanPlexWorker do |c| %> | ||
<%= c.with_body do %> | ||
<% if ScanPlexWorker.job.pending? %> | ||
<%= | ||
render( | ||
ProgressBarComponent.new( | ||
model: Movie, | ||
completed: (ScanPlexWorker.job.worker.completed.zero? ? 20 : ScanPlexWorker.job.worker.completed), | ||
status: :success, | ||
message: 'scanning plex for movies', | ||
show_percentage: false | ||
) | ||
) | ||
%> | ||
<% else %> | ||
<span>Done! you have a total of <%= pluralize(Video.count, 'video') %> on plex.</span> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= render ProcessComponent.new worker: LoadDiskWorker do |c| %> | ||
<%= c.with_body do %> | ||
<% if LoadDiskWorker.job.pending? %> | ||
<span>Loading the disk info</span> | ||
<% elsif (disks = FindExistingDisksService.call).any? %> | ||
<span><%= disks.map(&:name).join(', ') %> is ready to be ripped.</span> | ||
<% else %> | ||
<span>No disks found</span> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<%= render ProcessComponent.new worker: UploadWorker do |c| %> | ||
<%= c.with_body do %> | ||
<% if UploadWorker.job.pending? %> | ||
|
||
<%= | ||
render( | ||
ProgressBarComponent.new( | ||
model: DiskTitle, | ||
show_percentage: false, | ||
status: :info, | ||
message: 'upload in progress' | ||
) | ||
) | ||
%> | ||
<% else %> | ||
<span>Nothing is being uploaded to <%= Config::Plex.newest.settings_ftp_host %> </span> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
class UploadWorker < ApplicationWorker | ||
option :disk_title, Types.Instance(DiskTitle) | ||
|
||
def perform | ||
progress_listener = UploadProgressListener.new( | ||
title: "Uploading #{disk_title.video.title}", | ||
file_size: disk_title.size | ||
) | ||
Ftp::UploadMkvService.call disk_title:, | ||
progress_listener: | ||
end | ||
end |