From 7c7244d32fd9290989c523e3f344657d87cfbb7c Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Tue, 15 Sep 2026 11:16:54 -0400 Subject: Backport pull request #18003 from jellyfin/release-12.z Check Live TV access for a single user instead of enumerating all users Original-merge: 2bcd3b1efb121ad661495570b43aace247ee0a27 Merged-by: crobibero Backported-by: Cody Robibero --- .../Jellyfin.Database.Implementations/LeafPlayedState.cs | 10 ++++++++++ src/Jellyfin.LiveTv/LiveTvManager.cs | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/Jellyfin.Database/Jellyfin.Database.Implementations/LeafPlayedState.cs (limited to 'src') diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/LeafPlayedState.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/LeafPlayedState.cs new file mode 100644 index 0000000000..0846013c45 --- /dev/null +++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/LeafPlayedState.cs @@ -0,0 +1,10 @@ +using System; + +namespace Jellyfin.Database.Implementations; + +/// +/// An item's id paired with whether a given user has played it. +/// +/// The id of the item. +/// Whether the user has played the item. +public readonly record struct LeafPlayedState(Guid Id, bool Played); diff --git a/src/Jellyfin.LiveTv/LiveTvManager.cs b/src/Jellyfin.LiveTv/LiveTvManager.cs index 2edf7681db..93f9083178 100644 --- a/src/Jellyfin.LiveTv/LiveTvManager.cs +++ b/src/Jellyfin.LiveTv/LiveTvManager.cs @@ -1229,6 +1229,14 @@ namespace Jellyfin.LiveTv .Where(IsLiveTvEnabled); } + /// + public bool IsEnabledForUser(User user) + { + ArgumentNullException.ThrowIfNull(user); + + return IsLiveTvEnabled(user); + } + /// /// Resets the tuner. /// -- cgit v1.2.3