ThumbnailManager: Fixing external metadata handling

This commit is contained in:
Zoe Roux 2021-11-01 20:56:11 +01:00
parent d435c2c59f
commit 375fcab258
4 changed files with 14 additions and 13 deletions

View File

@ -44,12 +44,12 @@ version: "3.8"
services:
kyoo:
image: ghcr.io/anonymusraccoon/kyoo:readme
image: ghcr.io/anonymusraccoon/kyoo:master
restart: on-failure
environment:
- KYOO_DATADIR=/var/lib/kyoo
- BASICS__PUBLICURL=https://demo.kyoo.sdg
- KYOO_MetadataInShow=false
- BASICS__PUBLICURL=https://demo.kyoo.moe
- BASICS__MetadataInShow=false
- DATABASE__ENABLED=postgres
- DATABASE__CONFIGURATIONS__POSTGRES__SERVER=postgres
- DATABASE__CONFIGURATIONS__POSTGRES__USER ID=kyoo

View File

@ -205,11 +205,11 @@ namespace Kyoo.Core.Controllers
string path = await fs.GetExtraDirectory(resource)
?? resource switch
{
Season season => await GetExtraDirectory(season.Show),
Episode episode => await GetExtraDirectory(episode.Show),
Track track => await GetExtraDirectory(track.Episode),
IResource res => Combine(_options.CurrentValue.MetadataPath,
typeof(T).Name.ToLowerInvariant(), res.Slug),
IResource res => Combine(
_options.CurrentValue.MetadataPath,
typeof(T).Name.ToLowerInvariant(),
res.Slug
),
_ => Combine(_options.CurrentValue.MetadataPath, typeof(T).Name.ToLowerInvariant())
};
return await CreateDirectory(path);

View File

@ -20,6 +20,7 @@ using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
using Microsoft.AspNetCore.StaticFiles;
@ -114,7 +115,7 @@ namespace Kyoo.Core.Controllers
/// <param name="imageID">The ID of the image. See <see cref="Images"/> for values.</param>
/// <typeparam name="T">The type of the item</typeparam>
/// <returns>The path of the image for the given resource, <b>even if it does not exists</b></returns>
private async Task<string> _GetPrivateImagePath<T>(T item, int imageID)
private async Task<string> _GetPrivateImagePath<T>([NotNull] T item, int imageID)
{
if (item == null)
throw new ArgumentNullException(nameof(item));

View File

@ -47,15 +47,15 @@
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Message Importance="high" Text="Restoring dependencies using 'yarn'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn install" />
<Touch Files="$(NpmStamp)" AlwaysCreate="true" />
</Target>
<Target Name="RunWebpack" Condition="'$(SkipWebApp)' != 'true' And '$(Configuration)' == 'Release'">
<Message Importance="high" Text="Building the web app. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition="'$(BuildServerSideRenderer)' == 'true'" />
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn run build -- --prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn run build:ssr -- --prod" Condition="'$(BuildServerSideRenderer)' == 'true'" />
</Target>
<Target Name="CopyFrontEndFiles" AfterTargets="RunWebpack" BeforeTargets="GetCopyToOutputDirectoryItems" Condition="'$(Configuration)' != 'Debug'">