convert games to new providers

This commit is contained in:
Luke Pulverenti
2014-02-02 08:36:31 -05:00
parent 53776b332c
commit 9e0c1340fc
83 changed files with 1355 additions and 967 deletions

View File

@@ -0,0 +1,36 @@

namespace MediaBrowser.Model.Configuration
{
public class TvFileOrganizationOptions
{
public bool IsEnabled { get; set; }
public int MinFileSizeMb { get; set; }
public string[] LeftOverFileExtensionsToDelete { get; set; }
public string[] WatchLocations { get; set; }
public string SeasonFolderPattern { get; set; }
public string SeasonZeroFolderName { get; set; }
public string EpisodeNamePattern { get; set; }
public string MultiEpisodeNamePattern { get; set; }
public bool OverwriteExistingEpisodes { get; set; }
public bool DeleteEmptyFolders { get; set; }
public TvFileOrganizationOptions()
{
MinFileSizeMb = 50;
LeftOverFileExtensionsToDelete = new string[] { };
WatchLocations = new string[] { };
EpisodeNamePattern = "%sn - %sx%0e - %en.%ext";
MultiEpisodeNamePattern = "%sn - %sx%0e-x%0ed - %en.%ext";
SeasonFolderPattern = "Season %s";
SeasonZeroFolderName = "Season 0";
}
}
}

View File

@@ -1,81 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Class ImageDownloadOptions
/// </summary>
public class ImageDownloadOptions
{
/// <summary>
/// Download Art Image
/// </summary>
/// <value><c>true</c> if art; otherwise, <c>false</c>.</value>
public bool Art { get; set; }
/// <summary>
/// Download Logo Image
/// </summary>
/// <value><c>true</c> if logo; otherwise, <c>false</c>.</value>
public bool Logo { get; set; }
/// <summary>
/// Download Primary Image
/// </summary>
/// <value><c>true</c> if primary; otherwise, <c>false</c>.</value>
public bool Primary { get; set; }
/// <summary>
/// Download Backdrop Images
/// </summary>
/// <value><c>true</c> if backdrops; otherwise, <c>false</c>.</value>
public bool Backdrops { get; set; }
/// <summary>
/// Download Disc Image
/// </summary>
/// <value><c>true</c> if disc; otherwise, <c>false</c>.</value>
public bool Disc { get; set; }
/// <summary>
/// Download Thumb Image
/// </summary>
/// <value><c>true</c> if thumb; otherwise, <c>false</c>.</value>
public bool Thumb { get; set; }
/// <summary>
/// Download Banner Image
/// </summary>
/// <value><c>true</c> if banner; otherwise, <c>false</c>.</value>
public bool Banner { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ImageDownloadOptions"/> class.
/// </summary>
public ImageDownloadOptions()
{
Art = true;
Logo = true;
Primary = true;
Backdrops = true;
Disc = true;
Thumb = true;
Banner = true;
}
}
/// <summary>
/// Class MetadataOptions.
/// </summary>
public class MetadataOptions
{
public int MaxBackdrops { get; set; }
public int MinBackdropWidth { get; set; }
public MetadataOptions()
{
MaxBackdrops = 3;
MinBackdropWidth = 1280;
}
}
}

View File

@@ -0,0 +1,89 @@
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Class MetadataOptions.
/// </summary>
public class MetadataOptions
{
public string ItemType { get; set; }
public ImageOption[] ImageOptions { get; set; }
public string[] DisabledMetadataSavers { get; set; }
public MetadataOptions()
: this(3, 1280)
{
}
public MetadataOptions(int backdropLimit, int minBackdropWidth)
{
var imageOptions = new List<ImageOption>
{
new ImageOption
{
Limit = backdropLimit,
MinWidth = minBackdropWidth,
Type = ImageType.Backdrop
}
};
ImageOptions = imageOptions.ToArray();
DisabledMetadataSavers = new string[] { };
}
public int GetLimit(ImageType type)
{
var option = ImageOptions.FirstOrDefault(i => i.Type == type);
return option == null ? 1 : option.Limit;
}
public int GetMinWidth(ImageType type)
{
var option = ImageOptions.FirstOrDefault(i => i.Type == type);
return option == null ? 0 : option.MinWidth;
}
public bool IsEnabled(ImageType type)
{
return GetLimit(type) > 0;
}
public bool IsMetadataSaverEnabled(string name)
{
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;
}
}
}

View File

@@ -0,0 +1,60 @@
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
namespace MediaBrowser.Model.Configuration
{
public class MetadataPlugin
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public MetadataPluginType Type { get; set; }
}
public class MetadataPluginSummary
{
/// <summary>
/// Gets or sets the type of the item.
/// </summary>
/// <value>The type of the item.</value>
public string ItemType { get; set; }
/// <summary>
/// Gets or sets the plugins.
/// </summary>
/// <value>The plugins.</value>
public List<MetadataPlugin> Plugins { get; set; }
/// <summary>
/// Gets or sets the supported image types.
/// </summary>
/// <value>The supported image types.</value>
public List<ImageType> SupportedImageTypes { get; set; }
public MetadataPluginSummary()
{
SupportedImageTypes = new List<ImageType>();
Plugins = new List<MetadataPlugin>();
}
}
/// <summary>
/// Enum MetadataPluginType
/// </summary>
public enum MetadataPluginType
{
LocalImageProvider,
ImageFetcher,
ImageSaver,
LocalMetadataProvider,
MetadataFetcher,
MetadataSaver
}
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Weather;
using System;
@@ -87,31 +88,6 @@ namespace MediaBrowser.Model.Configuration
/// <value>The metadata country code.</value>
public string MetadataCountryCode { get; set; }
/// <summary>
/// Options for specific art to download for movies.
/// </summary>
public ImageDownloadOptions DownloadMovieImages { get; set; }
/// <summary>
/// Options for specific art to download for Series.
/// </summary>
public ImageDownloadOptions DownloadSeriesImages { get; set; }
/// <summary>
/// Options for specific art to download for Seasons.
/// </summary>
public ImageDownloadOptions DownloadSeasonImages { get; set; }
/// <summary>
/// Options for specific art to download for MusicArtists.
/// </summary>
public ImageDownloadOptions DownloadMusicArtistImages { get; set; }
/// <summary>
/// Options for specific art to download for MusicAlbums.
/// </summary>
public ImageDownloadOptions DownloadMusicAlbumImages { get; set; }
/// <summary>
/// Characters to be replaced with a ' ' in strings to create a sort name
/// </summary>
@@ -215,11 +191,7 @@ namespace MediaBrowser.Model.Configuration
public bool EnableEpisodeChapterImageExtraction { get; set; }
public bool EnableOtherVideoChapterImageExtraction { get; set; }
public MetadataOptions MovieOptions { get; set; }
public MetadataOptions TvOptions { get; set; }
public MetadataOptions MusicOptions { get; set; }
public MetadataOptions GameOptions { get; set; }
public MetadataOptions BookOptions { get; set; }
public MetadataOptions[] MetadataOptions { get; set; }
public bool EnableDebugEncodingLogging { get; set; }
public string TranscodingTempPath { get; set; }
@@ -267,14 +239,6 @@ namespace MediaBrowser.Model.Configuration
MetadataRefreshDays = 30;
PreferredMetadataLanguage = "en";
MetadataCountryCode = "US";
DownloadMovieImages = new ImageDownloadOptions();
DownloadSeriesImages = new ImageDownloadOptions();
DownloadSeasonImages = new ImageDownloadOptions
{
Backdrops = false
};
DownloadMusicArtistImages = new ImageDownloadOptions();
DownloadMusicAlbumImages = new ImageDownloadOptions();
SortReplaceCharacters = new[] { ".", "+", "%" };
SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" };
@@ -282,26 +246,26 @@ namespace MediaBrowser.Model.Configuration
SeasonZeroDisplayName = "Specials";
MovieOptions = new MetadataOptions();
TvOptions = new MetadataOptions();
MusicOptions = new MetadataOptions()
{
MaxBackdrops = 1
};
GameOptions = new MetadataOptions();
BookOptions = new MetadataOptions
{
MaxBackdrops = 1
};
LiveTvOptions = new LiveTvOptions();
TvFileOrganizationOptions = new TvFileOrganizationOptions();
EnableRealtimeMonitor = true;
var options = new List<MetadataOptions>
{
new MetadataOptions(1, 1280) {ItemType = "Book"},
new MetadataOptions(1, 1280) {ItemType = "MusicAlbum"},
new MetadataOptions(1, 1280) {ItemType = "MusicArtist"},
new MetadataOptions(0, 1280) {ItemType = "Season"}
};
MetadataOptions = options.ToArray();
}
public MetadataOptions GetMetadataOptions(string type)
{
return MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, type, StringComparison.OrdinalIgnoreCase));
}
}
@@ -324,39 +288,6 @@ namespace MediaBrowser.Model.Configuration
public int? GuideDays { get; set; }
}
public class TvFileOrganizationOptions
{
public bool IsEnabled { get; set; }
public int MinFileSizeMb { get; set; }
public string[] LeftOverFileExtensionsToDelete { get; set; }
public string[] WatchLocations { get; set; }
public string SeasonFolderPattern { get; set; }
public string SeasonZeroFolderName { get; set; }
public string EpisodeNamePattern { get; set; }
public string MultiEpisodeNamePattern { get; set; }
public bool OverwriteExistingEpisodes { get; set; }
public bool DeleteEmptyFolders { get; set; }
public TvFileOrganizationOptions()
{
MinFileSizeMb = 50;
LeftOverFileExtensionsToDelete = new string[] {};
WatchLocations = new string[] { };
EpisodeNamePattern = "%sn - %sx%0e - %en.%ext";
MultiEpisodeNamePattern = "%sn - %sx%0e-x%0ed - %en.%ext";
SeasonFolderPattern = "Season %s";
SeasonZeroFolderName = "Season 0";
}
}
public class PathSubstitution
{
public string From { get; set; }