diff options
| author | btopherjohnson <60437031+btopherjohnson@users.noreply.github.com> | 2024-03-17 08:50:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-17 09:50:48 -0600 |
| commit | 9a40a67c603a8352c62a6a1c2a66dfd53df70a17 (patch) | |
| tree | 1c93ddd366c72cd3e9761cedb155365a759beac9 | |
| parent | b6d130ae2d337294904f6d46d943e9f82c162978 (diff) | |
Add ability to enable/disable libraries (#11037)
Co-authored-by: Bond-009 <bond.009@outlook.com>
Co-authored-by: Cody Robibero <cody@robibe.ro>
| -rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/CollectionFolder.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/LibraryOptions.cs | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 55642e4e2..e9c0fb2ad 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -180,6 +180,7 @@ _ [Barasingha](https://github.com/MaVdbussche) - [Gauvino](https://github.com/Gauvino) - [felix920506](https://github.com/felix920506) + - [btopherjohnson](https://github.com/btopherjohnson) # Emby Contributors diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index 992bb19bb..676a47c88 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -11,6 +11,7 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; +using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; using Jellyfin.Extensions.Json; using MediaBrowser.Controller.IO; @@ -95,6 +96,16 @@ namespace MediaBrowser.Controller.Entities return GetLibraryOptions(Path); } + public override bool IsVisible(User user) + { + if (GetLibraryOptions().Enabled) + { + return base.IsVisible(user); + } + + return false; + } + private static LibraryOptions LoadLibraryOptions(string path) { try diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs index 42148a276..e777d5fd8 100644 --- a/MediaBrowser.Model/Configuration/LibraryOptions.cs +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -27,6 +27,8 @@ namespace MediaBrowser.Model.Configuration SeasonZeroDisplayName = "Specials"; } + public bool Enabled { get; set; } = true; + public bool EnablePhotos { get; set; } public bool EnableRealtimeMonitor { get; set; } |
