Skip to content

Commit

Permalink
1.320
Browse files Browse the repository at this point in the history
Add Kodi remote to support Kodi Matrix
Check for Localhost as remote connection and change to 127.0.0.1
(NB: for remote ideally use 127.0.0.1 for local connection, remote control does not work with localhost)
Update Kodi Service Addon to support Matrix (Kodi 19); seperate Addon include follow install instructions, setup and enable for Selective Fanart.
  • Loading branch information
Ghawken committed Mar 13, 2021
1 parent 898c009 commit 1aa87c1
Show file tree
Hide file tree
Showing 25 changed files with 4,868 additions and 7 deletions.
14 changes: 14 additions & 0 deletions FrontView/Changelog.txt
@@ -1,5 +1,19 @@
Changelog:

1.320
Add Kodi remote to support Kodi Matrix
Check for Localhost as remote connection and change to 127.0.0.1
(NB: for remote ideally use 127.0.0.1 for local connection, remote control does not work with localhost)
Update Kodi Service Addon to support Matrix (Kodi 19); seperate Addon include follow install instructions, setup and enable for Selective Fanart.


1.315
Change Weather to OpenWeatherOrg from DarkSky (as closing)
Needs free API from OpenWeatherOrg - entered into Weather Settings Page
Re-Merge earlier Emby Remote changes; not carried through to most recent version it would seem
Check Plex connection/Server: Functions correctly; always chooses local client (running on same computer as FrontView)


1.303
Few fixes - Hide Video Menu not sticking until save, Fanart crash if no remote on startup
More changes to Kodi Fanart Server connection - stopping/starting/restarting better handled
Expand Down
57 changes: 55 additions & 2 deletions FrontView/FrontView.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29509.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrontView", "FrontView.csproj", "{EC10C6B5-D1E9-4EE1-88DC-C780AF8001FE}"
ProjectSection(ProjectDependencies) = postProject
Expand Down Expand Up @@ -47,6 +47,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Remote.XBMC.Leia", "Plugins
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Remote.Jriver", "Plugins\Remote.Jriver\Remote.Jriver.csproj", "{2478A6DC-509D-41EA-BFF1-47839D95BEA6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Remote.XBMC.Matrix", "Plugins\Remote.Kodi.Matrix\Remote.XBMC.Matrix.csproj", "{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
64 Bit Version All|Any CPU = 64 Bit Version All|Any CPU
Expand Down Expand Up @@ -713,8 +715,59 @@ Global
{2478A6DC-509D-41EA-BFF1-47839D95BEA6}.Release|x64.Build.0 = Release|x64
{2478A6DC-509D-41EA-BFF1-47839D95BEA6}.Release|x86.ActiveCfg = Release|Any CPU
{2478A6DC-509D-41EA-BFF1-47839D95BEA6}.Release|x86.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|Any CPU.ActiveCfg = 64 Bit Version All|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|Any CPU.Build.0 = 64 Bit Version All|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|Mixed Platforms.ActiveCfg = 64 Bit Version All|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|Mixed Platforms.Build.0 = 64 Bit Version All|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|x64.ActiveCfg = 64 Bit Version All|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|x64.Build.0 = 64 Bit Version All|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|x86.ActiveCfg = 64 Bit Version All|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.64 Bit Version All|x86.Build.0 = 64 Bit Version All|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|Any CPU.ActiveCfg = Debug Any CPU|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|Any CPU.Build.0 = Debug Any CPU|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|Mixed Platforms.ActiveCfg = Debug Any CPU|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|Mixed Platforms.Build.0 = Debug Any CPU|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|x64.ActiveCfg = Debug Any CPU|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|x64.Build.0 = Debug Any CPU|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|x86.ActiveCfg = Debug Any CPU|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug Any CPU|x86.Build.0 = Debug Any CPU|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|x64.ActiveCfg = Debug|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|x64.Build.0 = Debug|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|x86.ActiveCfg = Debug|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Debug|x86.Build.0 = Debug|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|Any CPU.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|Any CPU.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|Mixed Platforms.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|Mixed Platforms.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|x64.ActiveCfg = Release|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|x64.Build.0 = Release|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|x86.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X64|x86.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|Any CPU.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|Any CPU.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|Mixed Platforms.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|Mixed Platforms.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|x64.ActiveCfg = Release|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|x64.Build.0 = Release|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|x86.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release X86|x86.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|Any CPU.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|x64.ActiveCfg = Release|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|x64.Build.0 = Release|x64
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|x86.ActiveCfg = Release|Any CPU
{8888B9CC-08EE-4265-9A5A-4D65C26C3AEE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FD1C6F06-BFF7-4756-B8CE-BF1EF65CEF5A}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions FrontView/Plugins/Remote.Kodi.Leia/Api/Xbmc.Player.cs
Expand Up @@ -245,6 +245,7 @@ public void RefreshNowPlaying()
banner = artresults["banner"].ToString();
}


}


Expand Down
244 changes: 244 additions & 0 deletions FrontView/Plugins/Remote.Kodi.Matrix/Api/JsonRpcClient.cs
@@ -0,0 +1,244 @@
#region License, Terms and Conditions
//
// Jayrock - A JSON-RPC implementation for the Microsoft .NET Framework
// Written by Atif Aziz (www.raboof.com)
// Copyright (c) Atif Aziz. All rights reserved.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 2.1 of the License, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#endregion

using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Text;
using System.Web.Services.Protocols;
using Jayrock.Json;
using Jayrock.Json.Conversion;
using Setup;

namespace Remote.XBMC.Matrix.Api
{
public class JsonRpcClient : HttpWebClientProtocol
{
private int _id;

protected override WebRequest GetWebRequest(Uri uri)
{
var webRequest = (HttpWebRequest)base.GetWebRequest(uri);

webRequest.KeepAlive = false;
webRequest.ReadWriteTimeout = 1000000;
//webRequest.ProtocolVersion = HttpVersion.Version10;
return webRequest;
}

public object Invoke(string method)
{
return Invoke(AnyType.Value, method);
}

public object Invoke(Type returnType, string method)
{
return Invoke(returnType, method, (object) null);
}

public object Invoke(string method, object[] args)
{
return Invoke(AnyType.Value, method, args);
}

public object Invoke(Type returnType, string method, object[] args)
{
return Invoke(returnType, method, (object) args);
}

public object InvokeVargs(string method, params object[] args)
{
return Invoke(method, args);
}

public object InvokeVargs(Type returnType, string method, params object[] args)
{
return Invoke(returnType, method, args);
}

public object Invoke(string method, IDictionary args)
{
return Invoke(AnyType.Value, method, args);
}

public object Invoke(string method, object args)
{
return Invoke(AnyType.Value, method, args);
}

public object Invoke(Type returnType, string method, IDictionary args)
{
return Invoke(returnType, method, (object) args);
}

public virtual object Invoke(Type returnType, string method, object args)
{
if (method == null)
throw new ArgumentNullException("method");
if (method.Length == 0)
throw new ArgumentException(null, "method");
if (returnType == null)
throw new ArgumentNullException("returnType");
try
{
var request = GetWebRequest(new Uri(Url));
request.Method = "POST";
request.Timeout = 300000;
var utf8EmitBom = new UTF8Encoding(false);
using (var stream = request.GetRequestStream())
{
stream.ReadTimeout = 300000;
using (var writer = new StreamWriter(stream, utf8EmitBom))
{
var call = new JsonObject();
call["id"] = ++_id;
call["jsonrpc"] = "2.0";
call["method"] = method;
if (args != null)
call["params"] = args;
JsonConvert.Export(call, writer);
}
}
object ret;
using (var response = GetWebResponse(request))
using (var stream = response.GetResponseStream())
using (var reader = new StreamReader(stream, Encoding.UTF8))
ret = OnResponse(JsonText.CreateReader(reader), returnType);
return ret;
}
catch (WebException ex)
{
throw new JsonException("Invalid JSON-RPC response. It contains neither a result nor error : " + ex.Message);
}

}

public virtual object InvokeArray(Type returnType, string[] method, object[] args)
{
if (method == null)
throw new ArgumentNullException("method");
if (method.Length == 0)
throw new ArgumentException(null, "method");
if (returnType == null)
throw new ArgumentNullException("returnType");
try
{
var request = GetWebRequest(new Uri(Url));
request.Method = "POST";
var utf8EmitBom = new UTF8Encoding(false);
using (var stream = request.GetRequestStream())
using (var writer = new StreamWriter(stream, utf8EmitBom))
{
var calls = new JsonArray();
var i = 0;
foreach (var meth in method)
{
var call = new JsonObject();
call["id"] = ++_id;
call["jsonrpc"] = "2.0";
call["method"] = method[i];
if (args[i] != null)
call["params"] = args[i];
calls.Add(call);
i++;
}
Logger.Instance().Log("RPC",calls.ToString());
JsonConvert.Export(calls, writer);
}
object ret;
using (var response = GetWebResponse(request))
using (var stream = response.GetResponseStream())
using (var reader = new StreamReader(stream, Encoding.UTF8))
ret = OnResponseArray(JsonText.CreateReader(reader), returnType);
return ret;
}
catch (WebException ex)
{
throw new JsonException("Invalid JSON-RPC response. It contains neither a result nor error : " + ex.Message);
}

}

private object OnResponseArray(JsonReader reader, Type returnType)
{
Logger.Instance().Log("RPC", "Response");
var members = JsonBuffer.From(reader).GetArray();//.GetMembers();// .GetMembersArray();

foreach (var member in members)
{
var members2 = member.GetMembersArray();//JsonBuffer.From(member.).GetMembersArray();

foreach (var member2 in members2)
{

if (string.CompareOrdinal(member2.Name, "error") == 0)
{
var errorObject = JsonConvert.Import(member2.Buffer.CreateReader());
if (errorObject != null)
OnError(errorObject);
}
else if (string.CompareOrdinal(member2.Name, "result") == 0)
{
Logger.Instance().Log("RPC", JsonConvert.Import(returnType, member2.Buffer.CreateReader()).ToString());
return returnType != typeof (JsonBuffer)
? JsonConvert.Import(returnType, member2.Buffer.CreateReader())
: member2.Buffer;
}
}
}
throw new JsonException("Invalid JSON-RPC response. It contains neither a result nor error.");
}


private object OnResponse(JsonReader reader, Type returnType)
{
var members = JsonBuffer.From(reader).GetMembersArray();
foreach (var member in members)
{
if (string.CompareOrdinal(member.Name, "error") == 0)
{
var errorObject = JsonConvert.Import(member.Buffer.CreateReader());
if (errorObject != null)
OnError(errorObject);
}
else if (string.CompareOrdinal(member.Name, "result") == 0)
{
return returnType != typeof(JsonBuffer)
? JsonConvert.Import(returnType, member.Buffer.CreateReader())
: member.Buffer;
}
}
throw new JsonException("Invalid JSON-RPC response. It contains neither a result nor error.");
}

protected virtual void OnError(object errorValue)
{
var error = errorValue as IDictionary;
if (error != null)
throw new JsonException(error["message"] as string);
throw new JsonException(errorValue as string);
}
}
}


0 comments on commit 1aa87c1

Please sign in to comment.