mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
CodingStyle: Removing duplicated blank lines
This commit is contained in:
parent
2d3659d0b9
commit
62eec91e6e
@ -217,7 +217,6 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// <returns>How many resources matched that filter</returns>
|
||||
Task<int> GetCount(Expression<Func<T, bool>> where = null);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new resource.
|
||||
/// </summary>
|
||||
|
@ -140,7 +140,6 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// <param name="name">The name of the task (case sensitive)</param>
|
||||
public TaskParameter this[string name] => this.FirstOrDefault(x => x.Name == name);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new, empty, <see cref="TaskParameters"/>
|
||||
/// </summary>
|
||||
|
@ -60,7 +60,6 @@ namespace Kyoo.Abstractions.Controllers
|
||||
=> new(action, priority);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// An action executed on kyoo's startup to initialize the asp-net container.
|
||||
/// </summary>
|
||||
|
@ -27,7 +27,6 @@ namespace Kyoo.Abstractions.Models.Attributes
|
||||
/// </summary>
|
||||
public bool StripScheme { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="FileSystemMetadataAttribute"/> using the specified schemes.
|
||||
/// </summary>
|
||||
|
@ -43,7 +43,6 @@ namespace Kyoo.Abstractions.Models.Attributes
|
||||
/// </summary>
|
||||
public bool IsHidden { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="TaskMetadataAttribute"/> with the given slug, name and description.
|
||||
/// </summary>
|
||||
|
@ -21,7 +21,6 @@ namespace Kyoo.Abstractions.Models
|
||||
/// </summary>
|
||||
public Type Type { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="ConfigurationReference"/> using a given path and type.
|
||||
/// This method does not create sub configuration resources. Please see <see cref="CreateReference"/>
|
||||
@ -53,7 +52,6 @@ namespace Kyoo.Abstractions.Models
|
||||
new ConfigurationReference(path, type)
|
||||
};
|
||||
|
||||
|
||||
if (!type.IsClass || type.AssemblyQualifiedName?.StartsWith("System") == true)
|
||||
return ret;
|
||||
|
||||
@ -89,7 +87,6 @@ namespace Kyoo.Abstractions.Models
|
||||
return CreateReference(path, typeof(T));
|
||||
}
|
||||
|
||||
|
||||
public static ConfigurationReference CreateUntyped(string path)
|
||||
{
|
||||
return new(path, null);
|
||||
|
@ -70,7 +70,6 @@ namespace Kyoo.Abstractions.Models
|
||||
/// </summary>
|
||||
public ItemType Type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new, empty <see cref="LibraryItem"/>.
|
||||
/// </summary>
|
||||
|
@ -36,7 +36,6 @@ namespace Kyoo.Abstractions.Models
|
||||
/// </summary>
|
||||
public ICollection<T> Items { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="Page{T}"/>.
|
||||
/// </summary>
|
||||
|
@ -130,7 +130,6 @@ namespace Kyoo.Abstractions.Models
|
||||
/// </summary>
|
||||
public ICollection<Chapter> Chapters { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a <see cref="WatchItem"/> from an <see cref="Episode"/>.
|
||||
/// </summary>
|
||||
|
@ -48,7 +48,6 @@ namespace Kyoo.Authentication
|
||||
{ CertificateOption.Path, typeof(CertificateOption) }
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The configuration to use.
|
||||
/// </summary>
|
||||
@ -64,7 +63,6 @@ namespace Kyoo.Authentication
|
||||
/// </summary>
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new authentication module instance and use the given configuration and environment.
|
||||
/// </summary>
|
||||
|
@ -28,7 +28,6 @@ namespace Kyoo.Authentication.Models.DTO
|
||||
[MinLength(8, ErrorMessage = "The password must have at least {1} characters")]
|
||||
public string Password { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Convert this register request to a new <see cref="User"/> class.
|
||||
/// </summary>
|
||||
|
@ -44,7 +44,6 @@ namespace Kyoo.Authentication.Views
|
||||
/// </summary>
|
||||
private readonly IOptions<AuthenticationOption> _options;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="AccountApi"/> handle to handle login/users requests.
|
||||
/// </summary>
|
||||
@ -60,7 +59,6 @@ namespace Kyoo.Authentication.Views
|
||||
_options = options;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Register a new user and return a OTAC to connect to it.
|
||||
/// </summary>
|
||||
|
@ -44,7 +44,6 @@ namespace Kyoo.Core.Controllers
|
||||
_references = references.ToDictionary(x => x.Path, x => x.Type, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public void AddTyped<T>(string path)
|
||||
{
|
||||
|
@ -53,7 +53,6 @@ namespace Kyoo.Core.Controllers
|
||||
_options = options;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the file system that should be used for a given path.
|
||||
/// </summary>
|
||||
|
@ -31,7 +31,6 @@ namespace Kyoo.Core.Controllers
|
||||
_clientFactory = factory;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public IActionResult FileResult(string path, bool rangeSupport = false, string type = null)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
@ -53,7 +54,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
public IUserRepository UserRepository { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="LibraryManager"/> instance with every repository available.
|
||||
/// </summary>
|
||||
@ -184,7 +184,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// <param name="inverse">A setter function to store the owner of a releated object loaded</param>
|
||||
/// <typeparam name="T1">The type of the owner object</typeparam>
|
||||
/// <typeparam name="T2">The type of the related object</typeparam>
|
||||
private static async Task SetRelation<T1, T2>(T1 obj,
|
||||
private static async Task _SetRelation<T1, T2>(T1 obj,
|
||||
Task<ICollection<T2>> loader,
|
||||
Action<T1, ICollection<T2>> setter,
|
||||
Action<T2, T1> inverse)
|
||||
@ -224,6 +224,8 @@ namespace Kyoo.Core.Controllers
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1507:CodeMustNotContainMultipleBlankLinesInARow",
|
||||
Justification = "Separate the code by semantics and simplify the code read.")]
|
||||
public Task Load(IResource obj, string memberName, bool force = false)
|
||||
{
|
||||
if (obj == null)
|
||||
@ -251,7 +253,7 @@ namespace Kyoo.Core.Controllers
|
||||
.Then(x => l.Collections = x),
|
||||
|
||||
|
||||
(Collection c, nameof(Collection.ExternalIDs)) => SetRelation(c,
|
||||
(Collection c, nameof(Collection.ExternalIDs)) => _SetRelation(c,
|
||||
ProviderRepository.GetMetadataID<Collection>(x => x.ResourceID == obj.ID),
|
||||
(x, y) => x.ExternalIDs = y,
|
||||
(x, y) => { x.ResourceID = y.ID; }),
|
||||
@ -265,7 +267,7 @@ namespace Kyoo.Core.Controllers
|
||||
.Then(x => c.Libraries = x),
|
||||
|
||||
|
||||
(Show s, nameof(Show.ExternalIDs)) => SetRelation(s,
|
||||
(Show s, nameof(Show.ExternalIDs)) => _SetRelation(s,
|
||||
ProviderRepository.GetMetadataID<Show>(x => x.ResourceID == obj.ID),
|
||||
(x, y) => x.ExternalIDs = y,
|
||||
(x, y) => { x.ResourceID = y.ID; }),
|
||||
@ -278,12 +280,12 @@ namespace Kyoo.Core.Controllers
|
||||
.GetFromShow(obj.ID)
|
||||
.Then(x => s.People = x),
|
||||
|
||||
(Show s, nameof(Show.Seasons)) => SetRelation(s,
|
||||
(Show s, nameof(Show.Seasons)) => _SetRelation(s,
|
||||
SeasonRepository.GetAll(x => x.Show.ID == obj.ID),
|
||||
(x, y) => x.Seasons = y,
|
||||
(x, y) => { x.Show = y; x.ShowID = y.ID; }),
|
||||
|
||||
(Show s, nameof(Show.Episodes)) => SetRelation(s,
|
||||
(Show s, nameof(Show.Episodes)) => _SetRelation(s,
|
||||
EpisodeRepository.GetAll(x => x.Show.ID == obj.ID),
|
||||
(x, y) => x.Episodes = y,
|
||||
(x, y) => { x.Show = y; x.ShowID = y.ID; }),
|
||||
@ -305,12 +307,12 @@ namespace Kyoo.Core.Controllers
|
||||
}),
|
||||
|
||||
|
||||
(Season s, nameof(Season.ExternalIDs)) => SetRelation(s,
|
||||
(Season s, nameof(Season.ExternalIDs)) => _SetRelation(s,
|
||||
ProviderRepository.GetMetadataID<Season>(x => x.ResourceID == obj.ID),
|
||||
(x, y) => x.ExternalIDs = y,
|
||||
(x, y) => { x.ResourceID = y.ID; }),
|
||||
|
||||
(Season s, nameof(Season.Episodes)) => SetRelation(s,
|
||||
(Season s, nameof(Season.Episodes)) => _SetRelation(s,
|
||||
EpisodeRepository.GetAll(x => x.Season.ID == obj.ID),
|
||||
(x, y) => x.Episodes = y,
|
||||
(x, y) => { x.Season = y; x.SeasonID = y.ID; }),
|
||||
@ -324,12 +326,12 @@ namespace Kyoo.Core.Controllers
|
||||
}),
|
||||
|
||||
|
||||
(Episode e, nameof(Episode.ExternalIDs)) => SetRelation(e,
|
||||
(Episode e, nameof(Episode.ExternalIDs)) => _SetRelation(e,
|
||||
ProviderRepository.GetMetadataID<Episode>(x => x.ResourceID == obj.ID),
|
||||
(x, y) => x.ExternalIDs = y,
|
||||
(x, y) => { x.ResourceID = y.ID; }),
|
||||
|
||||
(Episode e, nameof(Episode.Tracks)) => SetRelation(e,
|
||||
(Episode e, nameof(Episode.Tracks)) => _SetRelation(e,
|
||||
TrackRepository.GetAll(x => x.Episode.ID == obj.ID),
|
||||
(x, y) => x.Tracks = y,
|
||||
(x, y) => { x.Episode = y; x.EpisodeID = y.ID; }),
|
||||
@ -369,13 +371,13 @@ namespace Kyoo.Core.Controllers
|
||||
.GetAll(x => x.Studio.ID == obj.ID)
|
||||
.Then(x => s.Shows = x),
|
||||
|
||||
(Studio s, nameof(Studio.ExternalIDs)) => SetRelation(s,
|
||||
(Studio s, nameof(Studio.ExternalIDs)) => _SetRelation(s,
|
||||
ProviderRepository.GetMetadataID<Studio>(x => x.ResourceID == obj.ID),
|
||||
(x, y) => x.ExternalIDs = y,
|
||||
(x, y) => { x.ResourceID = y.ID; }),
|
||||
|
||||
|
||||
(People p, nameof(People.ExternalIDs)) => SetRelation(p,
|
||||
(People p, nameof(People.ExternalIDs)) => _SetRelation(p,
|
||||
ProviderRepository.GetMetadataID<People>(x => x.ResourceID == obj.ID),
|
||||
(x, y) => x.ExternalIDs = y,
|
||||
(x, y) => { x.ResourceID = y.ID; }),
|
||||
|
@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// </summary>
|
||||
private readonly ILogger<ProviderComposite> _logger;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="ProviderComposite"/> with a list of available providers.
|
||||
/// </summary>
|
||||
@ -41,7 +40,6 @@ namespace Kyoo.Core.Controllers
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void UseProviders(IEnumerable<Provider> providers)
|
||||
{
|
||||
|
@ -101,7 +101,6 @@ namespace Kyoo.Core.Controllers
|
||||
if (ret.episode.SeasonNumber.HasValue)
|
||||
ret.season = new Season { SeasonNumber = ret.episode.SeasonNumber.Value };
|
||||
|
||||
|
||||
if (ret.episode.SeasonNumber == null && ret.episode.EpisodeNumber == null
|
||||
&& ret.episode.AbsoluteNumber == null)
|
||||
{
|
||||
|
@ -35,7 +35,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<Episode, object>> DefaultSort => x => x.EpisodeNumber;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="EpisodeRepository"/>.
|
||||
/// </summary>
|
||||
|
@ -23,7 +23,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<Genre, object>> DefaultSort => x => x.Slug;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="GenreRepository"/>.
|
||||
/// </summary>
|
||||
|
@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<LibraryItem, object>> DefaultSort => x => x.Title;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="LibraryItemRepository"/>.
|
||||
/// </summary>
|
||||
@ -43,7 +42,6 @@ namespace Kyoo.Core.Controllers
|
||||
_libraries = libraries;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Task<LibraryItem> GetOrDefault(int id)
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<Library, object>> DefaultSort => x => x.ID;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="LibraryRepository"/> instance.
|
||||
/// </summary>
|
||||
@ -42,7 +41,6 @@ namespace Kyoo.Core.Controllers
|
||||
_providers = providers;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async Task<ICollection<Library>> Search(string query)
|
||||
{
|
||||
|
@ -31,7 +31,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// </summary>
|
||||
protected abstract Expression<Func<T, object>> DefaultSort { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new base <see cref="LocalRepository{T}"/> with the given database handle.
|
||||
/// </summary>
|
||||
|
@ -51,7 +51,6 @@ namespace Kyoo.Core.Controllers
|
||||
_shows = shows;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async Task<ICollection<People>> Search(string query)
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// </summary>
|
||||
private readonly DatabaseContext _database;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="ProviderRepository" />.
|
||||
/// </summary>
|
||||
|
@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc/>
|
||||
protected override Expression<Func<Season, object>> DefaultSort => x => x.SeasonNumber;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="SeasonRepository"/>.
|
||||
/// </summary>
|
||||
|
@ -66,7 +66,6 @@ namespace Kyoo.Core.Controllers
|
||||
_providers = providers;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async Task<ICollection<Show>> Search(string query)
|
||||
{
|
||||
|
@ -28,7 +28,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<Studio, object>> DefaultSort => x => x.Name;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="StudioRepository"/>.
|
||||
/// </summary>
|
||||
|
@ -22,7 +22,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<Track, object>> DefaultSort => x => x.TrackIndex;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="TrackRepository"/>.
|
||||
/// </summary>
|
||||
|
@ -23,7 +23,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
protected override Expression<Func<User, object>> DefaultSort => x => x.Username;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="UserRepository"/>
|
||||
/// </summary>
|
||||
|
@ -100,7 +100,6 @@ namespace Kyoo.Core.Controllers
|
||||
/// </summary>
|
||||
private readonly CancellationTokenSource _taskToken = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="TaskManager"/>.
|
||||
/// </summary>
|
||||
@ -126,7 +125,6 @@ namespace Kyoo.Core.Controllers
|
||||
_logger.LogInformation("Task manager initiated without any tasks");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Triggered when the application host is ready to start the service.
|
||||
/// </summary>
|
||||
|
@ -48,7 +48,6 @@ namespace Kyoo.Core.Controllers
|
||||
[DllImport(TranscoderPath, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern void free_streams(IntPtr streams, uint count);
|
||||
|
||||
|
||||
public static Track[] ExtractInfos(string path, string outPath, bool reextract)
|
||||
{
|
||||
path = path.Replace('\\', '/');
|
||||
|
@ -46,13 +46,11 @@ namespace Kyoo.Core
|
||||
{ "logging", null }
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The configuration to use.
|
||||
/// </summary>
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new core module instance and use the given configuration.
|
||||
/// </summary>
|
||||
|
@ -45,7 +45,6 @@ namespace Kyoo.Core.Models.Watch
|
||||
/// </summary>
|
||||
[SerializeIgnore] public StreamType Type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a track from this stream.
|
||||
/// </summary>
|
||||
|
@ -126,7 +126,6 @@ namespace Kyoo.Core
|
||||
config.Register(path, type);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="PluginsStartup"/> from a webhost.
|
||||
/// This is meant to be used from <see cref="WebHostBuilderExtensions.UseStartup"/>.
|
||||
@ -169,7 +168,6 @@ namespace Kyoo.Core
|
||||
/// </summary>
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="HostServiceProvider"/> that will return given services when asked.
|
||||
/// </summary>
|
||||
|
@ -56,7 +56,6 @@ namespace Kyoo.Core.Tasks
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public TaskParameters GetParameters()
|
||||
{
|
||||
@ -125,7 +124,6 @@ namespace Kyoo.Core.Tasks
|
||||
.GroupBy(Path.GetDirectoryName)
|
||||
.ToList();
|
||||
|
||||
|
||||
string[] paths = shows.Select(x => x.First())
|
||||
.Concat(shows.SelectMany(x => x.Skip(1)))
|
||||
.ToArray();
|
||||
@ -146,7 +144,6 @@ namespace Kyoo.Core.Tasks
|
||||
percent += 100f / paths.Length;
|
||||
}
|
||||
|
||||
|
||||
string[] subtitles = files
|
||||
.Where(FileExtensions.IsSubtitle)
|
||||
.Where(x => !x.Contains("Extra"))
|
||||
|
@ -51,7 +51,6 @@ namespace Kyoo.Core.Tasks
|
||||
_metadataProviders = metadataProviders;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public TaskParameters GetParameters()
|
||||
{
|
||||
|
@ -35,7 +35,6 @@ namespace Kyoo.Core.Tasks
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public TaskParameters GetParameters()
|
||||
{
|
||||
|
@ -23,7 +23,6 @@ namespace Kyoo.Core.Api
|
||||
BaseURL = baseURL;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{id:int}")]
|
||||
[PartialPermission(Kind.Read)]
|
||||
public virtual async Task<ActionResult<T>> Get(int id)
|
||||
|
@ -90,7 +90,6 @@ namespace Kyoo.Core.Api
|
||||
ICollection<string> fields = (ICollection<string>)context.HttpContext.Items["fields"];
|
||||
Type pageType = Utility.GetGenericDefinition(result.DeclaredType, typeof(Page<>));
|
||||
|
||||
|
||||
if (pageType != null)
|
||||
{
|
||||
foreach (IResource resource in ((dynamic)result.Value).Items)
|
||||
|
@ -21,7 +21,6 @@ namespace Kyoo.Core.Api
|
||||
private readonly ILibraryItemRepository _libraryItems;
|
||||
private readonly Uri _baseURL;
|
||||
|
||||
|
||||
public LibraryItemApi(ILibraryItemRepository libraryItems, IOptions<BasicOptions> options)
|
||||
{
|
||||
_libraryItems = libraryItems;
|
||||
|
@ -44,7 +44,6 @@ namespace Kyoo.Core.Api
|
||||
return _files.FileResult(subtitle.Path);
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{slug}")]
|
||||
[Permission(nameof(SubtitleApi), Kind.Read)]
|
||||
public async Task<IActionResult> GetSubtitle(string slug)
|
||||
@ -67,7 +66,6 @@ namespace Kyoo.Core.Api
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ConvertSubripToVtt : IActionResult
|
||||
{
|
||||
private readonly string _path;
|
||||
|
@ -19,7 +19,6 @@ namespace Kyoo.Core.Api
|
||||
_taskManager = taskManager;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
[Permission(nameof(TaskApi), Kind.Read)]
|
||||
public ActionResult<ICollection<ITask>> GetTasks()
|
||||
|
@ -40,7 +40,6 @@ namespace Kyoo.Core.Api
|
||||
ctx.HttpContext.Response.Headers.Add("Expires", "0");
|
||||
}
|
||||
|
||||
|
||||
// TODO enable the following line, this is disabled since the web app can't use bearers. [Permission("video", Kind.Read)]
|
||||
[HttpGet("{slug}")]
|
||||
[HttpGet("direct/{slug}")]
|
||||
@ -95,7 +94,6 @@ namespace Kyoo.Core.Api
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("transmux/{episodeLink}/segments/{chunk}")]
|
||||
[Permission("video", Kind.Read)]
|
||||
public IActionResult GetTransmuxedChunk(string episodeLink, string chunk)
|
||||
|
@ -126,7 +126,6 @@ namespace Kyoo.Database
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The default constructor
|
||||
/// </summary>
|
||||
@ -227,7 +226,6 @@ namespace Kyoo.Database
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set database parameters to support every types of Kyoo.
|
||||
/// </summary>
|
||||
|
@ -1,4 +1,8 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{98851001-40DD-46A6-94B3-2F8D90722076}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Kyoo.Host.WindowsTrait.target" Condition="$(IsWindows) == true" />
|
||||
<Import Project="Kyoo.Host.WindowsTrait.linux.target" Condition="$(IsWindows) != true" />
|
||||
|
||||
|
@ -27,7 +27,6 @@ namespace Kyoo.Postgresql.Migrations
|
||||
CREATE TRIGGER season_slug_trigger BEFORE INSERT OR UPDATE OF season_number, show_id ON seasons
|
||||
FOR EACH ROW EXECUTE PROCEDURE season_slug_update();");
|
||||
|
||||
|
||||
// language=PostgreSQL
|
||||
migrationBuilder.Sql(@"
|
||||
CREATE FUNCTION episode_slug_update()
|
||||
@ -53,7 +52,6 @@ namespace Kyoo.Postgresql.Migrations
|
||||
BEFORE INSERT OR UPDATE OF absolute_number, episode_number, season_number, show_id ON episodes
|
||||
FOR EACH ROW EXECUTE PROCEDURE episode_slug_update();");
|
||||
|
||||
|
||||
// language=PostgreSQL
|
||||
migrationBuilder.Sql(@"
|
||||
CREATE FUNCTION show_slug_update()
|
||||
@ -137,7 +135,6 @@ namespace Kyoo.Postgresql.Migrations
|
||||
BEFORE INSERT OR UPDATE OF episode_id, is_forced, language, track_index, type ON tracks
|
||||
FOR EACH ROW EXECUTE PROCEDURE track_slug_update();");
|
||||
|
||||
|
||||
// language=PostgreSQL
|
||||
migrationBuilder.Sql(@"
|
||||
CREATE VIEW library_items AS
|
||||
|
@ -31,7 +31,6 @@ namespace Kyoo.Postgresql
|
||||
/// </summary>
|
||||
private readonly bool _skipConfigure;
|
||||
|
||||
|
||||
static PostgresContext()
|
||||
{
|
||||
NpgsqlConnection.GlobalTypeMapper.MapEnum<Status>();
|
||||
|
@ -134,7 +134,6 @@ namespace Kyoo.SqLite.Migrations
|
||||
WHERE EpisodeID = NEW.ID;
|
||||
END;");
|
||||
|
||||
|
||||
// language=SQLite
|
||||
migrationBuilder.Sql(@"
|
||||
CREATE TRIGGER ShowSlugUpdate AFTER UPDATE OF Slug ON Shows FOR EACH ROW
|
||||
@ -150,7 +149,6 @@ namespace Kyoo.SqLite.Migrations
|
||||
WHERE ShowID = new.ID;
|
||||
END;");
|
||||
|
||||
|
||||
// language=SQLite
|
||||
migrationBuilder.Sql(@"
|
||||
CREATE VIEW LibraryItems AS
|
||||
|
@ -139,7 +139,6 @@ namespace Kyoo.SqLite
|
||||
.Property(x => x.Images)
|
||||
.HasConversion(jsonConvertor);
|
||||
|
||||
|
||||
modelBuilder.Entity<LibraryItem>()
|
||||
.ToView("LibraryItems")
|
||||
.HasKey(x => x.ID);
|
||||
|
@ -30,7 +30,6 @@ namespace Kyoo.SqLite
|
||||
/// <inheritdoc />
|
||||
public bool Enabled => _configuration.GetSelectedDatabase() == "sqlite";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The configuration to use. The database connection string is pulled from it.
|
||||
/// </summary>
|
||||
@ -52,7 +51,6 @@ namespace Kyoo.SqLite
|
||||
_environment = env;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Configure(IServiceCollection services)
|
||||
{
|
||||
|
@ -38,7 +38,6 @@ namespace Kyoo.TheTvdb
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="ProviderTvdb"/> using a tvdb client and an api key.
|
||||
/// </summary>
|
||||
|
@ -13,7 +13,6 @@ namespace Kyoo.Tests
|
||||
public TestContext Context { get; }
|
||||
public ILibraryManager LibraryManager { get; }
|
||||
|
||||
|
||||
private readonly List<DatabaseContext> _databases = new();
|
||||
|
||||
public RepositoryActivator(ITestOutputHelper output, PostgresFixture postgres = null)
|
||||
|
@ -19,7 +19,6 @@ namespace Kyoo.Tests.Database
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace PostgreSQL
|
||||
{
|
||||
[Collection(nameof(Postgresql))]
|
||||
@ -127,7 +126,6 @@ namespace Kyoo.Tests.Database
|
||||
Assert.Equal($"new-slug-3", episode.Slug);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task AbsoluteNumberEditTest()
|
||||
{
|
||||
|
@ -16,7 +16,6 @@ namespace Kyoo.Tests.Database
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace PostgreSQL
|
||||
{
|
||||
[Collection(nameof(Postgresql))]
|
||||
|
@ -19,7 +19,6 @@ namespace Kyoo.Tests.Database
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace PostgreSQL
|
||||
{
|
||||
[Collection(nameof(Postgresql))]
|
||||
|
@ -15,7 +15,6 @@ namespace Kyoo.Tests.Database
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace PostgreSQL
|
||||
{
|
||||
[Collection(nameof(Postgresql))]
|
||||
|
@ -163,7 +163,6 @@ namespace Kyoo.Tests
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Class responsible to fill and create in memory databases for unit tests.
|
||||
/// </summary>
|
||||
|
@ -122,7 +122,6 @@ namespace Kyoo.Tests
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private static readonly Dictionary<Type, Func<object>> Samples = new()
|
||||
{
|
||||
{
|
||||
|
@ -36,7 +36,6 @@ namespace Kyoo.Tests.Identifier
|
||||
_identifier = new RegexIdentifier(options.Object, _manager.Object);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task EpisodeIdentification()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user