mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-22 10:06:40 +00:00
fixes #795 - Support reading Xbmc nfo's
This commit is contained in:
@@ -17,6 +17,9 @@ using MediaBrowser.Controller.Dlna;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.FileOrganization;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
@@ -38,9 +41,11 @@ using MediaBrowser.Dlna;
|
||||
using MediaBrowser.Dlna.ConnectionManager;
|
||||
using MediaBrowser.Dlna.ContentDirectory;
|
||||
using MediaBrowser.Dlna.Main;
|
||||
using MediaBrowser.LocalMetadata.Providers;
|
||||
using MediaBrowser.MediaEncoding.BdInfo;
|
||||
using MediaBrowser.MediaEncoding.Encoder;
|
||||
using MediaBrowser.MediaEncoding.Subtitles;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.System;
|
||||
@@ -75,6 +80,7 @@ using MediaBrowser.ServerApplication.IO;
|
||||
using MediaBrowser.ServerApplication.Native;
|
||||
using MediaBrowser.ServerApplication.Networking;
|
||||
using MediaBrowser.WebDashboard.Api;
|
||||
using MediaBrowser.XbmcMetadata.Providers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -283,6 +289,7 @@ namespace MediaBrowser.ServerApplication
|
||||
DeleteDeprecatedModules();
|
||||
|
||||
MigrateModularConfigurations();
|
||||
ApplyDefaultXbmcSettings();
|
||||
}
|
||||
|
||||
private void MigrateModularConfigurations()
|
||||
@@ -309,6 +316,68 @@ namespace MediaBrowser.ServerApplication
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyDefaultXbmcSettings()
|
||||
{
|
||||
if (!ServerConfigurationManager.Configuration.DefaultMetadataSettingsApplied)
|
||||
{
|
||||
// Make sure xbmc metadata is disabled for existing users.
|
||||
// New users can just take the defaults.
|
||||
var service = ServerConfigurationManager.Configuration.IsStartupWizardCompleted
|
||||
? "Xbmc Nfo"
|
||||
: "Media Browser Xml";
|
||||
|
||||
DisableMetadataService(typeof(Movie), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(MusicAlbum), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(MusicArtist), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(Episode), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(Season), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(Series), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(MusicVideo), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(Trailer), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(AdultVideo), ServerConfigurationManager.Configuration, service);
|
||||
DisableMetadataService(typeof(Video), ServerConfigurationManager.Configuration, service);
|
||||
}
|
||||
|
||||
ServerConfigurationManager.Configuration.DefaultMetadataSettingsApplied = true;
|
||||
ServerConfigurationManager.SaveConfiguration();
|
||||
}
|
||||
|
||||
private void DisableMetadataService(Type type, ServerConfiguration config, string service)
|
||||
{
|
||||
var options = GetMetadataOptions(type, config);
|
||||
|
||||
if (!options.DisabledMetadataSavers.Contains(service, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
var list = options.DisabledMetadataSavers.ToList();
|
||||
|
||||
list.Add(service);
|
||||
|
||||
options.DisabledMetadataSavers = list.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
private MetadataOptions GetMetadataOptions(Type type, ServerConfiguration config)
|
||||
{
|
||||
var options = config.MetadataOptions
|
||||
.FirstOrDefault(i => string.Equals(i.ItemType, type.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (options == null)
|
||||
{
|
||||
var list = config.MetadataOptions.ToList();
|
||||
|
||||
options = new MetadataOptions
|
||||
{
|
||||
ItemType = type.Name
|
||||
};
|
||||
|
||||
list.Add(options);
|
||||
|
||||
config.MetadataOptions = list.ToArray();
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
private void DeleteDeprecatedModules()
|
||||
{
|
||||
try
|
||||
@@ -328,6 +397,15 @@ namespace MediaBrowser.ServerApplication
|
||||
// Not there, no big deal
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
File.Delete(Path.Combine(ApplicationPaths.PluginsPath, "MediaBrowser.Plugins.XbmcMetadata.dll"));
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
// Not there, no big deal
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
@@ -912,6 +990,12 @@ namespace MediaBrowser.ServerApplication
|
||||
// Dlna
|
||||
list.Add(typeof(DlnaEntryPoint).Assembly);
|
||||
|
||||
// Local metadata
|
||||
list.Add(typeof(AlbumXmlProvider).Assembly);
|
||||
|
||||
// Xbmc
|
||||
list.Add(typeof(ArtistNfoProvider).Assembly);
|
||||
|
||||
list.AddRange(Assemblies.GetAssembliesWithParts());
|
||||
|
||||
// Include composable parts in the running assembly
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
<Project>{734098eb-6dc1-4dd0-a1ca-3140dcd2737c}</Project>
|
||||
<Name>MediaBrowser.Dlna</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MediaBrowser.LocalMetadata\MediaBrowser.LocalMetadata.csproj">
|
||||
<Project>{7ef9f3e0-697d-42f3-a08f-19deb5f84392}</Project>
|
||||
<Name>MediaBrowser.LocalMetadata</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MediaBrowser.MediaEncoding\MediaBrowser.MediaEncoding.csproj">
|
||||
<Project>{0bd82fa6-eb8a-4452-8af5-74f9c3849451}</Project>
|
||||
<Name>MediaBrowser.MediaEncoding</Name>
|
||||
@@ -218,6 +222,10 @@
|
||||
<Project>{5624b7b5-b5a7-41d8-9f10-cc5611109619}</Project>
|
||||
<Name>MediaBrowser.WebDashboard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MediaBrowser.XbmcMetadata\MediaBrowser.XbmcMetadata.csproj">
|
||||
<Project>{23499896-b135-4527-8574-c26e926ea99e}</Project>
|
||||
<Name>MediaBrowser.XbmcMetadata</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
|
||||
Reference in New Issue
Block a user