CodingStyle: Removing duplicated blank lines

This commit is contained in:
Zoe Roux 2021-09-05 10:34:24 +02:00
parent 2d3659d0b9
commit 62eec91e6e
60 changed files with 18 additions and 90 deletions

View File

@ -217,7 +217,6 @@ namespace Kyoo.Abstractions.Controllers
/// <returns>How many resources matched that filter</returns> /// <returns>How many resources matched that filter</returns>
Task<int> GetCount(Expression<Func<T, bool>> where = null); Task<int> GetCount(Expression<Func<T, bool>> where = null);
/// <summary> /// <summary>
/// Create a new resource. /// Create a new resource.
/// </summary> /// </summary>

View File

@ -140,7 +140,6 @@ namespace Kyoo.Abstractions.Controllers
/// <param name="name">The name of the task (case sensitive)</param> /// <param name="name">The name of the task (case sensitive)</param>
public TaskParameter this[string name] => this.FirstOrDefault(x => x.Name == name); public TaskParameter this[string name] => this.FirstOrDefault(x => x.Name == name);
/// <summary> /// <summary>
/// Create a new, empty, <see cref="TaskParameters"/> /// Create a new, empty, <see cref="TaskParameters"/>
/// </summary> /// </summary>

View File

@ -60,7 +60,6 @@ namespace Kyoo.Abstractions.Controllers
=> new(action, priority); => new(action, priority);
} }
/// <summary> /// <summary>
/// An action executed on kyoo's startup to initialize the asp-net container. /// An action executed on kyoo's startup to initialize the asp-net container.
/// </summary> /// </summary>

View File

@ -27,7 +27,6 @@ namespace Kyoo.Abstractions.Models.Attributes
/// </summary> /// </summary>
public bool StripScheme { get; set; } public bool StripScheme { get; set; }
/// <summary> /// <summary>
/// Create a new <see cref="FileSystemMetadataAttribute"/> using the specified schemes. /// Create a new <see cref="FileSystemMetadataAttribute"/> using the specified schemes.
/// </summary> /// </summary>

View File

@ -43,7 +43,6 @@ namespace Kyoo.Abstractions.Models.Attributes
/// </summary> /// </summary>
public bool IsHidden { get; set; } public bool IsHidden { get; set; }
/// <summary> /// <summary>
/// Create a new <see cref="TaskMetadataAttribute"/> with the given slug, name and description. /// Create a new <see cref="TaskMetadataAttribute"/> with the given slug, name and description.
/// </summary> /// </summary>

View File

@ -21,7 +21,6 @@ namespace Kyoo.Abstractions.Models
/// </summary> /// </summary>
public Type Type { get; } public Type Type { get; }
/// <summary> /// <summary>
/// Create a new <see cref="ConfigurationReference"/> using a given path and type. /// 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"/> /// 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) new ConfigurationReference(path, type)
}; };
if (!type.IsClass || type.AssemblyQualifiedName?.StartsWith("System") == true) if (!type.IsClass || type.AssemblyQualifiedName?.StartsWith("System") == true)
return ret; return ret;
@ -89,7 +87,6 @@ namespace Kyoo.Abstractions.Models
return CreateReference(path, typeof(T)); return CreateReference(path, typeof(T));
} }
public static ConfigurationReference CreateUntyped(string path) public static ConfigurationReference CreateUntyped(string path)
{ {
return new(path, null); return new(path, null);

View File

@ -70,7 +70,6 @@ namespace Kyoo.Abstractions.Models
/// </summary> /// </summary>
public ItemType Type { get; set; } public ItemType Type { get; set; }
/// <summary> /// <summary>
/// Create a new, empty <see cref="LibraryItem"/>. /// Create a new, empty <see cref="LibraryItem"/>.
/// </summary> /// </summary>

View File

@ -36,7 +36,6 @@ namespace Kyoo.Abstractions.Models
/// </summary> /// </summary>
public ICollection<T> Items { get; } public ICollection<T> Items { get; }
/// <summary> /// <summary>
/// Create a new <see cref="Page{T}"/>. /// Create a new <see cref="Page{T}"/>.
/// </summary> /// </summary>

View File

@ -130,7 +130,6 @@ namespace Kyoo.Abstractions.Models
/// </summary> /// </summary>
public ICollection<Chapter> Chapters { get; set; } public ICollection<Chapter> Chapters { get; set; }
/// <summary> /// <summary>
/// Create a <see cref="WatchItem"/> from an <see cref="Episode"/>. /// Create a <see cref="WatchItem"/> from an <see cref="Episode"/>.
/// </summary> /// </summary>

View File

@ -48,7 +48,6 @@ namespace Kyoo.Authentication
{ CertificateOption.Path, typeof(CertificateOption) } { CertificateOption.Path, typeof(CertificateOption) }
}; };
/// <summary> /// <summary>
/// The configuration to use. /// The configuration to use.
/// </summary> /// </summary>
@ -64,7 +63,6 @@ namespace Kyoo.Authentication
/// </summary> /// </summary>
private readonly IWebHostEnvironment _environment; private readonly IWebHostEnvironment _environment;
/// <summary> /// <summary>
/// Create a new authentication module instance and use the given configuration and environment. /// Create a new authentication module instance and use the given configuration and environment.
/// </summary> /// </summary>

View File

@ -28,7 +28,6 @@ namespace Kyoo.Authentication.Models.DTO
[MinLength(8, ErrorMessage = "The password must have at least {1} characters")] [MinLength(8, ErrorMessage = "The password must have at least {1} characters")]
public string Password { get; set; } public string Password { get; set; }
/// <summary> /// <summary>
/// Convert this register request to a new <see cref="User"/> class. /// Convert this register request to a new <see cref="User"/> class.
/// </summary> /// </summary>

View File

@ -44,7 +44,6 @@ namespace Kyoo.Authentication.Views
/// </summary> /// </summary>
private readonly IOptions<AuthenticationOption> _options; private readonly IOptions<AuthenticationOption> _options;
/// <summary> /// <summary>
/// Create a new <see cref="AccountApi"/> handle to handle login/users requests. /// Create a new <see cref="AccountApi"/> handle to handle login/users requests.
/// </summary> /// </summary>
@ -60,7 +59,6 @@ namespace Kyoo.Authentication.Views
_options = options; _options = options;
} }
/// <summary> /// <summary>
/// Register a new user and return a OTAC to connect to it. /// Register a new user and return a OTAC to connect to it.
/// </summary> /// </summary>

View File

@ -44,7 +44,6 @@ namespace Kyoo.Core.Controllers
_references = references.ToDictionary(x => x.Path, x => x.Type, StringComparer.OrdinalIgnoreCase); _references = references.ToDictionary(x => x.Path, x => x.Type, StringComparer.OrdinalIgnoreCase);
} }
/// <inheritdoc /> /// <inheritdoc />
public void AddTyped<T>(string path) public void AddTyped<T>(string path)
{ {

View File

@ -53,7 +53,6 @@ namespace Kyoo.Core.Controllers
_options = options; _options = options;
} }
/// <summary> /// <summary>
/// Retrieve the file system that should be used for a given path. /// Retrieve the file system that should be used for a given path.
/// </summary> /// </summary>

View File

@ -31,7 +31,6 @@ namespace Kyoo.Core.Controllers
_clientFactory = factory; _clientFactory = factory;
} }
/// <inheritdoc /> /// <inheritdoc />
public IActionResult FileResult(string path, bool rangeSupport = false, string type = null) public IActionResult FileResult(string path, bool rangeSupport = false, string type = null)
{ {

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -53,7 +54,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
public IUserRepository UserRepository { get; } public IUserRepository UserRepository { get; }
/// <summary> /// <summary>
/// Create a new <see cref="LibraryManager"/> instance with every repository available. /// Create a new <see cref="LibraryManager"/> instance with every repository available.
/// </summary> /// </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> /// <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="T1">The type of the owner object</typeparam>
/// <typeparam name="T2">The type of the related 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, Task<ICollection<T2>> loader,
Action<T1, ICollection<T2>> setter, Action<T1, ICollection<T2>> setter,
Action<T2, T1> inverse) Action<T2, T1> inverse)
@ -224,6 +224,8 @@ namespace Kyoo.Core.Controllers
} }
/// <inheritdoc /> /// <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) public Task Load(IResource obj, string memberName, bool force = false)
{ {
if (obj == null) if (obj == null)
@ -251,7 +253,7 @@ namespace Kyoo.Core.Controllers
.Then(x => l.Collections = x), .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), ProviderRepository.GetMetadataID<Collection>(x => x.ResourceID == obj.ID),
(x, y) => x.ExternalIDs = y, (x, y) => x.ExternalIDs = y,
(x, y) => { x.ResourceID = y.ID; }), (x, y) => { x.ResourceID = y.ID; }),
@ -265,7 +267,7 @@ namespace Kyoo.Core.Controllers
.Then(x => c.Libraries = x), .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), ProviderRepository.GetMetadataID<Show>(x => x.ResourceID == obj.ID),
(x, y) => x.ExternalIDs = y, (x, y) => x.ExternalIDs = y,
(x, y) => { x.ResourceID = y.ID; }), (x, y) => { x.ResourceID = y.ID; }),
@ -278,12 +280,12 @@ namespace Kyoo.Core.Controllers
.GetFromShow(obj.ID) .GetFromShow(obj.ID)
.Then(x => s.People = x), .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), SeasonRepository.GetAll(x => x.Show.ID == obj.ID),
(x, y) => x.Seasons = y, (x, y) => x.Seasons = y,
(x, y) => { x.Show = y; x.ShowID = y.ID; }), (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), EpisodeRepository.GetAll(x => x.Show.ID == obj.ID),
(x, y) => x.Episodes = y, (x, y) => x.Episodes = y,
(x, y) => { x.Show = y; x.ShowID = y.ID; }), (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), ProviderRepository.GetMetadataID<Season>(x => x.ResourceID == obj.ID),
(x, y) => x.ExternalIDs = y, (x, y) => x.ExternalIDs = y,
(x, y) => { x.ResourceID = y.ID; }), (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), EpisodeRepository.GetAll(x => x.Season.ID == obj.ID),
(x, y) => x.Episodes = y, (x, y) => x.Episodes = y,
(x, y) => { x.Season = y; x.SeasonID = y.ID; }), (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), ProviderRepository.GetMetadataID<Episode>(x => x.ResourceID == obj.ID),
(x, y) => x.ExternalIDs = y, (x, y) => x.ExternalIDs = y,
(x, y) => { x.ResourceID = y.ID; }), (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), TrackRepository.GetAll(x => x.Episode.ID == obj.ID),
(x, y) => x.Tracks = y, (x, y) => x.Tracks = y,
(x, y) => { x.Episode = y; x.EpisodeID = y.ID; }), (x, y) => { x.Episode = y; x.EpisodeID = y.ID; }),
@ -369,13 +371,13 @@ namespace Kyoo.Core.Controllers
.GetAll(x => x.Studio.ID == obj.ID) .GetAll(x => x.Studio.ID == obj.ID)
.Then(x => s.Shows = x), .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), ProviderRepository.GetMetadataID<Studio>(x => x.ResourceID == obj.ID),
(x, y) => x.ExternalIDs = y, (x, y) => x.ExternalIDs = y,
(x, y) => { x.ResourceID = y.ID; }), (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), ProviderRepository.GetMetadataID<People>(x => x.ResourceID == obj.ID),
(x, y) => x.ExternalIDs = y, (x, y) => x.ExternalIDs = y,
(x, y) => { x.ResourceID = y.ID; }), (x, y) => { x.ResourceID = y.ID; }),

View File

@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
/// </summary> /// </summary>
private readonly ILogger<ProviderComposite> _logger; private readonly ILogger<ProviderComposite> _logger;
/// <summary> /// <summary>
/// Create a new <see cref="ProviderComposite"/> with a list of available providers. /// Create a new <see cref="ProviderComposite"/> with a list of available providers.
/// </summary> /// </summary>
@ -41,7 +40,6 @@ namespace Kyoo.Core.Controllers
_logger = logger; _logger = logger;
} }
/// <inheritdoc /> /// <inheritdoc />
public override void UseProviders(IEnumerable<Provider> providers) public override void UseProviders(IEnumerable<Provider> providers)
{ {

View File

@ -101,7 +101,6 @@ namespace Kyoo.Core.Controllers
if (ret.episode.SeasonNumber.HasValue) if (ret.episode.SeasonNumber.HasValue)
ret.season = new Season { SeasonNumber = ret.episode.SeasonNumber.Value }; ret.season = new Season { SeasonNumber = ret.episode.SeasonNumber.Value };
if (ret.episode.SeasonNumber == null && ret.episode.EpisodeNumber == null if (ret.episode.SeasonNumber == null && ret.episode.EpisodeNumber == null
&& ret.episode.AbsoluteNumber == null) && ret.episode.AbsoluteNumber == null)
{ {

View File

@ -35,7 +35,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<Episode, object>> DefaultSort => x => x.EpisodeNumber; protected override Expression<Func<Episode, object>> DefaultSort => x => x.EpisodeNumber;
/// <summary> /// <summary>
/// Create a new <see cref="EpisodeRepository"/>. /// Create a new <see cref="EpisodeRepository"/>.
/// </summary> /// </summary>

View File

@ -23,7 +23,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<Genre, object>> DefaultSort => x => x.Slug; protected override Expression<Func<Genre, object>> DefaultSort => x => x.Slug;
/// <summary> /// <summary>
/// Create a new <see cref="GenreRepository"/>. /// Create a new <see cref="GenreRepository"/>.
/// </summary> /// </summary>

View File

@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<LibraryItem, object>> DefaultSort => x => x.Title; protected override Expression<Func<LibraryItem, object>> DefaultSort => x => x.Title;
/// <summary> /// <summary>
/// Create a new <see cref="LibraryItemRepository"/>. /// Create a new <see cref="LibraryItemRepository"/>.
/// </summary> /// </summary>
@ -43,7 +42,6 @@ namespace Kyoo.Core.Controllers
_libraries = libraries; _libraries = libraries;
} }
/// <inheritdoc /> /// <inheritdoc />
public override Task<LibraryItem> GetOrDefault(int id) public override Task<LibraryItem> GetOrDefault(int id)
{ {

View File

@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<Library, object>> DefaultSort => x => x.ID; protected override Expression<Func<Library, object>> DefaultSort => x => x.ID;
/// <summary> /// <summary>
/// Create a new <see cref="LibraryRepository"/> instance. /// Create a new <see cref="LibraryRepository"/> instance.
/// </summary> /// </summary>
@ -42,7 +41,6 @@ namespace Kyoo.Core.Controllers
_providers = providers; _providers = providers;
} }
/// <inheritdoc /> /// <inheritdoc />
public override async Task<ICollection<Library>> Search(string query) public override async Task<ICollection<Library>> Search(string query)
{ {

View File

@ -31,7 +31,6 @@ namespace Kyoo.Core.Controllers
/// </summary> /// </summary>
protected abstract Expression<Func<T, object>> DefaultSort { get; } protected abstract Expression<Func<T, object>> DefaultSort { get; }
/// <summary> /// <summary>
/// Create a new base <see cref="LocalRepository{T}"/> with the given database handle. /// Create a new base <see cref="LocalRepository{T}"/> with the given database handle.
/// </summary> /// </summary>

View File

@ -51,7 +51,6 @@ namespace Kyoo.Core.Controllers
_shows = shows; _shows = shows;
} }
/// <inheritdoc /> /// <inheritdoc />
public override async Task<ICollection<People>> Search(string query) public override async Task<ICollection<People>> Search(string query)
{ {

View File

@ -20,7 +20,6 @@ namespace Kyoo.Core.Controllers
/// </summary> /// </summary>
private readonly DatabaseContext _database; private readonly DatabaseContext _database;
/// <summary> /// <summary>
/// Create a new <see cref="ProviderRepository" />. /// Create a new <see cref="ProviderRepository" />.
/// </summary> /// </summary>

View File

@ -29,7 +29,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc/> /// <inheritdoc/>
protected override Expression<Func<Season, object>> DefaultSort => x => x.SeasonNumber; protected override Expression<Func<Season, object>> DefaultSort => x => x.SeasonNumber;
/// <summary> /// <summary>
/// Create a new <see cref="SeasonRepository"/>. /// Create a new <see cref="SeasonRepository"/>.
/// </summary> /// </summary>

View File

@ -66,7 +66,6 @@ namespace Kyoo.Core.Controllers
_providers = providers; _providers = providers;
} }
/// <inheritdoc /> /// <inheritdoc />
public override async Task<ICollection<Show>> Search(string query) public override async Task<ICollection<Show>> Search(string query)
{ {

View File

@ -28,7 +28,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<Studio, object>> DefaultSort => x => x.Name; protected override Expression<Func<Studio, object>> DefaultSort => x => x.Name;
/// <summary> /// <summary>
/// Create a new <see cref="StudioRepository"/>. /// Create a new <see cref="StudioRepository"/>.
/// </summary> /// </summary>

View File

@ -22,7 +22,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<Track, object>> DefaultSort => x => x.TrackIndex; protected override Expression<Func<Track, object>> DefaultSort => x => x.TrackIndex;
/// <summary> /// <summary>
/// Create a new <see cref="TrackRepository"/>. /// Create a new <see cref="TrackRepository"/>.
/// </summary> /// </summary>

View File

@ -23,7 +23,6 @@ namespace Kyoo.Core.Controllers
/// <inheritdoc /> /// <inheritdoc />
protected override Expression<Func<User, object>> DefaultSort => x => x.Username; protected override Expression<Func<User, object>> DefaultSort => x => x.Username;
/// <summary> /// <summary>
/// Create a new <see cref="UserRepository"/> /// Create a new <see cref="UserRepository"/>
/// </summary> /// </summary>

View File

@ -100,7 +100,6 @@ namespace Kyoo.Core.Controllers
/// </summary> /// </summary>
private readonly CancellationTokenSource _taskToken = new(); private readonly CancellationTokenSource _taskToken = new();
/// <summary> /// <summary>
/// Create a new <see cref="TaskManager"/>. /// Create a new <see cref="TaskManager"/>.
/// </summary> /// </summary>
@ -126,7 +125,6 @@ namespace Kyoo.Core.Controllers
_logger.LogInformation("Task manager initiated without any tasks"); _logger.LogInformation("Task manager initiated without any tasks");
} }
/// <summary> /// <summary>
/// Triggered when the application host is ready to start the service. /// Triggered when the application host is ready to start the service.
/// </summary> /// </summary>

View File

@ -48,7 +48,6 @@ namespace Kyoo.Core.Controllers
[DllImport(TranscoderPath, CallingConvention = CallingConvention.Cdecl)] [DllImport(TranscoderPath, CallingConvention = CallingConvention.Cdecl)]
private static extern void free_streams(IntPtr streams, uint count); private static extern void free_streams(IntPtr streams, uint count);
public static Track[] ExtractInfos(string path, string outPath, bool reextract) public static Track[] ExtractInfos(string path, string outPath, bool reextract)
{ {
path = path.Replace('\\', '/'); path = path.Replace('\\', '/');

View File

@ -46,13 +46,11 @@ namespace Kyoo.Core
{ "logging", null } { "logging", null }
}; };
/// <summary> /// <summary>
/// The configuration to use. /// The configuration to use.
/// </summary> /// </summary>
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
/// <summary> /// <summary>
/// Create a new core module instance and use the given configuration. /// Create a new core module instance and use the given configuration.
/// </summary> /// </summary>

View File

@ -45,7 +45,6 @@ namespace Kyoo.Core.Models.Watch
/// </summary> /// </summary>
[SerializeIgnore] public StreamType Type { get; set; } [SerializeIgnore] public StreamType Type { get; set; }
/// <summary> /// <summary>
/// Create a track from this stream. /// Create a track from this stream.
/// </summary> /// </summary>

View File

@ -126,7 +126,6 @@ namespace Kyoo.Core
config.Register(path, type); config.Register(path, type);
} }
/// <summary> /// <summary>
/// Create a new <see cref="PluginsStartup"/> from a webhost. /// Create a new <see cref="PluginsStartup"/> from a webhost.
/// This is meant to be used from <see cref="WebHostBuilderExtensions.UseStartup"/>. /// This is meant to be used from <see cref="WebHostBuilderExtensions.UseStartup"/>.
@ -169,7 +168,6 @@ namespace Kyoo.Core
/// </summary> /// </summary>
private readonly ILoggerFactory _loggerFactory; private readonly ILoggerFactory _loggerFactory;
/// <summary> /// <summary>
/// Create a new <see cref="HostServiceProvider"/> that will return given services when asked. /// Create a new <see cref="HostServiceProvider"/> that will return given services when asked.
/// </summary> /// </summary>

View File

@ -56,7 +56,6 @@ namespace Kyoo.Core.Tasks
_logger = logger; _logger = logger;
} }
/// <inheritdoc /> /// <inheritdoc />
public TaskParameters GetParameters() public TaskParameters GetParameters()
{ {
@ -125,7 +124,6 @@ namespace Kyoo.Core.Tasks
.GroupBy(Path.GetDirectoryName) .GroupBy(Path.GetDirectoryName)
.ToList(); .ToList();
string[] paths = shows.Select(x => x.First()) string[] paths = shows.Select(x => x.First())
.Concat(shows.SelectMany(x => x.Skip(1))) .Concat(shows.SelectMany(x => x.Skip(1)))
.ToArray(); .ToArray();
@ -146,7 +144,6 @@ namespace Kyoo.Core.Tasks
percent += 100f / paths.Length; percent += 100f / paths.Length;
} }
string[] subtitles = files string[] subtitles = files
.Where(FileExtensions.IsSubtitle) .Where(FileExtensions.IsSubtitle)
.Where(x => !x.Contains("Extra")) .Where(x => !x.Contains("Extra"))

View File

@ -51,7 +51,6 @@ namespace Kyoo.Core.Tasks
_metadataProviders = metadataProviders; _metadataProviders = metadataProviders;
} }
/// <inheritdoc /> /// <inheritdoc />
public TaskParameters GetParameters() public TaskParameters GetParameters()
{ {

View File

@ -35,7 +35,6 @@ namespace Kyoo.Core.Tasks
_provider = provider; _provider = provider;
} }
/// <inheritdoc /> /// <inheritdoc />
public TaskParameters GetParameters() public TaskParameters GetParameters()
{ {

View File

@ -23,7 +23,6 @@ namespace Kyoo.Core.Api
BaseURL = baseURL; BaseURL = baseURL;
} }
[HttpGet("{id:int}")] [HttpGet("{id:int}")]
[PartialPermission(Kind.Read)] [PartialPermission(Kind.Read)]
public virtual async Task<ActionResult<T>> Get(int id) public virtual async Task<ActionResult<T>> Get(int id)

View File

@ -90,7 +90,6 @@ namespace Kyoo.Core.Api
ICollection<string> fields = (ICollection<string>)context.HttpContext.Items["fields"]; ICollection<string> fields = (ICollection<string>)context.HttpContext.Items["fields"];
Type pageType = Utility.GetGenericDefinition(result.DeclaredType, typeof(Page<>)); Type pageType = Utility.GetGenericDefinition(result.DeclaredType, typeof(Page<>));
if (pageType != null) if (pageType != null)
{ {
foreach (IResource resource in ((dynamic)result.Value).Items) foreach (IResource resource in ((dynamic)result.Value).Items)

View File

@ -21,7 +21,6 @@ namespace Kyoo.Core.Api
private readonly ILibraryItemRepository _libraryItems; private readonly ILibraryItemRepository _libraryItems;
private readonly Uri _baseURL; private readonly Uri _baseURL;
public LibraryItemApi(ILibraryItemRepository libraryItems, IOptions<BasicOptions> options) public LibraryItemApi(ILibraryItemRepository libraryItems, IOptions<BasicOptions> options)
{ {
_libraryItems = libraryItems; _libraryItems = libraryItems;

View File

@ -44,7 +44,6 @@ namespace Kyoo.Core.Api
return _files.FileResult(subtitle.Path); return _files.FileResult(subtitle.Path);
} }
[HttpGet("{slug}")] [HttpGet("{slug}")]
[Permission(nameof(SubtitleApi), Kind.Read)] [Permission(nameof(SubtitleApi), Kind.Read)]
public async Task<IActionResult> GetSubtitle(string slug) public async Task<IActionResult> GetSubtitle(string slug)
@ -67,7 +66,6 @@ namespace Kyoo.Core.Api
} }
} }
public class ConvertSubripToVtt : IActionResult public class ConvertSubripToVtt : IActionResult
{ {
private readonly string _path; private readonly string _path;

View File

@ -19,7 +19,6 @@ namespace Kyoo.Core.Api
_taskManager = taskManager; _taskManager = taskManager;
} }
[HttpGet] [HttpGet]
[Permission(nameof(TaskApi), Kind.Read)] [Permission(nameof(TaskApi), Kind.Read)]
public ActionResult<ICollection<ITask>> GetTasks() public ActionResult<ICollection<ITask>> GetTasks()

View File

@ -40,7 +40,6 @@ namespace Kyoo.Core.Api
ctx.HttpContext.Response.Headers.Add("Expires", "0"); 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)] // TODO enable the following line, this is disabled since the web app can't use bearers. [Permission("video", Kind.Read)]
[HttpGet("{slug}")] [HttpGet("{slug}")]
[HttpGet("direct/{slug}")] [HttpGet("direct/{slug}")]
@ -95,7 +94,6 @@ namespace Kyoo.Core.Api
} }
} }
[HttpGet("transmux/{episodeLink}/segments/{chunk}")] [HttpGet("transmux/{episodeLink}/segments/{chunk}")]
[Permission("video", Kind.Read)] [Permission("video", Kind.Read)]
public IActionResult GetTransmuxedChunk(string episodeLink, string chunk) public IActionResult GetTransmuxedChunk(string episodeLink, string chunk)

View File

@ -126,7 +126,6 @@ namespace Kyoo.Database
}); });
} }
/// <summary> /// <summary>
/// The default constructor /// The default constructor
/// </summary> /// </summary>
@ -227,7 +226,6 @@ namespace Kyoo.Database
); );
} }
/// <summary> /// <summary>
/// Set database parameters to support every types of Kyoo. /// Set database parameters to support every types of Kyoo.
/// </summary> /// </summary>

View File

@ -1,4 +1,8 @@
<Project> <Project>
<PropertyGroup>
<ProjectGuid>{98851001-40DD-46A6-94B3-2F8D90722076}</ProjectGuid>
</PropertyGroup>
<Import Project="Kyoo.Host.WindowsTrait.target" Condition="$(IsWindows) == true" /> <Import Project="Kyoo.Host.WindowsTrait.target" Condition="$(IsWindows) == true" />
<Import Project="Kyoo.Host.WindowsTrait.linux.target" Condition="$(IsWindows) != true" /> <Import Project="Kyoo.Host.WindowsTrait.linux.target" Condition="$(IsWindows) != true" />

View File

@ -27,7 +27,6 @@ namespace Kyoo.Postgresql.Migrations
CREATE TRIGGER season_slug_trigger BEFORE INSERT OR UPDATE OF season_number, show_id ON seasons CREATE TRIGGER season_slug_trigger BEFORE INSERT OR UPDATE OF season_number, show_id ON seasons
FOR EACH ROW EXECUTE PROCEDURE season_slug_update();"); FOR EACH ROW EXECUTE PROCEDURE season_slug_update();");
// language=PostgreSQL // language=PostgreSQL
migrationBuilder.Sql(@" migrationBuilder.Sql(@"
CREATE FUNCTION episode_slug_update() 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 BEFORE INSERT OR UPDATE OF absolute_number, episode_number, season_number, show_id ON episodes
FOR EACH ROW EXECUTE PROCEDURE episode_slug_update();"); FOR EACH ROW EXECUTE PROCEDURE episode_slug_update();");
// language=PostgreSQL // language=PostgreSQL
migrationBuilder.Sql(@" migrationBuilder.Sql(@"
CREATE FUNCTION show_slug_update() 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 BEFORE INSERT OR UPDATE OF episode_id, is_forced, language, track_index, type ON tracks
FOR EACH ROW EXECUTE PROCEDURE track_slug_update();"); FOR EACH ROW EXECUTE PROCEDURE track_slug_update();");
// language=PostgreSQL // language=PostgreSQL
migrationBuilder.Sql(@" migrationBuilder.Sql(@"
CREATE VIEW library_items AS CREATE VIEW library_items AS

View File

@ -31,7 +31,6 @@ namespace Kyoo.Postgresql
/// </summary> /// </summary>
private readonly bool _skipConfigure; private readonly bool _skipConfigure;
static PostgresContext() static PostgresContext()
{ {
NpgsqlConnection.GlobalTypeMapper.MapEnum<Status>(); NpgsqlConnection.GlobalTypeMapper.MapEnum<Status>();

View File

@ -134,7 +134,6 @@ namespace Kyoo.SqLite.Migrations
WHERE EpisodeID = NEW.ID; WHERE EpisodeID = NEW.ID;
END;"); END;");
// language=SQLite // language=SQLite
migrationBuilder.Sql(@" migrationBuilder.Sql(@"
CREATE TRIGGER ShowSlugUpdate AFTER UPDATE OF Slug ON Shows FOR EACH ROW CREATE TRIGGER ShowSlugUpdate AFTER UPDATE OF Slug ON Shows FOR EACH ROW
@ -150,7 +149,6 @@ namespace Kyoo.SqLite.Migrations
WHERE ShowID = new.ID; WHERE ShowID = new.ID;
END;"); END;");
// language=SQLite // language=SQLite
migrationBuilder.Sql(@" migrationBuilder.Sql(@"
CREATE VIEW LibraryItems AS CREATE VIEW LibraryItems AS

View File

@ -139,7 +139,6 @@ namespace Kyoo.SqLite
.Property(x => x.Images) .Property(x => x.Images)
.HasConversion(jsonConvertor); .HasConversion(jsonConvertor);
modelBuilder.Entity<LibraryItem>() modelBuilder.Entity<LibraryItem>()
.ToView("LibraryItems") .ToView("LibraryItems")
.HasKey(x => x.ID); .HasKey(x => x.ID);

View File

@ -30,7 +30,6 @@ namespace Kyoo.SqLite
/// <inheritdoc /> /// <inheritdoc />
public bool Enabled => _configuration.GetSelectedDatabase() == "sqlite"; public bool Enabled => _configuration.GetSelectedDatabase() == "sqlite";
/// <summary> /// <summary>
/// The configuration to use. The database connection string is pulled from it. /// The configuration to use. The database connection string is pulled from it.
/// </summary> /// </summary>
@ -52,7 +51,6 @@ namespace Kyoo.SqLite
_environment = env; _environment = env;
} }
/// <inheritdoc /> /// <inheritdoc />
public void Configure(IServiceCollection services) public void Configure(IServiceCollection services)
{ {

View File

@ -38,7 +38,6 @@ namespace Kyoo.TheTvdb
} }
}; };
/// <summary> /// <summary>
/// Create a new <see cref="ProviderTvdb"/> using a tvdb client and an api key. /// Create a new <see cref="ProviderTvdb"/> using a tvdb client and an api key.
/// </summary> /// </summary>

View File

@ -13,7 +13,6 @@ namespace Kyoo.Tests
public TestContext Context { get; } public TestContext Context { get; }
public ILibraryManager LibraryManager { get; } public ILibraryManager LibraryManager { get; }
private readonly List<DatabaseContext> _databases = new(); private readonly List<DatabaseContext> _databases = new();
public RepositoryActivator(ITestOutputHelper output, PostgresFixture postgres = null) public RepositoryActivator(ITestOutputHelper output, PostgresFixture postgres = null)

View File

@ -19,7 +19,6 @@ namespace Kyoo.Tests.Database
} }
} }
namespace PostgreSQL namespace PostgreSQL
{ {
[Collection(nameof(Postgresql))] [Collection(nameof(Postgresql))]
@ -127,7 +126,6 @@ namespace Kyoo.Tests.Database
Assert.Equal($"new-slug-3", episode.Slug); Assert.Equal($"new-slug-3", episode.Slug);
} }
[Fact] [Fact]
public async Task AbsoluteNumberEditTest() public async Task AbsoluteNumberEditTest()
{ {

View File

@ -16,7 +16,6 @@ namespace Kyoo.Tests.Database
} }
} }
namespace PostgreSQL namespace PostgreSQL
{ {
[Collection(nameof(Postgresql))] [Collection(nameof(Postgresql))]

View File

@ -19,7 +19,6 @@ namespace Kyoo.Tests.Database
} }
} }
namespace PostgreSQL namespace PostgreSQL
{ {
[Collection(nameof(Postgresql))] [Collection(nameof(Postgresql))]

View File

@ -15,7 +15,6 @@ namespace Kyoo.Tests.Database
} }
} }
namespace PostgreSQL namespace PostgreSQL
{ {
[Collection(nameof(Postgresql))] [Collection(nameof(Postgresql))]

View File

@ -163,7 +163,6 @@ namespace Kyoo.Tests
} }
} }
/// <summary> /// <summary>
/// Class responsible to fill and create in memory databases for unit tests. /// Class responsible to fill and create in memory databases for unit tests.
/// </summary> /// </summary>

View File

@ -122,7 +122,6 @@ namespace Kyoo.Tests
} }
}; };
private static readonly Dictionary<Type, Func<object>> Samples = new() private static readonly Dictionary<Type, Func<object>> Samples = new()
{ {
{ {

View File

@ -36,7 +36,6 @@ namespace Kyoo.Tests.Identifier
_identifier = new RegexIdentifier(options.Object, _manager.Object); _identifier = new RegexIdentifier(options.Object, _manager.Object);
} }
[Fact] [Fact]
public async Task EpisodeIdentification() public async Task EpisodeIdentification()
{ {