-
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.
Fixed bug with Not finding disk info in DB & Made the GUI a bit nicer…
… when it comes to what is going on commit-id:a50256ab
- Loading branch information
Showing
5 changed files
with
46 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<table class="table" id="<%= dom_id %>"> | ||
<thead> | ||
<tr> | ||
<th>#</th> | ||
<th>Name</th> | ||
<th>Duration</th> | ||
<th>Size</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody class="disk_titles"> | ||
<% disks.each do |disk| %> | ||
<% disk.disk_titles.sort_by { |d| movie.runtime_range.include?(d.duration) ? 0 : 1 }.each do |disk_title| %> | ||
<% text_class = 'text-primary-emphasis' if movie.runtime_range.include?(disk_title.duration) %> | ||
|
||
<tr> | ||
<th scope="row" class="<%= text_class %>"><%= disk_title.id %></th> | ||
<td class="<%= text_class %>"><%= disk_title.name %></td> | ||
<td class="<%= text_class %>"><%= distance_of_time_in_words(disk_title.duration.seconds) %></td> | ||
<td class="<%= disk_title.size >= free_disk_space ? 'text-danger' : text_class %>"> | ||
<%= number_to_human_size(disk_title.size, precision: 3) %> | ||
<% if disk_title.size >= free_disk_space %> | ||
WARNING: Not enough space available to rip need another <%= number_to_human_size(disk_title.size - free_disk_space, precision: 3) %> | ||
<% end %> | ||
</td> | ||
<td class="<%= text_class %>"> | ||
<%= link_to 'Rip', video_disk_title_path(movie, disk_title), data: { turbo_method: :patch } %> | ||
</td> | ||
</tr> | ||
<% if disks.any? %> | ||
<table class="table" id="<%= dom_id %>"> | ||
<thead> | ||
<tr> | ||
<th>#</th> | ||
<th>Name</th> | ||
<th>Duration (<%= distance_of_time_in_words @movie.movie_runtime.seconds %>)</th> | ||
<th>Size</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody class="disk_titles"> | ||
<% disks.each do |disk| %> | ||
<% disk.disk_titles.sort_by { |d| movie.runtime_range.include?(d.duration) ? 0 : 1 }.each do |disk_title| %> | ||
<% text_class = 'text-primary-emphasis' if movie.runtime_range.include?(disk_title.duration) %> | ||
<% text_class = 'text-success-emphasis' if movie.disk_title&.name == disk_title.name %> | ||
<tr> | ||
<th scope="row" class="<%= text_class %>"><%= disk_title.id %></th> | ||
<td class="<%= text_class %>"><%= disk_title.name %></td> | ||
<td class="<%= text_class %>"><%= distance_of_time_in_words(disk_title.duration.seconds) %></td> | ||
<td class="<%= disk_title.size >= free_disk_space ? 'text-danger' : text_class %>"> | ||
<%= number_to_human_size(disk_title.size, precision: 3) %> | ||
<% if disk_title.size >= free_disk_space %> | ||
WARNING: Not enough space available to rip need another <%= number_to_human_size(disk_title.size - free_disk_space, precision: 3) %> | ||
<% end %> | ||
</td> | ||
<td class="<%= text_class %>"> | ||
<%= link_to 'Rip', video_disk_title_path(movie, disk_title), data: { turbo_method: :patch } %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% end %> | ||
|
||
<% end %> | ||
</tbody> | ||
</table> | ||
</tbody> | ||
</table> | ||
<% elsif LoadDiskWorker.job.pending? %> | ||
<p class="text-info">Loading Disk this might takes a while. Page will reload once ready. Fell free to refresh the page.</p> | ||
<% else %> | ||
<p class="text-warn">Sorry no Disk is currently loaded or could be detected. Refresh page if your seeing this warning but know a disk is present.</p> | ||
<% end %> |
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