mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
fixes Newtonsoft.Json.JsonSerializationException with OwnCloud upload
Currently, when a file is uploaded, and an error is generated, a JSON serialization error is thrown because of the unexpected JSON output. This commit fixes that.
This commit is contained in:
parent
b0c73d87da
commit
9bdae1313d
1 changed files with 4 additions and 2 deletions
|
@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -133,7 +134,8 @@ public string ShareFile(string path)
|
|||
{
|
||||
if (result.ocs.data != null && result.ocs.meta.statuscode == 100)
|
||||
{
|
||||
string link = result.ocs.data.url;
|
||||
OwnCloudShareResponseData data = ((JObject)result.ocs.data).ToObject<OwnCloudShareResponseData>();
|
||||
string link = data.url;
|
||||
if (DirectLink) link += (IsCompatibility81 ? "/download" : "&download");
|
||||
return link;
|
||||
}
|
||||
|
@ -155,7 +157,7 @@ public class OwnCloudShareResponse
|
|||
public class OwnCloudShareResponseOcs
|
||||
{
|
||||
public OwnCloudShareResponseMeta meta { get; set; }
|
||||
public OwnCloudShareResponseData data { get; set; }
|
||||
public object data { get; set; }
|
||||
}
|
||||
|
||||
public class OwnCloudShareResponseMeta
|
||||
|
|
Loading…
Reference in a new issue