aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Configuration/MetadataOptions.cs
diff options
context:
space:
mode:
author7illusions <z@7illusions.com>2014-05-12 16:55:07 +0200
committer7illusions <z@7illusions.com>2014-05-12 16:55:07 +0200
commitbaf5cf2544fcaad2246923f60caaf3fed4a94aaf (patch)
treea808b700095f876e437b95c432c0220e241f9fda /MediaBrowser.Model/Configuration/MetadataOptions.cs
parent8f3a6279e173dcbaaa05a56556afb410ee12dd4d (diff)
parentb9b568de13d81f9db1a8502d50940475c1d79c72 (diff)
Merge pull request #3 from MediaBrowser/master
Sync with Master
Diffstat (limited to 'MediaBrowser.Model/Configuration/MetadataOptions.cs')
-rw-r--r--MediaBrowser.Model/Configuration/MetadataOptions.cs47
1 files changed, 19 insertions, 28 deletions
diff --git a/MediaBrowser.Model/Configuration/MetadataOptions.cs b/MediaBrowser.Model/Configuration/MetadataOptions.cs
index d666f6cce..fdfbbf4f4 100644
--- a/MediaBrowser.Model/Configuration/MetadataOptions.cs
+++ b/MediaBrowser.Model/Configuration/MetadataOptions.cs
@@ -30,7 +30,7 @@ namespace MediaBrowser.Model.Configuration
public MetadataOptions(int backdropLimit, int minBackdropWidth)
{
- var imageOptions = new List<ImageOption>
+ List<ImageOption> imageOptions = new List<ImageOption>
{
new ImageOption
{
@@ -52,14 +52,30 @@ namespace MediaBrowser.Model.Configuration
public int GetLimit(ImageType type)
{
- var option = ImageOptions.FirstOrDefault(i => i.Type == type);
+ ImageOption option = null;
+ foreach (ImageOption i in ImageOptions)
+ {
+ if (i.Type == type)
+ {
+ option = i;
+ break;
+ }
+ }
return option == null ? 1 : option.Limit;
}
public int GetMinWidth(ImageType type)
{
- var option = ImageOptions.FirstOrDefault(i => i.Type == type);
+ ImageOption option = null;
+ foreach (ImageOption i in ImageOptions)
+ {
+ if (i.Type == type)
+ {
+ option = i;
+ break;
+ }
+ }
return option == null ? 0 : option.MinWidth;
}
@@ -74,29 +90,4 @@ namespace MediaBrowser.Model.Configuration
return !DisabledMetadataSavers.Contains(name, StringComparer.OrdinalIgnoreCase);
}
}
-
- public class ImageOption
- {
- /// <summary>
- /// Gets or sets the type.
- /// </summary>
- /// <value>The type.</value>
- public ImageType Type { get; set; }
- /// <summary>
- /// Gets or sets the limit.
- /// </summary>
- /// <value>The limit.</value>
- public int Limit { get; set; }
-
- /// <summary>
- /// Gets or sets the minimum width.
- /// </summary>
- /// <value>The minimum width.</value>
- public int MinWidth { get; set; }
-
- public ImageOption()
- {
- Limit = 1;
- }
- }
}