-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce bottlenecks scan code (#9863)
- Loading branch information
Showing
13 changed files
with
64 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
MediaBrowser.Controller/Library/MetadataConfigurationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
#nullable disable | ||
|
||
#pragma warning disable CS1591 | ||
|
||
using System; | ||
using MediaBrowser.Common.Configuration; | ||
using MediaBrowser.Controller.Configuration; | ||
using MediaBrowser.Model.Configuration; | ||
|
||
namespace MediaBrowser.Controller.Library | ||
{ | ||
public static class MetadataConfigurationExtensions | ||
{ | ||
public static MetadataConfiguration GetMetadataConfiguration(this IConfigurationManager config) | ||
{ | ||
return config.GetConfiguration<MetadataConfiguration>("metadata"); | ||
} | ||
=> config.GetConfiguration<MetadataConfiguration>("metadata"); | ||
|
||
/// <summary> | ||
/// Gets the <see cref="MetadataOptions" /> for the specified type. | ||
/// </summary> | ||
/// <param name="config">The <see cref="IServerConfigurationManager"/>.</param> | ||
/// <param name="type">The type to get the <see cref="MetadataOptions" /> for.</param> | ||
/// <returns>The <see cref="MetadataOptions" /> for the specified type or <c>null</c>.</returns> | ||
public static MetadataOptions? GetMetadataOptionsForType(this IServerConfigurationManager config, string type) | ||
=> Array.Find(config.Configuration.MetadataOptions, i => string.Equals(i.ItemType, type, StringComparison.OrdinalIgnoreCase)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.