diff --git a/app/components/movie_title_table_component.html.erb b/app/components/movie_title_table_component.html.erb index 03399f7a..62dcac90 100644 --- a/app/components/movie_title_table_component.html.erb +++ b/app/components/movie_title_table_component.html.erb @@ -1,34 +1,40 @@ -
# | -Name | -Duration | -Size | -- |
---|---|---|---|---|
<%= disk_title.id %> | -<%= disk_title.name %> | -<%= distance_of_time_in_words(disk_title.duration.seconds) %> | -- <%= 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 %> - | -- <%= link_to 'Rip', video_disk_title_path(movie, disk_title), data: { turbo_method: :patch } %> - | -
# | +Name | +Duration (<%= distance_of_time_in_words @movie.movie_runtime.seconds %>) | +Size | ++ |
---|---|---|---|---|
<%= disk_title.id %> | +<%= disk_title.name %> | +<%= distance_of_time_in_words(disk_title.duration.seconds) %> | ++ <%= 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 %> + | ++ <%= link_to 'Rip', video_disk_title_path(movie, disk_title), data: { turbo_method: :patch } %> + | +
Loading Disk this might takes a while. Page will reload once ready. Fell free to refresh the page.
+<% else %> +Sorry no Disk is currently loaded or could be detected. Refresh page if your seeing this warning but know a disk is present.
+<% end %> diff --git a/app/components/movie_title_table_component.rb b/app/components/movie_title_table_component.rb index 71390aee..7cb901ff 100644 --- a/app/components/movie_title_table_component.rb +++ b/app/components/movie_title_table_component.rb @@ -3,7 +3,7 @@ class MovieTitleTableComponent < ViewComponent::Base extend Dry::Initializer - option :disks, Types::Array.of(Types.Instance(Disk)) + option :disks, Types::Coercible::Array.of(Types.Instance(Disk)) option :movie, Types.Instance(Movie) def dom_id diff --git a/app/services/list_drives_service.rb b/app/services/list_drives_service.rb index f3a69a63..41a3dd54 100644 --- a/app/services/list_drives_service.rb +++ b/app/services/list_drives_service.rb @@ -2,14 +2,12 @@ class ListDrivesService extend Dry::Initializer - include Shell - include MkvParser option :noscan, Types::Bool, default: -> { false } class << self - def results(*) - new(*).results + def results(...) + new(...).results end end @@ -32,7 +30,7 @@ def info end def drives - @drives ||= parse_mkv_string(info.stdout_str).select do |i| + @drives ||= info.parsed_mkv.select do |i| i.is_a?(MkvParser::DRV) && i.enabled.to_i.positive? end end diff --git a/app/views/movies/show.html.erb b/app/views/movies/show.html.erb index 0ea4eb60..fb756d25 100644 --- a/app/views/movies/show.html.erb +++ b/app/views/movies/show.html.erb @@ -17,6 +17,9 @@ <%= link_to_movie_db_movie @movie.the_movie_db_id %> +Blue Means the disk title is within the runtime range of the movie.
+Gream Means the disk has been ripped before.
+