-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: inability to install extension (#231)
Newtonsoft.json dll is explicitly ignored by the Playnite Toolbox utility which is used to pack the extension. For this reason, packaged extensions are installed without this dll and throw an error when Playnite is run. Although Playnite SDK provides a serialization utility, it does not allow configuration of casing (camel case). For this reason, System.Text.Json is used as Newtonsoft's replacement. Fixes #230
- Loading branch information
Showing
5 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
using System.IO; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System.Text.Json; | ||
|
||
namespace PlayniteWeb.Services | ||
{ | ||
public class ObjectSerializer : ISerializeObjects | ||
{ | ||
private readonly JsonSerializer serializer; | ||
|
||
public ObjectSerializer() => serializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver() }; | ||
|
||
public string Serialize<T>(T data) | ||
public string Serialize(object data) | ||
{ | ||
using (var outStream = new StringWriter()) | ||
using (var writer = new JsonTextWriter(outStream)) | ||
{ | ||
serializer.Serialize(writer, data); | ||
return outStream.ToString(); | ||
} | ||
return JsonSerializer.Serialize(data, new JsonSerializerOptions(JsonSerializerDefaults.Web)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Id: PlayniteWeb_ec3439e3-51ee-43cb-9a8a-5d82cf45edac | ||
Name: Playnite Web | ||
Author: Andrew Smith | ||
Version: 0.1 | ||
Version: 2.0.1 | ||
Module: PlayniteWeb.dll | ||
Type: GenericPlugin | ||
Icon: Resources\icon.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net462" /> | ||
<package id="MQTTnet" version="4.3.3.952" targetFramework="net462" /> | ||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" /> | ||
<package id="PlayniteSDK" version="6.11.0" targetFramework="net462" /> | ||
<package id="System.Buffers" version="4.5.1" targetFramework="net462" /> | ||
<package id="System.Memory" version="4.5.5" targetFramework="net462" /> | ||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" /> | ||
<package id="System.Reactive" version="6.0.0" targetFramework="net462" /> | ||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" /> | ||
<package id="System.Runtime.InteropServices.WindowsRuntime" version="4.3.0" targetFramework="net462" /> | ||
<package id="System.Security.Cryptography.ProtectedData" version="8.0.0" targetFramework="net462" /> | ||
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net462" /> | ||
<package id="System.Text.Json" version="8.0.3" targetFramework="net462" /> | ||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" /> | ||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" /> | ||
</packages> |