Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8e7d82a
Fix code complexity and nesting issues
mjc Sep 17, 2025
a82f79b
Complete analyzer performance optimizations and queue UI fixes
mjc Sep 18, 2025
de7abc2
πŸš€ Analyzer Performance Optimizations & Architecture Restructure
mjc Sep 18, 2025
c5ccc27
refactor: pure function architecture and progress improvements
mjc Sep 18, 2025
9ff9063
fix(analyzer): return to idle instead of auto-pausing
mjc Sep 19, 2025
d8a2731
feat(dashboard): fix async status accuracy and enhance encoder progress
mjc Sep 19, 2025
b7ff216
Create shared pipeline status logic for all Broadway producers
mjc Sep 19, 2025
79f521d
Fix PipelineStatus compilation warnings
mjc Sep 20, 2025
cce411e
🧹 Aggressive DRY improvements: Events module & dashboard components
mjc Sep 20, 2025
818a0b8
πŸ”₯ Massive dashboard DRY refactor: 300+ lines β†’ 150 lines
mjc Sep 20, 2025
337200b
πŸ”§ Fix service status detection and encoding progress display
mjc Sep 20, 2025
4115415
refactor: remove indirection and fix service status display issues
mjc Sep 20, 2025
8590bae
Fix service status display bug by broadcasting status with progress
mjc Sep 20, 2025
f9bc2ad
Make DashboardV2Live the default route at /
mjc Sep 20, 2025
ed9290d
Fix sync progress display and improve dashboard architecture
mjc Sep 20, 2025
6215857
fix: resolve all failing tests and warnings
mjc Sep 20, 2025
634406f
feat: add comprehensive test suite for DashboardV2Live
mjc Sep 21, 2025
f7ff511
fix: resolve encoder UI update issue with Broadway demand management
mjc Sep 22, 2025
b126f96
✨ Clean up DashboardV2Live: remove try/catch blocks & fix credo issues
mjc Sep 22, 2025
fcbd51f
πŸš€ Dashboard LiveView optimizations & code improvements
mjc Sep 22, 2025
bbd2e22
chore: update instructions
mjc Sep 22, 2025
443a87c
refactor: consolidate formatter modules with comprehensive tests and …
mjc Sep 23, 2025
0d7fefd
test: add comprehensive property-based tests for formatters
mjc Sep 23, 2025
25e2133
feat: comprehensive formatting function consolidation and centralization
mjc Sep 23, 2025
a78eebe
refactor: clean up utility modules and fix non-idiomatic patterns
mjc Sep 23, 2025
0692db5
refactor: remove try/catch blocks and improve error handling patterns
mjc Sep 23, 2025
6ad72a9
refactor: migrate all producers to struct-based PipelineStateMachine API
mjc Sep 24, 2025
62c6824
refactor: Remove manual queues and modernize Broadway producers
mjc Sep 24, 2025
2fcafb5
fix: Resolve critical Broadway producer state transition issues
mjc Sep 24, 2025
e3fb965
feat: Add context modules and remove ManualScanner
mjc Sep 24, 2025
080dd0d
refactor: complete telemetry infrastructure removal and old dashboard…
mjc Sep 25, 2025
4e7c7f9
refactor: remove unused telemetry function and update stale comments
mjc Sep 25, 2025
8470d98
refactor: eliminate timeout-prone GenServer calls and simplify produc…
mjc Sep 26, 2025
00f15fc
refactor: remove obsolete PipelineStatus module
mjc Sep 26, 2025
c2f3d9d
Remove unused guard modules and empty test file
mjc Sep 26, 2025
6e4ca43
refactor: eliminate LiveView anti-patterns in dashboard
mjc Sep 26, 2025
6e32bbb
refactor: add module alias to CRF searcher producer
mjc Sep 26, 2025
348f60e
refactor: additional code improvements
mjc Sep 26, 2025
77982ac
attempt to fix CI caching
mjc Sep 26, 2025
8b5ce9e
fix: resolve compilation warnings and property test failures
mjc Sep 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Key pattern: Each pipeline has a Producer that checks GenServer availability bef

## Development Workflows

**Command Execution Note**: All commands should be executed directly without prefixing with `cd` to the project root. The working directory is always assumed to be the project root directory.

### Essential Commands
```bash
# Setup (no longer requires PostgreSQL)
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
echo "https://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories
apk update

# Install basic system dependencies
# Install basic system dependencies including GNU tar for GitHub Actions caching
apk add --no-cache \
git \
bash \
Expand All @@ -37,7 +37,13 @@ jobs:
zlib-dev \
mediainfo \
cmake \
make
make \
gzip \
tar

# Verify tar installation for GitHub Actions caching compatibility
# GitHub Actions cache requires POSIX-compliant tar
which tar && tar --version | head -1

# Install FFmpeg with essential codec libraries (minimal set to avoid conflicts)
apk add --no-cache \
Expand Down
121 changes: 114 additions & 7 deletions .iex.exs
Original file line number Diff line number Diff line change
@@ -1,12 +1,119 @@
IEx.configure(auto_reload: true)

alias Reencodarr.AbAv1
alias Reencodarr.Media
# Core modules
alias Reencodarr.{Media, Repo, Rules, Services, Sync, Config}
alias Reencodarr.Media.{Video, Library, Vmaf}
alias Reencodarr.Repo
alias Reencodarr.Rules
alias Reencodarr.{Analyzer, ManualScanner}
alias Reencodarr.Services
alias Reencodarr.Sync

# Broadway pipelines and workers
alias Reencodarr.{Analyzer, CrfSearcher, Encoder}
alias Reencodarr.Analyzer.{Broadway, QueueManager}
alias Reencodarr.AbAv1.{CrfSearch, Encode}

# State management
alias Reencodarr.PipelineStateMachine

# Dashboard and events
alias Reencodarr.Dashboard.Events
alias ReencodarrWeb.{Endpoint, Router}

import Ecto.Query

# Utility functions for debugging
defmodule IExHelpers do
@doc "Show status of all Broadway pipelines"
def pipelines_status do
%{
analyzer: Analyzer.status(),
crf_searcher: CrfSearcher.status(),
encoder: Encoder.status()
}
end

@doc "Get count of items in each queue"
def queue_counts do
%{
analysis: Analyzer.queue_count(),
crf_search: CrfSearcher.queue_count(),
encoding: Encoder.queue_count()
}
end

@doc "Get next items in each queue"
def next_items(limit \\ 5) do
%{
analysis: Analyzer.next_videos(limit),
crf_search: CrfSearcher.next_videos(limit),
encoding: Encoder.next_videos(limit)
}
end

@doc "Start all pipelines"
def start_all do
Analyzer.start()
CrfSearcher.start()
Encoder.start()
pipelines_status()
end

@doc "Pause all pipelines"
def pause_all do
Analyzer.pause()
CrfSearcher.pause()
Encoder.pause()
pipelines_status()
end

@doc "Get video by path (fuzzy match)"
def find_video(path_fragment) do
from(v in Video, where: ilike(v.path, ^"%#{path_fragment}%"))
|> Repo.all()
end

@doc "Get service configs"
def configs do
Services.list_services()
end

@doc "Quick video state summary"
def video_states do
from(v in Video,
group_by: v.state,
select: {v.state, count()}
)
|> Repo.all()
|> Enum.into(%{})
end

@doc "Debug a specific video"
def debug_video(id) when is_integer(id) do
video = Repo.get!(Video, id) |> Repo.preload(:vmafs)

%{
video: video,
vmaf_count: length(video.vmafs),
chosen_vmaf: Enum.find(video.vmafs, & &1.chosen),
service: Services.get_service_by_id(video.service_id)
}
end
end

# Import the helper functions
import IExHelpers

# Welcome message
IO.puts("""

πŸš€ Reencodarr IEx Console Ready!

Quick commands:
pipelines_status() - Check all Broadway pipeline status
queue_counts() - Get queue counts for all pipelines
next_items() - See next items in each queue
start_all() / pause_all() - Control all pipelines
video_states() - Summary of video states
find_video("path") - Find videos by path fragment
debug_video(123) - Debug specific video by ID
configs() - List service configurations

Happy debugging! 🎬
""")
14 changes: 0 additions & 14 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,5 @@ config :phoenix_live_view,
# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false

config :live_debugger,
# IP on which LiveDebugger will be hosted
ip: {127, 0, 0, 1},
# Port on which LiveDebugger will be hosted
port: 4007,
# Secret key used for LiveDebugger.Endpoint
secret_key_base: "nxeC3Z+0GcRf0NKbjgCuwBQvld+KftsF+Ebsti02FZUXc6xQNR80V8Kdw5sEYiEk",
# Signing salt used for LiveDebugger.Endpoint
signing_salt: "QvcMLz2F3V0jO1LRee/B5207o3KoSJoMkdKP/c/V2rt4x2hxZmg7UF74uzN7QAbP",
# Adapter used in LiveDebugger.Endpoint
adapter: Bandit.PhoenixAdapter,
# Forces LiveDebugger to start even if project is not started with the `mix phx.server`
server: true

# Load local overrides from dev.overrides.exs if exists
if File.exists?("config/dev.overrides.exs"), do: import_config("dev.overrides.exs")
7 changes: 5 additions & 2 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ config :reencodarr, Reencodarr.Repo,
pool: Ecto.Adapters.SQL.Sandbox,
# Use single connection for test sandbox
pool_size: 1,
# Test-specific timeout
timeout: 30_000
# Test-specific timeout for query execution
timeout: 30_000,
# Pool checkout timeout settings for handling concurrent test access
queue_target: 5_000,
queue_interval: 10_000

# We don't run a server during test. If one is required,
# you can enable the server option below.
Expand Down
1 change: 0 additions & 1 deletion lib/reencodarr/ab_av1.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ defmodule Reencodarr.AbAv1 do
@doc false
def init(:ok) do
children = [
Reencodarr.AbAv1.CrfSearch,
Reencodarr.AbAv1.Encode
]

Expand Down
Loading