Much base work started
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
Dan Milne
2025-10-31 14:36:14 +11:00
parent 4a35bf6758
commit 88a906064f
97 changed files with 5333 additions and 2774 deletions

View File

@@ -0,0 +1,118 @@
<div class="container mx-auto px-4 py-8">
<div class="flex items-center justify-between mb-8">
<div>
<h1 class="text-3xl font-bold text-gray-900"><%= @storage_location.name %></h1>
<p class="text-gray-600 mt-2">
<span class="font-medium">Path:</span>
<code class="bg-gray-100 px-2 py-1 rounded"><%= @storage_location.path %></code>
</p>
</div>
<div class="flex space-x-3">
<%= link_to "← Back to Library", storage_locations_path,
class: "bg-gray-600 hover:bg-gray-700 text-white font-medium py-2 px-4 rounded-lg transition-colors" %>
<%= form_with(url: scan_storage_location_path(@storage_location), method: :post,
class: "inline-flex") do |form| %>
<%= form.submit "Scan for Videos",
class: "bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg cursor-pointer transition-colors" %>
<% end %>
</div>
</div>
<% if @videos.empty? %>
<div class="text-center py-12 bg-white rounded-lg shadow">
<div class="text-gray-500 text-lg mb-4">No videos found</div>
<p class="text-gray-600">
This storage location doesn't contain any video files yet. Try scanning for videos to add them to your library.
</p>
</div>
<% else %>
<div class="bg-white rounded-lg shadow">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-900">
Videos (<%= @videos.count %>)
</h2>
</div>
<div class="divide-y divide-gray-200">
<% @videos.each do |video| %>
<div class="p-6 hover:bg-gray-50 transition-colors">
<div class="flex items-start space-x-4">
<!-- Thumbnail placeholder -->
<div class="flex-shrink-0">
<% if video.video_assets.where(asset_type: 'thumbnail').any? %>
<%= image_tag video.video_assets.where(asset_type: 'thumbnail').first.file,
class: "w-24 h-16 object-cover rounded", alt: video.display_title %>
<% else %>
<div class="w-24 h-16 bg-gray-200 rounded flex items-center justify-center">
<svg class="w-8 h-8 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
<path d="M2 6a2 2 0 012-2h6a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V6zM14.553 7.106A1 1 0 0014 8v4a1 1 0 00.553.894l2 1A1 1 0 0018 13V7a1 1 0 00-1.447-.894l-2 1z"/>
</svg>
</div>
<% end %>
</div>
<!-- Video info -->
<div class="flex-1 min-w-0">
<h3 class="text-lg font-medium text-gray-900 mb-1">
<%= link_to video.display_title, video,
class: "hover:text-blue-600 transition-colors" %>
</h3>
<div class="flex flex-wrap gap-4 text-sm text-gray-600 mb-2">
<span>
<span class="font-medium">Duration:</span>
<%= video.format_duration %>
</span>
<span>
<span class="font-medium">Resolution:</span>
<%= video.resolution_label %>
</span>
<span>
<span class="font-medium">Size:</span>
<%= number_to_human_size(video.video_metadata['file_size']) rescue "Unknown" %>
</span>
</div>
<div class="flex items-center space-x-3 text-sm">
<% if video.web_compatible? %>
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800">
Web Compatible
</span>
<% else %>
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800">
Needs Transcoding
</span>
<% end %>
<% if video.processed? %>
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
Processed
</span>
<% else %>
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800">
Processing
</span>
<% end %>
<% if video.work&.title && video.work.title != video.display_title %>
<span class="text-gray-500">
Part of: <%= link_to video.work.title, video.work,
class: "hover:text-blue-600 transition-colors" %>
</span>
<% end %>
</div>
</div>
<!-- Actions -->
<div class="flex-shrink-0">
<%= link_to "Watch", video,
class: "bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded transition-colors" %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
</div>