From 76a57459afbc702809d7fdc546ec613ac05536ac Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 28 Mar 2022 02:47:47 +0200 Subject: [PATCH] Fixing duplicates font files on the /api/show/id/fonts route Resolves #94 --- deployment/changelog.json | 18 ------------------ deployment/kyoo.service | 1 - src/Kyoo.Core/Views/Resources/ShowApi.cs | 3 ++- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 deployment/changelog.json diff --git a/deployment/changelog.json b/deployment/changelog.json deleted file mode 100644 index 4e7c94ec..00000000 --- a/deployment/changelog.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "categories": [ - { - "title": "## Features", - "labels": ["enhancement"] - }, - { - "title": "## Fixes", - "labels": ["bug"] - }, - { - "title": "## Web App", - "labels": ["webapp"] - } - ], - "template": "${{CHANGELOG}}\n\n
\nOthers\n\n${{UNCATEGORIZED}}\n
", - "pr_template": "- ${{TITLE}} (PR: #${{NUMBER}})" -} diff --git a/deployment/kyoo.service b/deployment/kyoo.service index 5727b7c5..b9cdcf0c 100644 --- a/deployment/kyoo.service +++ b/deployment/kyoo.service @@ -1,6 +1,5 @@ [Unit] Description=Kyoo Media Server -Requires=postgresql.service After=network.target [Service] diff --git a/src/Kyoo.Core/Views/Resources/ShowApi.cs b/src/Kyoo.Core/Views/Resources/ShowApi.cs index ccbf00e5..8038fd85 100644 --- a/src/Kyoo.Core/Views/Resources/ShowApi.cs +++ b/src/Kyoo.Core/Views/Resources/ShowApi.cs @@ -60,7 +60,7 @@ namespace Kyoo.Core.Api /// /// The base URL of Kyoo. This will be used to create links for images and - /// . + /// . /// 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)}"