Fixing duplicates font files on the /api/show/id/fonts route

Resolves #94
This commit is contained in:
Zoe Roux 2022-03-28 02:47:47 +02:00
parent 0f06033b42
commit 76a57459af
No known key found for this signature in database
GPG Key ID: 6AA5AE82CCC0D9DD
3 changed files with 2 additions and 20 deletions

View File

@ -1,18 +0,0 @@
{
"categories": [
{
"title": "## Features",
"labels": ["enhancement"]
},
{
"title": "## Fixes",
"labels": ["bug"]
},
{
"title": "## Web App",
"labels": ["webapp"]
}
],
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Others</summary>\n\n${{UNCATEGORIZED}}\n</details>",
"pr_template": "- ${{TITLE}} (PR: #${{NUMBER}})"
}

View File

@ -1,6 +1,5 @@
[Unit]
Description=Kyoo Media Server
Requires=postgresql.service
After=network.target
[Service]

View File

@ -60,7 +60,7 @@ namespace Kyoo.Core.Api
/// <summary>
/// The base URL of Kyoo. This will be used to create links for images and
/// <see cref="Abstractions.Models.Page{T}"/>.
/// <see cref="Page{T}"/>.
/// </summary>
private readonly Uri _baseURL;
@ -399,6 +399,7 @@ namespace Kyoo.Core.Api
return NotFound();
string path = _files.Combine(await _files.GetExtraDirectory(show), "Attachments");
return (await _files.ListFiles(path))
.DistinctBy(Path.GetFileNameWithoutExtension)
.ToDictionary(
Path.GetFileNameWithoutExtension,
x => $"{_baseURL}api/shows/{identifier}/fonts/{Path.GetFileName(x)}"