FileSystem: Fixing SonarCloud errors

This commit is contained in:
Zoe Roux 2021-08-06 12:45:06 +02:00
parent 0ae6776812
commit c65c7ae922
2 changed files with 5 additions and 7 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
@ -94,6 +95,8 @@ namespace Kyoo.Controllers
/// <summary>
/// An <see cref="IActionResult"/> to proxy an http request.
/// </summary>
// TODO remove this suppress message once the class has been implemented.
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
public class HttpForwardResult : IActionResult
{
/// <summary>
@ -126,12 +129,7 @@ namespace Kyoo.Controllers
public Task ExecuteResultAsync(ActionContext context)
{
// TODO implement that, example: https://github.com/twitchax/AspNetCore.Proxy/blob/14dd0f212d7abb43ca1bf8c890d5efb95db66acb/src/Core/Extensions/Http.cs#L15
// Silence unused warnings
if (_path != null || _rangeSupport || _type == null)
throw new NotImplementedException();
else
throw new NotImplementedException();
throw new NotImplementedException();
}
}
}

View File

@ -133,7 +133,7 @@ namespace Kyoo.Controllers
public Task<string> GetExtraDirectory<T>(T resource)
{
if (!_options.CurrentValue.MetadataInShow)
return null;
return Task.FromResult<string>(null);
return Task.FromResult(resource switch
{
Show show => Combine(show.Path, "Extra"),