update satip discovery

This commit is contained in:
Luke Pulverenti 2016-02-19 12:14:42 -05:00
parent 3c2cb7701f
commit d2e62c5ba8
3 changed files with 5 additions and 68 deletions

View File

@ -10,7 +10,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Security;
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Serialization;
@ -24,7 +23,6 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
using MediaBrowser.Common.IO;
namespace MediaBrowser.Server.Implementations.Connect
{
@ -121,7 +119,6 @@ namespace MediaBrowser.Server.Implementations.Connect
_securityManager = securityManager;
_fileSystem = fileSystem;
_userManager.UserConfigurationUpdated += _userManager_UserConfigurationUpdated;
_config.ConfigurationUpdated += _config_ConfigurationUpdated;
LoadCachedData();
@ -1102,64 +1099,6 @@ namespace MediaBrowser.Server.Implementations.Connect
}
}
async void _userManager_UserConfigurationUpdated(object sender, GenericEventArgs<User> e)
{
//var user = e.Argument;
//await TryUploadUserPreferences(user, CancellationToken.None).ConfigureAwait(false);
}
private async Task TryUploadUserPreferences(User user, CancellationToken cancellationToken)
{
if (user == null)
{
throw new ArgumentNullException("user");
}
if (string.IsNullOrEmpty(user.ConnectUserId))
{
return;
}
if (string.IsNullOrEmpty(ConnectAccessKey))
{
return;
}
var url = GetConnectUrl("user/preferences");
url += "?userId=" + user.ConnectUserId;
url += "&key=userpreferences";
var options = new HttpRequestOptions
{
Url = url,
CancellationToken = cancellationToken
};
var postData = new Dictionary<string, string>();
postData["data"] = _json.SerializeToString(ConnectUserPreferences.FromUserConfiguration(user.Configuration));
options.SetPostData(postData);
SetServerAccessToken(options);
SetApplicationHeader(options);
try
{
// No need to examine the response
using (var stream = (await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)).Content)
{
}
}
catch (Exception ex)
{
_logger.ErrorException("Error uploading user preferences", ex);
}
}
private async Task DownloadUserPreferences(User user, CancellationToken cancellationToken)
{
}
public async Task<User> GetLocalUser(string connectUserId)
{
var user = _userManager.Users

View File

@ -45,7 +45,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
{
var auth = GetAuthorizationDictionary(httpReq);
string userId = null;
string deviceId = null;
string device = null;
string client = null;
@ -53,9 +52,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
if (auth != null)
{
// TODO: Remove this
auth.TryGetValue("UserId", out userId);
auth.TryGetValue("DeviceId", out deviceId);
auth.TryGetValue("Device", out device);
auth.TryGetValue("Client", out client);
@ -78,7 +74,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
Client = client,
Device = device,
DeviceId = deviceId,
UserId = userId,
Version = version,
Token = token
};

View File

@ -162,12 +162,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
throw new NotImplementedException();
}
// Device hasn't implemented an m3u list
if (string.IsNullOrWhiteSpace(result.M3UUrl))
{
throw new NotImplementedException();
result.IsEnabled = false;
}
if (!result.M3UUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
else if (!result.M3UUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
var fullM3uUrl = url.Substring(0, url.LastIndexOf('/'));
result.M3UUrl = fullM3uUrl + "/" + result.M3UUrl.TrimStart('/');
@ -194,6 +195,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
break;
}
case "satip:X_SATIPCAP":
case "X_SATIPCAP":
{
// <satip:X_SATIPCAP xmlns:satip="urn:ses-com:satip">DVBS2-2</satip:X_SATIPCAP>
@ -202,6 +204,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
break;
}
case "satip:X_SATIPM3U":
case "X_SATIPM3U":
{
// <satip:X_SATIPM3U xmlns:satip="urn:ses-com:satip">/channellist.lua?select=m3u</satip:X_SATIPM3U>