Commit Graph

84 Commits

Author SHA1 Message Date
unkin-agent b77702c851 merge: resolve CoreAppHost conflict with main, drop dead redisConnectionString local
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-09-13 14:48:26 +10:00
unkin-agent 91655fcb0a fix(ha): gate library tasks on the scan leader by default
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Jellyfin:ScanLeader:Enabled defaults to false and nothing sets it, so
leader election never runs and every replica executes the timer-driven
library tasks concurrently - the exact behaviour the lease prevents.

- Enable gating by default when a Redis connection string is configured
- Honour an explicit Enabled setting either way
- Carry the effective decision onto the bound options the task worker reads
- Log at startup whether gating is active
- Warn when gating is enabled but no Redis connection string is configured
2026-09-13 13:19:48 +10:00
unkin-agent 95220e2ed6 fix(ha): read transcode store config from the variable form deployments set
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
The startup configuration only reads JELLYFIN_ prefixed environment
variables, so the bare Jellyfin__TranscodeStore__* form used by the chart,
the manifests and the README is dropped and the Redis store is never
registered. Nothing logs the selected store, so the fallback is invisible.

- Read bare Jellyfin__* variables into the Jellyfin:* configuration root
- Keep an explicit JELLYFIN_ variable winning over the bare form
- Log the selected transcode session store at startup
- Ping Redis once at startup and log an unreachable store at Error
- Log endpoints only, never the connection string
2026-09-13 13:10:52 +10:00
unkinben 0008bde28e Gate periodic library-mutating tasks behind a scan-leader lease
ABI Compatibility / ABI - HEAD (pull_request) Has been cancelled
ABI Compatibility / ABI - BASE (pull_request) Has been cancelled
OpenAPI / OpenAPI - HEAD (pull_request) Has been cancelled
OpenAPI / OpenAPI - BASE (pull_request) Has been cancelled
Tests / run-phase5-tests (pull_request) Has been cancelled
Tests / run-tests (pull_request) Has been cancelled
Project Automation / Project board (pull_request) Has been cancelled
Merge Conflict Labeler / Labeling (pull_request) Has been cancelled
ABI Compatibility / ABI - Difference (pull_request) Has been cancelled
OpenAPI / OpenAPI - Difference (pull_request) Has been cancelled
OpenAPI / OpenAPI - Publish Unstable Spec (pull_request) Has been cancelled
OpenAPI / OpenAPI - Publish Stable Spec (pull_request) Has been cancelled
In a multi-pod deployment every pod runs the scheduled-task timers, so
periodic library-mutating tasks (library refresh, people/chapter refresh,
audio normalization, media-segment and keyframe extraction, collection and
user-data cleanup, database optimization) fire concurrently against the shared
database and library, duplicating work and racing each other.

Add an IScanLeaderLease abstraction that elects a single scan leader via a
Redis TTL lease keyed on the pod identity, mirroring the existing transcode
lease machinery. RedisScanLeaderLease acquires or renews the lease with an
atomic Lua script and fails safe by treating the pod as leader whenever Redis
is unreachable, so scans never stall. NullScanLeaderLease preserves the
single-instance behavior when election is disabled or no Redis connection is
configured.

Gate only the timer-driven path in ScheduledTaskWorker: when election is
enabled and a task key is in the gated set, a non-leader re-arms its trigger
and skips enqueueing. Manual and API-triggered runs bypass this path and still
run on any pod. Wiring is additive and the new worker constructor parameters
are optional, so existing behavior is unchanged when election is off.

Signed-off-by: Ben Vincent <ben@unkin.net>
2026-08-10 23:51:18 +10:00
Copilot d60ae43b59 Wire ITranscodeSessionStore to Redis-backed impl with NullTranscodeSessionStore fallback and DI registration (#21)
* Initial plan

* feat: add Redis-backed ITranscodeSessionStore with NullTranscodeSessionStore fallback and DI registration

Co-authored-by: ZoltyMat <177592743+ZoltyMat@users.noreply.github.com>

* refactor: add code review improvements - lease expiry comment, Redis connection error handling

Co-authored-by: ZoltyMat <177592743+ZoltyMat@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZoltyMat <177592743+ZoltyMat@users.noreply.github.com>
2026-03-31 22:56:30 -04:00
JPVenson 20f7ddbf8f Refactor Display preference manager (#14056) 2025-09-05 14:39:15 -06:00
JPVenson 160020c551 WIP fixed namespaces 2025-03-25 15:30:22 +00:00
JPVenson 9d1c4ea169 Fixed DbContext usage on Provider 2025-01-27 16:35:46 +00:00
Patrick Barron 449365182c Move LiveTV service registration to extension method 2024-01-12 19:18:18 -05:00
Patrick Barron 41de6d1741 Move StreamHelper to LiveTv project 2024-01-09 11:57:55 -05:00
Patrick Barron 126aa9c893 Move channels to LiveTv project 2024-01-09 10:16:58 -05:00
Patrick Barron c1a3084312 Move LiveTv to separate project 2024-01-09 10:16:56 -05:00
Patrick Barron 04dddd3a7b Remove UserManager Cache (#10781)
* Remove redundant user cache

* Use DI for IPasswordResetProvider and IAuthenticationProvider
2024-01-06 13:43:48 -07:00
Nick cd662506a1 Merge branch 'master' into trickplay 2023-10-18 19:27:05 -07:00
Patrick Barron 493de3297a Use IHostLifetime to handle restarting and shutting down 2023-09-23 11:57:38 -04:00
Nick ab20ceaad6 Migrate to trickplay table to EF. Rename vars/methods/members to have consistent use of tile and thumbnail 2023-06-26 17:40:10 -07:00
Niels van Velzen 6de56f0518 Add support for lyric provider plugins 2023-06-23 21:13:20 +02:00
Stepan Goremykin 26958162d0 Remove unused using directives 2023-04-06 19:17:28 +02:00
Patrick Barron 8479f0f90c Rename JellyfinDb to JellyfinDbContext 2023-01-16 12:14:44 -05:00
Patrick Barron b5da0d1b17 Rename Emby.Drawing and move to src (#9054)
* Move Emby.Drawing to src

* Rename Emby.Drawing -> Jellyfin.Drawing
2023-01-10 05:51:46 -07:00
cvium b836fe9685 remove JellyfinDbProvider and add second level caching 2022-10-21 11:55:32 +02:00
1hitsong f740d1b9f0 Remove use of AddParts. Cleanup use of Lyric vs Lyrics. 2022-09-16 20:52:40 -04:00
Bond_009 104e36f2f9 Streamline startup code 2021-11-02 16:02:52 +01:00
Fernando Fernández 154b7d8505 Fix identation 2021-09-06 21:35:54 +02:00
Fernando Fernández c2652d21e1 Log EFCore migrations 2021-09-06 21:15:31 +02:00
Patrick Barron af2e7aec2e Add missing service registration for IAuthenticationManager 2021-06-27 16:45:41 -04:00
Patrick Barron 3d9c16ba6b Fix concurrency issues 2021-06-18 17:06:38 -04:00
Patrick Barron a0c6f72762 Migrate authentication db to EF Core 2021-05-20 23:56:59 -04:00
Patrick Barron 44e71774b1 Rewrite device manager using EF Core 2021-04-10 16:17:36 -04:00
BaronGreenback 80ca3da55c Merge remote-tracking branch 'upstream/master' into FixFor5280Part2 2021-02-28 10:12:14 +00:00
BaronGreenback f666b7e102 fix 2021-02-27 23:32:22 +00:00
Bond_009 57102090d3 Add tests for DashboardController 2021-02-22 13:15:29 +01:00
cvium 65e6211c03 Remove circular dependency between websocket listeners and manager 2020-11-28 11:21:53 +01:00
cvium 3ae39d44da Revert "Fixed SessionWebSocketListener.OnServerManagerWebSocketConnected." 2020-11-28 09:50:30 +01:00
cvium 1a0d8aef80 Revert "Removed Lazy implementation." 2020-11-28 09:50:16 +01:00
Greenback 5cd5a7d4ce Removed Lazy implementation. 2020-11-28 00:25:20 +00:00
Greenback a59aeb12e0 Fixed SessionWebSocketListener.OnServerManagerWebSocketConnected. 2020-11-27 23:04:13 +00:00
Greenback a3e47f3e4e Updated to latest Unstable. 2020-11-19 18:27:18 +00:00
crobibero 64b32d3290 Use BaseItemManager 2020-10-27 18:01:52 -06:00
BaronGreenback 0b5ddc90ff Merge branch 'master' into NetworkPR2 2020-10-26 13:21:48 +00:00
cvium 38cb8fee8a Fix IWebSocketListener service registration 2020-10-06 14:44:07 +02:00
Jim Cartlidge 38b8110a3e Removing blank lines. 2020-09-14 15:55:25 +01:00
Jim Cartlidge b44455ad0d Update based on PR1 changes. 2020-09-14 15:46:38 +01:00
Jim Cartlidge 9ef79d190b Large number of files 2020-09-12 16:41:37 +01:00
Patrick Barron d814302707 Merge branch 'master' into scoped-displaypreferences 2020-09-03 15:15:43 -04:00
Patrick Barron a77cf53573 Allow plugins to register services. 2020-08-16 17:25:14 -04:00
Patrick Barron ee5d4b1146 Register event services 2020-08-15 15:56:56 -04:00
Patrick Barron 229a5d9e0b Make DisplayPreferencesManager scoped 2020-08-08 13:39:49 -04:00
Patrick Barron d886532258 Add DbContext Pool 2020-08-08 13:32:17 -04:00
Bond-009 b7421db5fe Merge pull request #3578 from barronpm/displaypreferences-efcore
Migrate Display Preferences to EF Core
2020-08-01 21:51:49 +02:00