CodingStyle: Removing trailing spaces

This commit is contained in:
Zoe Roux 2021-09-05 11:18:10 +02:00
parent af285a7c6c
commit ad0235307f
24 changed files with 40 additions and 65 deletions

View File

@ -625,6 +625,7 @@ namespace Kyoo.Abstractions.Controllers
/// <param name="where">A predicate to add arbitrary filter</param> /// <param name="where">A predicate to add arbitrary filter</param>
/// <param name="sort">A sort by expression</param> /// <param name="sort">A sort by expression</param>
/// <param name="limit">Pagination information (where to start and how many to get)</param> /// <param name="limit">Pagination information (where to start and how many to get)</param>
/// <typeparam name="T">The type of metadata to retrieve</typeparam>
/// <returns>A filtered list of external ids.</returns> /// <returns>A filtered list of external ids.</returns>
Task<ICollection<MetadataID>> GetMetadataID<T>([Optional] Expression<Func<MetadataID, bool>> where, Task<ICollection<MetadataID>> GetMetadataID<T>([Optional] Expression<Func<MetadataID, bool>> where,
Expression<Func<MetadataID, object>> sort, Expression<Func<MetadataID, object>> sort,

View File

@ -1,9 +1,8 @@
using System; using System;
using Kyoo.Abstractions.Controllers; using Kyoo.Abstractions.Controllers;
namespace Kyoo.Abstractions.Models.Attributes namespace Kyoo.Abstractions.Models.Attributes
{ {
/// <summary> /// <summary>
/// The targeted relation can be loaded via a call to <see cref="ILibraryManager.Load"/>. /// The targeted relation can be loaded via a call to <see cref="ILibraryManager.Load"/>.
/// </summary> /// </summary>

View File

@ -3,7 +3,7 @@ using System;
namespace Kyoo.Abstractions.Models.Attributes namespace Kyoo.Abstractions.Models.Attributes
{ {
/// <summary> /// <summary>
/// Remove an property from the serialization pipeline. It will simply be skipped. /// Remove an property from the serialization pipeline. It will simply be skipped.
/// </summary> /// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class SerializeIgnoreAttribute : Attribute { } public class SerializeIgnoreAttribute : Attribute { }

View File

@ -34,7 +34,7 @@ namespace Kyoo.Abstractions.Models.Exceptions
{ } { }
/// <summary> /// <summary>
/// The serialization constructor /// The serialization constructor
/// </summary> /// </summary>
/// <param name="info">Serialization infos</param> /// <param name="info">Serialization infos</param>
/// <param name="context">The serialization context</param> /// <param name="context">The serialization context</param>

View File

@ -26,7 +26,7 @@ namespace Kyoo.Abstractions.Models
public static class MetadataExtension public static class MetadataExtension
{ {
/// <summary> /// <summary>
/// Retrieve the internal provider's ID of an item using it's provider slug. /// Retrieve the internal provider's ID of an item using it's provider slug.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// This method will never return anything if the <see cref="IMetadata.ExternalIDs"/> are not loaded. /// This method will never return anything if the <see cref="IMetadata.ExternalIDs"/> are not loaded.

View File

@ -12,7 +12,7 @@ namespace Kyoo.Abstractions.Models
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// You don't need to specify an ID manually when creating a new resource, /// You don't need to specify an ID manually when creating a new resource,
/// this field is automatically assigned by the <see cref="IRepository{T}"/>. /// this field is automatically assigned by the <see cref="IRepository{T}"/>.
/// </remarks> /// </remarks>
public int ID { get; set; } public int ID { get; set; }

View File

@ -5,7 +5,7 @@ using Kyoo.Abstractions.Models.Attributes;
namespace Kyoo.Abstractions.Models namespace Kyoo.Abstractions.Models
{ {
/// <summary> /// <summary>
/// An actor, voice actor, writer, animator, somebody who worked on a <see cref="Show"/>. /// An actor, voice actor, writer, animator, somebody who worked on a <see cref="Show"/>.
/// </summary> /// </summary>
public class People : IResource, IMetadata, IThumbnails public class People : IResource, IMetadata, IThumbnails
{ {

View File

@ -47,7 +47,7 @@ namespace Kyoo.Abstractions.Models
/// <summary> /// <summary>
/// Create a new <see cref="Provider"/> and specify it's <see cref="Name"/>. /// Create a new <see cref="Provider"/> and specify it's <see cref="Name"/>.
/// The <see cref="Slug"/> is automatically calculated from it's name. /// The <see cref="Slug"/> is automatically calculated from it's name.
/// </summary> /// </summary>
/// <param name="name">The name of this provider.</param> /// <param name="name">The name of this provider.</param>
/// <param name="logo">The logo of this provider.</param> /// <param name="logo">The logo of this provider.</param>

View File

@ -8,7 +8,7 @@ using Kyoo.Abstractions.Models.Attributes;
namespace Kyoo.Abstractions.Models namespace Kyoo.Abstractions.Models
{ {
/// <summary> /// <summary>
/// A season of a <see cref="Show"/>. /// A season of a <see cref="Show"/>.
/// </summary> /// </summary>
public class Season : IResource, IMetadata, IThumbnails public class Season : IResource, IMetadata, IThumbnails
{ {
@ -24,9 +24,10 @@ namespace Kyoo.Abstractions.Models
return $"{ShowID}-s{SeasonNumber}"; return $"{ShowID}-s{SeasonNumber}";
return $"{ShowSlug ?? Show?.Slug}-s{SeasonNumber}"; return $"{ShowSlug ?? Show?.Slug}-s{SeasonNumber}";
} }
[UsedImplicitly] [NotNull] private set [UsedImplicitly] [NotNull] private set
{ {
Match match = Regex.Match(value ?? "", @"(?<show>.+)-s(?<season>\d+)"); Match match = Regex.Match(value ?? string.Empty, @"(?<show>.+)-s(?<season>\d+)");
if (!match.Success) if (!match.Success)
throw new ArgumentException("Invalid season slug. Format: {showSlug}-s{seasonNumber}"); throw new ArgumentException("Invalid season slug. Format: {showSlug}-s{seasonNumber}");

View File

@ -51,30 +51,4 @@ namespace Kyoo.Abstractions.Models
/// </summary> /// </summary>
public ICollection<WatchedEpisode> CurrentlyWatching { get; set; } public ICollection<WatchedEpisode> CurrentlyWatching { get; set; }
} }
/// <summary>
/// Metadata of episode currently watching by an user
/// </summary>
public class WatchedEpisode
{
/// <summary>
/// The ID of the user that started watching this episode.
/// </summary>
public int UserID { get; set; }
/// <summary>
/// The ID of the episode started.
/// </summary>
public int EpisodeID { get; set; }
/// <summary>
/// The <see cref="Episode"/> started.
/// </summary>
public Episode Episode { get; set; }
/// <summary>
/// Where the player has stopped watching the episode (between 0 and 100).
/// </summary>
public int WatchedPercentage { get; set; }
}
} }

View File

@ -45,7 +45,7 @@ namespace Kyoo.Utils
/// <summary> /// <summary>
/// A map where the mapping function is asynchronous. /// A map where the mapping function is asynchronous.
/// Note: <see cref="SelectAsync{T,T2}"/> might interest you. /// Note: <see cref="SelectAsync{T,T2}"/> might interest you.
/// </summary> /// </summary>
/// <param name="self">The IEnumerable to map.</param> /// <param name="self">The IEnumerable to map.</param>
/// <param name="mapper">The asynchronous function that will map each items</param> /// <param name="mapper">The asynchronous function that will map each items</param>

View File

@ -23,7 +23,7 @@ namespace Kyoo.Authentication
{ {
/// <summary> /// <summary>
/// Add the certificate file to the identity server. If the certificate will expire soon, automatically renew it. /// Add the certificate file to the identity server. If the certificate will expire soon, automatically renew it.
/// If no certificate exists, one is generated. /// If no certificate exists, one is generated.
/// </summary> /// </summary>
/// <param name="builder">The identity server that will be modified.</param> /// <param name="builder">The identity server that will be modified.</param>
/// <param name="options">The certificate options</param> /// <param name="options">The certificate options</param>

View File

@ -17,7 +17,7 @@ namespace Kyoo.Authentication.Models.DTO
public string Email { get; set; } public string Email { get; set; }
/// <summary> /// <summary>
/// The user's username. /// The user's username.
/// </summary> /// </summary>
[MinLength(4, ErrorMessage = "The username must have at least {1} characters")] [MinLength(4, ErrorMessage = "The username must have at least {1} characters")]
public string Username { get; set; } public string Username { get; set; }

View File

@ -21,7 +21,7 @@ namespace Kyoo.Authentication.Models
public PermissionOption Permissions { get; set; } public PermissionOption Permissions { get; set; }
/// <summary> /// <summary>
/// Root path of user's profile pictures. /// Root path of user's profile pictures.
/// </summary> /// </summary>
public string ProfilePicturePath { get; set; } public string ProfilePicturePath { get; set; }
} }

View File

@ -60,7 +60,7 @@ namespace Kyoo.Authentication.Views
} }
/// <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>
/// <param name="request">The DTO register request</param> /// <param name="request">The DTO register request</param>
/// <returns>A OTAC to connect to this new account</returns> /// <returns>A OTAC to connect to this new account</returns>

View File

@ -29,7 +29,7 @@ namespace Kyoo.Core.Controllers
private readonly IOptions<BasicOptions> _options; private readonly IOptions<BasicOptions> _options;
/// <summary> /// <summary>
/// The logger used by this class. /// The logger used by this class.
/// </summary> /// </summary>
private readonly ILogger<PluginManager> _logger; private readonly ILogger<PluginManager> _logger;

View File

@ -55,7 +55,7 @@ namespace Kyoo.Core.Controllers
public ManagedTask Task { get; init; } public ManagedTask Task { get; init; }
/// <summary> /// <summary>
/// The progress reporter that this task should use. /// The progress reporter that this task should use.
/// </summary> /// </summary>
public IProgress<float> ProgressReporter { get; init; } public IProgress<float> ProgressReporter { get; init; }

View File

@ -31,7 +31,7 @@ namespace Kyoo.Core.Models.Watch
[MarshalAs(UnmanagedType.I1)] public bool IsDefault; [MarshalAs(UnmanagedType.I1)] public bool IsDefault;
/// <summary> /// <summary>
/// Is this stream tagged as forced? /// Is this stream tagged as forced?
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.I1)] public bool IsForced; [MarshalAs(UnmanagedType.I1)] public bool IsForced;

View File

@ -24,12 +24,12 @@ namespace Kyoo.Core.Tasks
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
/// <summary> /// <summary>
/// The file manager used walk inside directories and check they existences. /// The file manager used walk inside directories and check they existences.
/// </summary> /// </summary>
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
/// <summary> /// <summary>
/// A task manager used to create sub tasks for each episode to add to the database. /// A task manager used to create sub tasks for each episode to add to the database.
/// </summary> /// </summary>
private readonly ITaskManager _taskManager; private readonly ITaskManager _taskManager;
@ -117,7 +117,7 @@ namespace Kyoo.Core.Tasks
// We try to group episodes by shows to register one episode of each show first. // We try to group episodes by shows to register one episode of each show first.
// This speeds up the scan process because further episodes of a show are registered when all metadata // This speeds up the scan process because further episodes of a show are registered when all metadata
// of the show has already been fetched. // of the show has already been fetched.
List<IGrouping<string, string>> shows = files List<IGrouping<string, string>> shows = files
.Where(FileExtensions.IsVideo) .Where(FileExtensions.IsVideo)
.Where(x => episodes.All(y => y.Path != x)) .Where(x => episodes.All(y => y.Path != x))

View File

@ -22,7 +22,7 @@
// private ILibraryManager _library; // private ILibraryManager _library;
// private IThumbnailsManager _thumbnails; // private IThumbnailsManager _thumbnails;
// private ITranscoder _transcoder; // private ITranscoder _transcoder;
// //
// public async Task Run(IServiceProvider serviceProvider, CancellationToken token, string arguments = null) // public async Task Run(IServiceProvider serviceProvider, CancellationToken token, string arguments = null)
// { // {
// string[] args = arguments?.Split('/'); // string[] args = arguments?.Split('/');
@ -33,13 +33,13 @@
// string slug = args[1]; // string slug = args[1];
// bool thumbs = args.Length < 3 || string.Equals(args[2], "thumbnails", StringComparison.InvariantCultureIgnoreCase); // bool thumbs = args.Length < 3 || string.Equals(args[2], "thumbnails", StringComparison.InvariantCultureIgnoreCase);
// bool subs = args.Length < 3 || string.Equals(args[2], "subs", StringComparison.InvariantCultureIgnoreCase); // bool subs = args.Length < 3 || string.Equals(args[2], "subs", StringComparison.InvariantCultureIgnoreCase);
// //
// using IServiceScope serviceScope = serviceProvider.CreateScope(); // using IServiceScope serviceScope = serviceProvider.CreateScope();
// _library = serviceScope.ServiceProvider.GetService<ILibraryManager>(); // _library = serviceScope.ServiceProvider.GetService<ILibraryManager>();
// _thumbnails = serviceScope.ServiceProvider.GetService<IThumbnailsManager>(); // _thumbnails = serviceScope.ServiceProvider.GetService<IThumbnailsManager>();
// _transcoder = serviceScope.ServiceProvider.GetService<ITranscoder>(); // _transcoder = serviceScope.ServiceProvider.GetService<ITranscoder>();
// int id; // int id;
// //
// switch (args[0].ToLowerInvariant()) // switch (args[0].ToLowerInvariant())
// { // {
// case "show": // case "show":
@ -51,15 +51,15 @@
// break; // break;
// case "season": // case "season":
// case "seasons": // case "seasons":
// Season season = await (int.TryParse(slug, out id) // Season season = await (int.TryParse(slug, out id)
// ? _library!.Get<Season>(id) // ? _library!.Get<Season>(id)
// : _library!.Get<Season>(slug)); // : _library!.Get<Season>(slug));
// await ExtractSeason(season, thumbs, subs, token); // await ExtractSeason(season, thumbs, subs, token);
// break; // break;
// case "episode": // case "episode":
// case "episodes": // case "episodes":
// Episode episode = await (int.TryParse(slug, out id) // Episode episode = await (int.TryParse(slug, out id)
// ? _library!.Get<Episode>(id) // ? _library!.Get<Episode>(id)
// : _library!.Get<Episode>(slug)); // : _library!.Get<Episode>(slug));
// await ExtractEpisode(episode, thumbs, subs); // await ExtractEpisode(episode, thumbs, subs);
// break; // break;
@ -91,7 +91,7 @@
// await ExtractEpisode(episode, thumbs, subs); // await ExtractEpisode(episode, thumbs, subs);
// } // }
// } // }
// //
// private async Task ExtractEpisode(Episode episode, bool thumbs, bool subs) // private async Task ExtractEpisode(Episode episode, bool thumbs, bool subs)
// { // {
// if (thumbs) // if (thumbs)
@ -106,7 +106,7 @@
// await _library.Edit(episode, false); // await _library.Edit(episode, false);
// } // }
// } // }
// //
// public Task<IEnumerable<string>> GetPossibleParameters() // public Task<IEnumerable<string>> GetPossibleParameters()
// { // {
// return Task.FromResult<IEnumerable<string>>(null); // return Task.FromResult<IEnumerable<string>>(null);

View File

@ -20,12 +20,12 @@ namespace Kyoo.Core.Tasks
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
/// <summary> /// <summary>
/// The file manager used walk inside directories and check they existences. /// The file manager used walk inside directories and check they existences.
/// </summary> /// </summary>
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
/// <summary> /// <summary>
/// The logger used to inform the user that episodes has been removed. /// The logger used to inform the user that episodes has been removed.
/// </summary> /// </summary>
private readonly ILogger<Housekeeping> _logger; private readonly ILogger<Housekeeping> _logger;

View File

@ -16,7 +16,7 @@ namespace Kyoo.Core.Tasks
public class MetadataProviderLoader : ITask public class MetadataProviderLoader : ITask
{ {
/// <summary> /// <summary>
/// The provider repository used to create in-db providers from metadata providers. /// The provider repository used to create in-db providers from metadata providers.
/// </summary> /// </summary>
private readonly IProviderRepository _providers; private readonly IProviderRepository _providers;

View File

@ -17,8 +17,8 @@
// public string HelpMessage => null; // public string HelpMessage => null;
// public bool RunOnStartup => false; // public bool RunOnStartup => false;
// public int Priority => 0; // public int Priority => 0;
// //
// //
// private IServiceProvider _serviceProvider; // private IServiceProvider _serviceProvider;
// private IThumbnailsManager _thumbnailsManager; // private IThumbnailsManager _thumbnailsManager;
// private IProviderManager _providerManager; // private IProviderManager _providerManager;
@ -31,7 +31,7 @@
// _thumbnailsManager = serviceProvider.GetService<IThumbnailsManager>(); // _thumbnailsManager = serviceProvider.GetService<IThumbnailsManager>();
// _providerManager = serviceProvider.GetService<IProviderManager>(); // _providerManager = serviceProvider.GetService<IProviderManager>();
// _database = serviceScope.ServiceProvider.GetService<DatabaseContext>(); // _database = serviceScope.ServiceProvider.GetService<DatabaseContext>();
// //
// if (arguments == null || !arguments.Contains('/')) // if (arguments == null || !arguments.Contains('/'))
// return; // return;
// //
@ -50,7 +50,7 @@
// private async Task ReScanShow(string slug) // private async Task ReScanShow(string slug)
// { // {
// Show old; // Show old;
// //
// using (IServiceScope serviceScope = _serviceProvider.CreateScope()) // using (IServiceScope serviceScope = _serviceProvider.CreateScope())
// { // {
// ILibraryManager libraryManager = serviceScope.ServiceProvider.GetService<ILibraryManager>(); // ILibraryManager libraryManager = serviceScope.ServiceProvider.GetService<ILibraryManager>();
@ -71,7 +71,7 @@
// if (orphans.Any()) // if (orphans.Any())
// await Task.WhenAll(orphans.Select(x => ReScanEpisode(old, x))); // await Task.WhenAll(orphans.Select(x => ReScanEpisode(old, x)));
// } // }
// //
// private async Task ReScanSeason(string seasonSlug) // private async Task ReScanSeason(string seasonSlug)
// { // {
// string[] infos = seasonSlug.Split('-'); // string[] infos = seasonSlug.Split('-');

View File

@ -11,7 +11,7 @@ namespace Kyoo.TheTvdb.Models
public const string Path = "tvdb"; public const string Path = "tvdb";
/// <summary> /// <summary>
/// The api key of the tvdb. /// The api key of the tvdb.
/// </summary> /// </summary>
public string ApiKey { get; set; } public string ApiKey { get; set; }
} }