mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
add back global metadata settings
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
@@ -48,13 +47,6 @@ namespace MediaBrowser.Api
|
||||
|
||||
}
|
||||
|
||||
[Route("/System/Configuration/SaveLocalMetadata", "POST")]
|
||||
[Api(("Updates saving of local metadata and images for all types"))]
|
||||
public class UpdateSaveLocalMetadata : IReturnVoid
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
|
||||
[Route("/System/Configuration/VideoImageExtraction", "POST")]
|
||||
[Api(("Updates image extraction for all types"))]
|
||||
public class UpdateVideoImageExtraction : IReturnVoid
|
||||
@@ -144,57 +136,6 @@ namespace MediaBrowser.Api
|
||||
_configurationManager.SaveConfiguration();
|
||||
}
|
||||
|
||||
public void Post(UpdateSaveLocalMetadata request)
|
||||
{
|
||||
var config = _configurationManager.Configuration;
|
||||
|
||||
if (request.Enabled)
|
||||
{
|
||||
config.SaveLocalMeta = true;
|
||||
|
||||
foreach (var options in config.MetadataOptions)
|
||||
{
|
||||
options.DisabledMetadataSavers = new string[] { };
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
config.SaveLocalMeta = false;
|
||||
|
||||
DisableSaversForType(typeof(Game), config);
|
||||
DisableSaversForType(typeof(GameSystem), config);
|
||||
DisableSaversForType(typeof(Movie), config);
|
||||
DisableSaversForType(typeof(BoxSet), config);
|
||||
DisableSaversForType(typeof(Book), config);
|
||||
DisableSaversForType(typeof(Series), config);
|
||||
DisableSaversForType(typeof(Season), config);
|
||||
DisableSaversForType(typeof(Episode), config);
|
||||
DisableSaversForType(typeof(MusicAlbum), config);
|
||||
DisableSaversForType(typeof(MusicArtist), config);
|
||||
DisableSaversForType(typeof(AdultVideo), config);
|
||||
DisableSaversForType(typeof(MusicVideo), config);
|
||||
DisableSaversForType(typeof(Video), config);
|
||||
}
|
||||
|
||||
_configurationManager.SaveConfiguration();
|
||||
}
|
||||
|
||||
private void DisableSaversForType(Type type, ServerConfiguration config)
|
||||
{
|
||||
var options = GetMetadataOptions(type, config);
|
||||
|
||||
const string mediabrowserSaverName = "Media Browser Xml";
|
||||
|
||||
if (!options.DisabledMetadataSavers.Contains(mediabrowserSaverName, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
var list = options.DisabledMetadataSavers.ToList();
|
||||
|
||||
list.Add(mediabrowserSaverName);
|
||||
|
||||
options.DisabledMetadataSavers = list.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnableImageExtractionForType(Type type, ServerConfiguration config, bool enabled)
|
||||
{
|
||||
var options = GetMetadataOptions(type, config);
|
||||
|
||||
Reference in New Issue
Block a user