mirror of
https://github.com/4sval/FModel.git
synced 2026-09-26 02:58:38 -05:00
instruction
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FModel.Extensions;
|
||||
using FModel.Framework;
|
||||
using FModel.ViewModels.ApiEndpoints.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -34,7 +35,11 @@ public class DynamicApiEndpoint : AbstractApiProvider
|
||||
if (dynamicKey["guid"] is not { } guid || dynamicKey["key"] is not { } key)
|
||||
continue;
|
||||
|
||||
ret.DynamicKeys.Add(new DynamicKey{Guid = guid.ToString(), Key = Helper.FixKey(key.ToString())});
|
||||
ret.DynamicKeys.Add(new DynamicKey
|
||||
{
|
||||
Name = dynamicKey["name"]?.ToString(),
|
||||
Guid = guid.ToString(), Key = Helper.FixKey(key.ToString())
|
||||
});
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -58,7 +63,9 @@ public class DynamicApiEndpoint : AbstractApiProvider
|
||||
var tokens = body.SelectTokens(path);
|
||||
var ret = new MappingsResponse[] {new()};
|
||||
ret[0].Url = tokens.ElementAtOrDefault(0).ToString();
|
||||
ret[0].FileName = tokens.ElementAtOrDefault(1).ToString();
|
||||
if (tokens.ElementAtOrDefault(1) is not { } fileName)
|
||||
fileName = ret[0].Url.SubstringAfterLast("/");
|
||||
ret[0].FileName = fileName.ToString();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,12 @@ public class MappingsResponse
|
||||
[I][J] public string Hash { get; private set; }
|
||||
[I][J] public long Length { get; private set; }
|
||||
[I][J] public string Uploaded { get; private set; }
|
||||
[J] public Meta Meta { get; set; }
|
||||
[I][J] public Meta Meta { get; set; }
|
||||
|
||||
public MappingsResponse()
|
||||
{
|
||||
Url = string.Empty;
|
||||
FileName = string.Empty;
|
||||
Meta = new Meta();
|
||||
}
|
||||
|
||||
[I] public bool IsValid => !string.IsNullOrEmpty(Url) &&
|
||||
|
||||
Reference in New Issue
Block a user