mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-01 04:34:50 -04:00
Fix Uri scheme
This commit is contained in:
parent
54caa2956d
commit
b6daaf6aaa
@ -33,17 +33,17 @@ namespace Kyoo.Abstractions.Models
|
||||
/// <summary>
|
||||
/// The link of the current page.
|
||||
/// </summary>
|
||||
public Uri This { get; }
|
||||
public string This { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The link of the first page.
|
||||
/// </summary>
|
||||
public Uri First { get; }
|
||||
public string First { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The link of the next page.
|
||||
/// </summary>
|
||||
public Uri Next { get; }
|
||||
public string Next { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The number of items in the current page.
|
||||
@ -62,7 +62,7 @@ namespace Kyoo.Abstractions.Models
|
||||
/// <param name="this">The link of the current page.</param>
|
||||
/// <param name="next">The link of the next page.</param>
|
||||
/// <param name="first">The link of the first page.</param>
|
||||
public Page(ICollection<T> items, Uri @this, Uri next, Uri first)
|
||||
public Page(ICollection<T> items, string @this, string next, string first)
|
||||
{
|
||||
Items = items;
|
||||
This = @this;
|
||||
@ -78,21 +78,21 @@ namespace Kyoo.Abstractions.Models
|
||||
/// <param name="query">The list of query strings of the current page</param>
|
||||
/// <param name="limit">The number of items requested for the current page.</param>
|
||||
public Page(ICollection<T> items,
|
||||
Uri url,
|
||||
string url,
|
||||
Dictionary<string, string> query,
|
||||
int limit)
|
||||
{
|
||||
Items = items;
|
||||
This = new Uri(url + query.ToQueryString());
|
||||
This = url + query.ToQueryString();
|
||||
|
||||
if (items.Count == limit && limit > 0)
|
||||
{
|
||||
query["afterID"] = items.Last().ID.ToString();
|
||||
Next = new Uri(url + query.ToQueryString());
|
||||
Next = url + query.ToQueryString();
|
||||
}
|
||||
|
||||
query.Remove("afterID");
|
||||
First = new Uri(url + query.ToQueryString());
|
||||
First = url + query.ToQueryString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace Kyoo.Core.Api
|
||||
{
|
||||
return new Page<TResult>(
|
||||
resources,
|
||||
new Uri(Request.Path),
|
||||
Request.Path,
|
||||
Request.Query.ToDictionary(
|
||||
x => x.Key,
|
||||
x => x.Value.ToString(),
|
||||
|
@ -144,8 +144,7 @@ namespace Kyoo.Core.Api
|
||||
string type = target is ICustomTypeDescriptor descriptor
|
||||
? descriptor.GetClassName()
|
||||
: target.GetType().Name;
|
||||
return new Uri($"/{type}/{slug}/{Images.ImageName[_imageIndex]}".ToLowerInvariant())
|
||||
.ToString();
|
||||
return $"/{type}/{slug}/{Images.ImageName[_imageIndex]}".ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user