re-enable chromecast

This commit is contained in:
Luke Pulverenti
2014-08-17 01:38:13 -04:00
parent e221902088
commit cd1f097167
49 changed files with 553 additions and 632 deletions

View File

@@ -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; }

View File

@@ -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)
String[] subFactors = StringHelper.RegexSplit(factor.Trim().Trim('(').Trim(')').Trim(), "\\s", 3);
if (subFactors.Length == 3)
{
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)
{
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;
}
}
}
}
}

View File

@@ -6,6 +6,7 @@
Audio = 1,
Image = 2,
Video = 3,
Playlist = 4
Playlist = 4,
MusicAlbum = 5
}
}

View File

@@ -347,24 +347,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The user data.</value>
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>

View File

@@ -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);
}
}
}

View File

@@ -51,14 +51,6 @@ namespace MediaBrowser.Model.Logging
/// <param name="paramList">The param list.</param>
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>