diff options
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Configuration/ServerConfiguration.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/SearchCriteria.cs | 42 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/SearchType.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dto/BaseItemDto.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Model/Extensions/StringHelper.cs | 24 | ||||
| -rw-r--r-- | MediaBrowser.Model/Logging/ILogger.cs | 8 |
6 files changed, 52 insertions, 40 deletions
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index d96412335..8363afc38 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -180,9 +180,6 @@ namespace MediaBrowser.Model.Configuration public SubtitleOptions SubtitleOptions { get; set; } - public ChannelOptions ChannelOptions { get; set; } - public ChapterOptions ChapterOptions { get; set; } - public bool DefaultMetadataSettingsApplied { get; set; } public bool EnableTokenAuthentication { get; set; } diff --git a/MediaBrowser.Model/Dlna/SearchCriteria.cs b/MediaBrowser.Model/Dlna/SearchCriteria.cs index ced852583..67c1b9042 100644 --- a/MediaBrowser.Model/Dlna/SearchCriteria.cs +++ b/MediaBrowser.Model/Dlna/SearchCriteria.cs @@ -16,24 +16,34 @@ namespace MediaBrowser.Model.Dlna SearchType = SearchType.Unknown; - if (StringHelper.IndexOfIgnoreCase(search, "upnp:class") != -1 && - StringHelper.IndexOfIgnoreCase(search, "derivedfrom") != -1) + String[] factors = StringHelper.RegexSplit(search, "(and|or)"); + foreach (String factor in factors) { - if (StringHelper.IndexOfIgnoreCase(search, "object.item.audioItem") != -1) - { - SearchType = SearchType.Audio; - } - else if (StringHelper.IndexOfIgnoreCase(search, "object.item.imageItem") != -1) - { - SearchType = SearchType.Image; - } - else if (StringHelper.IndexOfIgnoreCase(search, "object.item.videoItem") != -1) - { - SearchType = SearchType.Video; - } - else if (StringHelper.IndexOfIgnoreCase(search, "object.container.playlistContainer") != -1) + String[] subFactors = StringHelper.RegexSplit(factor.Trim().Trim('(').Trim(')').Trim(), "\\s", 3); + + if (subFactors.Length == 3) { - SearchType = SearchType.Playlist; + + if (StringHelper.EqualsIgnoreCase("upnp:class", subFactors[0]) && + (StringHelper.EqualsIgnoreCase("=", subFactors[1]) || StringHelper.EqualsIgnoreCase("derivedfrom", subFactors[1]))) + { + if (StringHelper.EqualsIgnoreCase("\"object.item.imageItem\"", subFactors[2]) || StringHelper.EqualsIgnoreCase("\"object.item.imageItem.photo\"", subFactors[2])) + { + SearchType = SearchType.Image; + } + else if (StringHelper.EqualsIgnoreCase("\"object.item.videoItem\"", subFactors[2])) + { + SearchType = SearchType.Video; + } + else if (StringHelper.EqualsIgnoreCase("\"object.container.playlistContainer\"", subFactors[2])) + { + SearchType = SearchType.Playlist; + } + else if (StringHelper.EqualsIgnoreCase("\"object.container.album.musicAlbum\"", subFactors[2])) + { + SearchType = SearchType.MusicAlbum; + } + } } } } diff --git a/MediaBrowser.Model/Dlna/SearchType.cs b/MediaBrowser.Model/Dlna/SearchType.cs index 68c047603..27b207879 100644 --- a/MediaBrowser.Model/Dlna/SearchType.cs +++ b/MediaBrowser.Model/Dlna/SearchType.cs @@ -6,6 +6,7 @@ Audio = 1, Image = 2, Video = 3, - Playlist = 4 + Playlist = 4, + MusicAlbum = 5 } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index fbe9664c0..d3e61792f 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -348,24 +348,12 @@ namespace MediaBrowser.Model.Dto public UserItemDataDto UserData { get; set; } /// <summary> - /// Gets or sets the played percentage. - /// </summary> - /// <value>The played percentage.</value> - public double? PlayedPercentage { get; set; } - - /// <summary> /// Gets or sets the recursive item count. /// </summary> /// <value>The recursive item count.</value> public int? RecursiveItemCount { get; set; } /// <summary> - /// Gets or sets the recursive unplayed item count. - /// </summary> - /// <value>The recursive unplayed item count.</value> - public int? RecursiveUnplayedItemCount { get; set; } - - /// <summary> /// Gets or sets the child count. /// </summary> /// <value>The child count.</value> diff --git a/MediaBrowser.Model/Extensions/StringHelper.cs b/MediaBrowser.Model/Extensions/StringHelper.cs index 2eae56cd4..206723467 100644 --- a/MediaBrowser.Model/Extensions/StringHelper.cs +++ b/MediaBrowser.Model/Extensions/StringHelper.cs @@ -1,5 +1,6 @@ using System; using System.Globalization; +using System.Text.RegularExpressions; namespace MediaBrowser.Model.Extensions { @@ -70,5 +71,28 @@ namespace MediaBrowser.Model.Extensions { return str.TrimStart(c); } + + /// <summary> + /// Splits the specified string. + /// </summary> + /// <param name="str">The string.</param> + /// <param name="term">The term.</param> + /// <returns>System.String[].</returns> + public static string[] RegexSplit(string str, string term) + { + return Regex.Split(str, term, RegexOptions.IgnoreCase); + } + + /// <summary> + /// Splits the specified string. + /// </summary> + /// <param name="str">The string.</param> + /// <param name="term">The term.</param> + /// <param name="limit">The limit.</param> + /// <returns>System.String[].</returns> + public static string[] RegexSplit(string str, string term, int limit) + { + return new Regex(term).Split(str, limit); + } } } diff --git a/MediaBrowser.Model/Logging/ILogger.cs b/MediaBrowser.Model/Logging/ILogger.cs index fd704a254..f4eb79a28 100644 --- a/MediaBrowser.Model/Logging/ILogger.cs +++ b/MediaBrowser.Model/Logging/ILogger.cs @@ -52,14 +52,6 @@ namespace MediaBrowser.Model.Logging void FatalException(string message, Exception exception, params object[] paramList); /// <summary> - /// Logs the specified severity. - /// </summary> - /// <param name="severity">The severity.</param> - /// <param name="message">The message.</param> - /// <param name="paramList">The param list.</param> - void Log(LogSeverity severity, string message, params object[] paramList); - - /// <summary> /// Logs the exception. /// </summary> /// <param name="message">The message.</param> |
