github derekshreds/Snacks v2.2.0
Snacks v2.2.0

latest releases: v2.2.2, v2.2.1
5 hours ago

Snacks v2.2.0

Automated Video Library Encoder

Major release adding distributed encoding across multiple Snacks instances. Nodes on the local network discover each other automatically and a coordinator distributes encoding work to available workers.


What's New

Distributed Encoding Cluster

  • Automatic node discovery -- Snacks instances on the local network find each other automatically using configurable discovery. No manual IP entry required.
  • Coordinator/worker architecture -- one instance acts as the coordinator, assigning encoding jobs to available worker nodes based on capacity.
  • Remote job scheduling -- the coordinator tracks job assignments, monitors progress on remote nodes, and handles completion/failure across the cluster.
  • File transfer -- source files are transferred to worker nodes before encoding and results are transferred back on completion. Transfers are resumable and validated.
  • Shared-secret authentication -- all inter-node API traffic is secured with a shared secret via ClusterAuthMiddleware.
  • State transition tracking -- new StateTransitions database table records job lifecycle events (queued, assigned, transferring, encoding, completed, failed) for observability and debugging.

Cluster Settings UI

  • Cluster settings panel -- new section in the settings modal for enabling/disabling clustering, setting the shared secret, and configuring discovery.
  • Node monitoring -- live view of discovered nodes with status, active jobs, and health indicators in the transcoding UI.
  • Real-time cluster updates -- SignalR hub extended with cluster events for node status changes and remote job progress.

Resilience Improvements

  • Job reassignment on node failure -- if a worker node goes offline mid-encode, the coordinator detects the failure and reassigns the job to another available node.
  • Transfer retry logic -- file transfers retry with backoff on network errors instead of immediately failing the job.
  • Edge case protections -- guards against duplicate job assignments, stale node registrations, and race conditions during concurrent job completion.
  • Completed job cleanup -- worker nodes now properly clean up local files and state after completing a remote job.

Bug Fixes

  • Fixed nodes not cleaning up completed jobs, leaving stale files on disk.
  • Fixed path fallback logic when resolving files across nodes with different mount points.
  • Fixed UI flickering on node status items in the transcoding view.
  • General stability fixes across auto-scan, ffprobe, transcoding, and cluster services.

Deployment

NAS (Docker)

docker pull derekshreds/snacks-docker:latest

To run a multi-node cluster, deploy Snacks on each machine and ensure they can reach each other on the network. Configure a shared secret in the cluster settings on each instance.

volumes:
  - /share/CACHEDEV1_DATA/snacks/config:/app/work/config
  - /share/CACHEDEV1_DATA/snacks/logs:/app/work/logs

Windows Desktop

Download the installer from the Releases page, or build from source:

build-installer.bat

The Electron installer now includes custom NSIS hooks for Windows firewall rules needed by cluster communication.


Database Migrations

Three new migrations are included and run automatically on startup:

  • AddRemoteJobColumns -- adds remote node tracking columns to work items (assigned node, remote status, transfer state)
  • AddRemoteWorkItemId -- links local work item IDs to their remote counterparts on worker nodes
  • AddStateTransitionsTable -- new table recording timestamped state transitions for every job

Files Changed

New Files

  • Snacks/Services/ClusterService.cs -- coordinator logic for job distribution, node health monitoring, and cluster orchestration
  • Snacks/Services/ClusterDiscoveryService.cs -- automatic node discovery and registration
  • Snacks/Services/ClusterFileTransferService.cs -- file transfer between coordinator and worker nodes
  • Snacks/Services/ClusterNodeJobService.cs -- worker-side job execution and status reporting
  • Snacks/Services/ClusterAuthMiddleware.cs -- shared-secret authentication for inter-node API calls
  • Snacks/Services/StateTransitionService.cs -- records job state transitions to the database
  • Snacks/Controllers/ClusterController.cs -- API endpoints for node registration, job assignment, file transfer, and status
  • Snacks/Models/ClusterConfig.cs -- cluster configuration model persisted to disk
  • Snacks/Models/ClusterNode.cs -- in-memory representation of a discovered cluster node
  • Snacks/Models/JobAssignment.cs -- tracks which job is assigned to which node
  • Snacks/Models/JobMetadata.cs -- metadata attached to remote job assignments
  • Snacks/Models/PendingCompletion.cs -- tracks jobs awaiting file transfer back from workers
  • Snacks/Models/StateTransition.cs -- database entity for state transition records
  • Snacks/Views/Shared/_ClusterSettings.cshtml -- cluster settings partial view
  • Snacks/Data/Migrations/20260403122458_AddRemoteJobColumns.cs
  • Snacks/Data/Migrations/20260403124639_AddRemoteWorkItemId.cs
  • Snacks/Data/Migrations/20260403164245_AddStateTransitionsTable.cs
  • electron-app/installer.nsh -- custom NSIS installer hooks

Modified Files

  • Snacks/Services/TranscodingService.cs -- integration with cluster job service, remote job completion handling
  • Snacks/Services/AutoScanService.cs -- cluster-aware scanning and queue management
  • Snacks/Services/FfprobeService.cs -- enhanced probe result handling for remote files
  • Snacks/Services/FileService.cs -- file operation updates for cluster file paths
  • Snacks/Controllers/HomeController.cs -- cluster settings endpoints, node status APIs
  • Snacks/Data/MediaFileRepository.cs -- queries for remote job tracking columns
  • Snacks/Data/SnacksDbContext.cs -- StateTransition entity registration, new indexes
  • Snacks/Hubs/TranscodingHub.cs -- cluster event broadcasting
  • Snacks/Models/MediaFile.cs -- remote job columns
  • Snacks/Models/WorkItem.cs -- remote work item ID, cluster status fields
  • Snacks/Models/EncoderOptions.cs -- documentation updates
  • Snacks/Models/AutoScanConfig.cs -- documentation updates
  • Snacks/Models/ProbeResult.cs -- expanded probe result properties
  • Snacks/Program.cs -- cluster service registration and middleware pipeline
  • Snacks/Views/Home/Index.cshtml -- cluster node display in UI
  • Snacks/Views/Shared/_Layout.cshtml -- cluster settings partial inclusion
  • Snacks/wwwroot/js/transcoding.js -- cluster node monitoring, remote job progress display
  • Snacks/wwwroot/js/site.js -- cluster settings save/load
  • Snacks/wwwroot/css/site.css -- cluster node status styling
  • Snacks/appsettings.json -- cluster configuration defaults
  • Snacks/appsettings.Development.json -- development cluster settings
  • docker-compose.yml -- cluster networking
  • electron-app/main.js -- cluster-related Electron updates
  • electron-app/package.json -- version bump to 2.2.0

Full documentation: README.md

Don't miss a new Snacks release

NewReleases is sending notifications on new releases.