mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Fixing CI
This commit is contained in:
commit
e0f96d0b56
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -31,12 +31,12 @@ jobs:
|
|||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
path: ./artifacts
|
path: ./artifacts
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
- name: Public the common to nuget
|
- name: Public the abstractions to nuget
|
||||||
id: publish_nuget
|
id: publish_nuget
|
||||||
uses: rohith/publish-nuget@v2
|
uses: rohith/publish-nuget@v2
|
||||||
with:
|
with:
|
||||||
PROJECT_FILE_PATH: Kyoo.Common/Kyoo.Common.csproj
|
PROJECT_FILE_PATH: Kyoo.Abstractions/Kyoo.Abstractions.csproj
|
||||||
PACKAGE_NAME: Kyoo.Common
|
PACKAGE_NAME: Kyoo.Abstractions
|
||||||
VERSION_REGEX: ^\s*<PackageVersion>(.*)<\/PackageVersion>\s*$
|
VERSION_REGEX: ^\s*<PackageVersion>(.*)<\/PackageVersion>\s*$
|
||||||
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
|
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
|
||||||
INCLUDE_SYMBOLS: true
|
INCLUDE_SYMBOLS: true
|
||||||
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
dotnet build --no-restore '-p:SkipWebApp=true;SkipTranscoder=true' -p:CopyLocalLockFileAssemblies=true
|
dotnet build --no-restore '-p:SkipWebApp=true;SkipTranscoder=true' -p:CopyLocalLockFileAssemblies=true
|
||||||
cp ./Kyoo.Common/bin/Debug/net5.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll ./tests/Kyoo.Tests/bin/Debug/net5.0/
|
cp ./Kyoo.Abstractions/bin/Debug/net5.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll ./tests/Kyoo.Tests/bin/Debug/net5.0/
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test --no-build '-p:CollectCoverage=true;CoverletOutputFormat=opencover'
|
run: dotnet test --no-build '-p:CollectCoverage=true;CoverletOutputFormat=opencover'
|
||||||
env:
|
env:
|
||||||
|
@ -7,6 +7,7 @@ RUN cmake . && make -j
|
|||||||
FROM node:alpine as webapp
|
FROM node:alpine as webapp
|
||||||
WORKDIR /webapp
|
WORKDIR /webapp
|
||||||
COPY Kyoo.WebApp .
|
COPY Kyoo.WebApp .
|
||||||
|
WORKDIR /webapp/Front
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build -- --prod
|
RUN npm run build -- --prod
|
||||||
|
|
||||||
@ -19,6 +20,6 @@ RUN apt-get update && apt-get install -y libavutil-dev libavcodec-dev libavforma
|
|||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
COPY --from=builder /opt/kyoo /usr/lib/kyoo
|
COPY --from=builder /opt/kyoo /usr/lib/kyoo
|
||||||
COPY --from=transcoder /transcoder/libtranscoder.so /usr/lib/kyoo
|
COPY --from=transcoder /transcoder/libtranscoder.so /usr/lib/kyoo
|
||||||
COPY --from=webapp /webapp/dist/* /usr/lib/kyoo/wwwroot/
|
COPY --from=webapp /webapp/Front/dist/* /usr/lib/kyoo/wwwroot/
|
||||||
CMD ["/usr/lib/kyoo/Kyoo", "/var/lib/kyoo"]
|
CMD ["/usr/lib/kyoo/Kyoo", "/var/lib/kyoo"]
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@ -12,17 +13,17 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The link of the current page.
|
/// The link of the current page.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string This { get; }
|
public Uri This { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The link of the first page.
|
/// The link of the first page.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string First { get; }
|
public Uri First { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The link of the next page.
|
/// The link of the next page.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Next { get; }
|
public Uri Next { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of items in the current page.
|
/// The number of items in the current page.
|
||||||
@ -42,7 +43,7 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <param name="this">The link of the current page.</param>
|
/// <param name="this">The link of the current page.</param>
|
||||||
/// <param name="next">The link of the next page.</param>
|
/// <param name="next">The link of the next page.</param>
|
||||||
/// <param name="first">The link of the first page.</param>
|
/// <param name="first">The link of the first page.</param>
|
||||||
public Page(ICollection<T> items, string @this, string next, string first)
|
public Page(ICollection<T> items, Uri @this, Uri next, Uri first)
|
||||||
{
|
{
|
||||||
Items = items;
|
Items = items;
|
||||||
This = @this;
|
This = @this;
|
||||||
@ -58,21 +59,21 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// <param name="query">The list of query strings of the current page</param>
|
/// <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>
|
/// <param name="limit">The number of items requested for the current page.</param>
|
||||||
public Page(ICollection<T> items,
|
public Page(ICollection<T> items,
|
||||||
string url,
|
Uri url,
|
||||||
Dictionary<string, string> query,
|
Dictionary<string, string> query,
|
||||||
int limit)
|
int limit)
|
||||||
{
|
{
|
||||||
Items = items;
|
Items = items;
|
||||||
This = url + query.ToQueryString();
|
This = new Uri(url + query.ToQueryString());
|
||||||
|
|
||||||
if (items.Count == limit && limit > 0)
|
if (items.Count == limit && limit > 0)
|
||||||
{
|
{
|
||||||
query["afterID"] = items.Last().ID.ToString();
|
query["afterID"] = items.Last().ID.ToString();
|
||||||
Next = url + query.ToQueryString();
|
Next = new Uri(url + query.ToQueryString());
|
||||||
}
|
}
|
||||||
|
|
||||||
query.Remove("afterID");
|
query.Remove("afterID");
|
||||||
First = url + query.ToQueryString();
|
First = new Uri(url + query.ToQueryString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
using Kyoo.Abstractions.Models;
|
using Kyoo.Abstractions.Models;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Kyoo.Models.Options
|
namespace Kyoo.Models.Options
|
||||||
{
|
{
|
||||||
@ -13,14 +14,14 @@ namespace Kyoo.Models.Options
|
|||||||
public const string Path = "Basics";
|
public const string Path = "Basics";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The internal url where the server will listen
|
/// The internal url where the server will listen. It supports globing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Url { get; set; } = "http://*:5000";
|
public string Url { get; set; } = "http://*:5000";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The public url that will be used in items response and in authentication server host.
|
/// The public url that will be used in items response and in authentication server host.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PublicUrl { get; set; } = "http://localhost:5000/";
|
public Uri PublicUrl { get; set; } = new("http://localhost:5000");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The path of the plugin directory.
|
/// The path of the plugin directory.
|
||||||
|
@ -15,9 +15,9 @@ namespace Kyoo.Api
|
|||||||
public class CrudApi<T> : ControllerBase where T : class, IResource
|
public class CrudApi<T> : ControllerBase where T : class, IResource
|
||||||
{
|
{
|
||||||
private readonly IRepository<T> _repository;
|
private readonly IRepository<T> _repository;
|
||||||
protected readonly string BaseURL;
|
protected readonly Uri BaseURL;
|
||||||
|
|
||||||
public CrudApi(IRepository<T> repository, string baseURL)
|
public CrudApi(IRepository<T> repository, Uri baseURL)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
BaseURL = baseURL;
|
BaseURL = baseURL;
|
||||||
@ -82,8 +82,8 @@ namespace Kyoo.Api
|
|||||||
protected Page<TResult> Page<TResult>(ICollection<TResult> resources, int limit)
|
protected Page<TResult> Page<TResult>(ICollection<TResult> resources, int limit)
|
||||||
where TResult : IResource
|
where TResult : IResource
|
||||||
{
|
{
|
||||||
return new(resources,
|
return new Page<TResult>(resources,
|
||||||
BaseURL + Request.Path,
|
new Uri(BaseURL, Request.Path),
|
||||||
Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString(), StringComparer.InvariantCultureIgnoreCase),
|
Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString(), StringComparer.InvariantCultureIgnoreCase),
|
||||||
limit);
|
limit);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace Kyoo.Api
|
|||||||
public class LibraryItemApi : ControllerBase
|
public class LibraryItemApi : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly ILibraryItemRepository _libraryItems;
|
private readonly ILibraryItemRepository _libraryItems;
|
||||||
private readonly string _baseURL;
|
private readonly Uri _baseURL;
|
||||||
|
|
||||||
|
|
||||||
public LibraryItemApi(ILibraryItemRepository libraryItems, IOptions<BasicOptions> options)
|
public LibraryItemApi(ILibraryItemRepository libraryItems, IOptions<BasicOptions> options)
|
||||||
@ -43,7 +43,7 @@ namespace Kyoo.Api
|
|||||||
new Pagination(limit, afterID));
|
new Pagination(limit, afterID));
|
||||||
|
|
||||||
return new Page<LibraryItem>(resources,
|
return new Page<LibraryItem>(resources,
|
||||||
_baseURL + Request.Path,
|
new Uri(_baseURL + Request.Path),
|
||||||
Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString(), StringComparer.InvariantCultureIgnoreCase),
|
Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString(), StringComparer.InvariantCultureIgnoreCase),
|
||||||
limit);
|
limit);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user