The Free Software Media System - Server Backend & API
Add ability to enable/disable libraries (#11037)
btopherjohnson9a40a67c603a
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 55642e4e21..e9c0fb2ad7 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 Contributorsdiff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.csindex 992bb19bb1..676a47c883 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.Entitiesreturn GetLibraryOptions(Path);}+ public override bool IsVisible(User user)+ {+ if (GetLibraryOptions().Enabled)+ {+ return base.IsVisible(user);+ }++ return false;+ }+private static LibraryOptions LoadLibraryOptions(string path){trydiff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.csindex 42148a2761..e777d5fd88 100644--- a/MediaBrowser.Model/Configuration/LibraryOptions.cs+++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs@@ -27,6 +27,8 @@ namespace MediaBrowser.Model.ConfigurationSeasonZeroDisplayName = "Specials";}+ public bool Enabled { get; set; } = true;+public bool EnablePhotos { get; set; }public bool EnableRealtimeMonitor { get; set; }