mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
CodingStlye: Fixing most issues with the documentation
This commit is contained in:
parent
2bb40874b3
commit
5ab8e6ee4e
@ -15,6 +15,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>CS1591;SA1601</NoWarn>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Kyoo.ruleset</CodeAnalysisRuleSet>
|
||||
<!-- <AnalysisMode>AllEnabledByDefault</AnalysisMode>-->
|
||||
|
@ -29,7 +29,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
ILibraryRepository LibraryRepository { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The repository that handle libraries items (a wrapper around shows & collections).
|
||||
/// The repository that handle libraries items (a wrapper around shows and collections).
|
||||
/// </summary>
|
||||
ILibraryItemRepository LibraryItemRepository { get; }
|
||||
|
||||
@ -236,7 +236,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </param>
|
||||
/// <typeparam name="T">The type of the source object</typeparam>
|
||||
/// <typeparam name="T2">The related resource's type</typeparam>
|
||||
/// <returns>The param <see cref="obj"/></returns>
|
||||
/// <returns>The param <paramref name="obj"/></returns>
|
||||
/// <seealso cref="Load{T,T2}(T, System.Linq.Expressions.Expression{System.Func{T,System.Collections.Generic.ICollection{T2}}}, bool)"/>
|
||||
/// <seealso cref="Load{T}(T, string, bool)"/>
|
||||
/// <seealso cref="Load(IResource, string, bool)"/>
|
||||
@ -254,7 +254,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </param>
|
||||
/// <typeparam name="T">The type of the source object</typeparam>
|
||||
/// <typeparam name="T2">The related resource's type</typeparam>
|
||||
/// <returns>The param <see cref="obj"/></returns>
|
||||
/// <returns>The param <paramref name="obj"/></returns>
|
||||
/// <seealso cref="Load{T,T2}(T, System.Linq.Expressions.Expression{System.Func{T,T2}}, bool)"/>
|
||||
/// <seealso cref="Load{T}(T, string, bool)"/>
|
||||
/// <seealso cref="Load(IResource, string, bool)"/>
|
||||
@ -271,7 +271,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// <c>true</c> if you want to load the relation even if it is not null, <c>false</c> otherwise.
|
||||
/// </param>
|
||||
/// <typeparam name="T">The type of the source object</typeparam>
|
||||
/// <returns>The param <see cref="obj"/></returns>
|
||||
/// <returns>The param <paramref name="obj"/></returns>
|
||||
/// <seealso cref="Load{T,T2}(T, System.Linq.Expressions.Expression{System.Func{T,T2}}, bool)"/>
|
||||
/// <seealso cref="Load{T,T2}(T, System.Linq.Expressions.Expression{System.Func{T,System.Collections.Generic.ICollection{T2}}}, bool)"/>
|
||||
/// <seealso cref="Load(IResource, string, bool)"/>
|
||||
@ -297,7 +297,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="id">The ID of the library</param>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <returns>A list of items that match every filters</returns>
|
||||
Task<ICollection<LibraryItem>> GetItemsFromLibrary(int id,
|
||||
@ -324,7 +324,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="slug">The slug of the library</param>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <returns>A list of items that match every filters</returns>
|
||||
Task<ICollection<LibraryItem>> GetItemsFromLibrary(string slug,
|
||||
@ -351,7 +351,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="showID">The ID of the show</param>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <returns>A list of items that match every filters</returns>
|
||||
Task<ICollection<PeopleRole>> GetPeopleFromShow(int showID,
|
||||
@ -378,7 +378,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="showSlug">The slug of the show</param>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <returns>A list of items that match every filters</returns>
|
||||
Task<ICollection<PeopleRole>> GetPeopleFromShow(string showSlug,
|
||||
@ -405,7 +405,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="id">The id of the person</param>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <returns>A list of items that match every filters</returns>
|
||||
Task<ICollection<PeopleRole>> GetRolesFromPeople(int id,
|
||||
@ -432,7 +432,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="slug">The slug of the person</param>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <returns>A list of items that match every filters</returns>
|
||||
Task<ICollection<PeopleRole>> GetRolesFromPeople(string slug,
|
||||
@ -476,7 +476,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// Get all resources with filters
|
||||
/// </summary>
|
||||
/// <param name="where">A filter function</param>
|
||||
/// <param name="sort">Sort information (sort order & sort by)</param>
|
||||
/// <param name="sort">Sort information (sort order and sort by)</param>
|
||||
/// <param name="limit">How many items to return and where to start</param>
|
||||
/// <typeparam name="T">The type of resources to load</typeparam>
|
||||
/// <returns>A list of resources that match every filters</returns>
|
||||
@ -524,7 +524,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// </summary>
|
||||
/// <param name="item">The item to register</param>
|
||||
/// <typeparam name="T">The type of resource</typeparam>
|
||||
/// <returns>The resource registers and completed by database's information (related items & so on)</returns>
|
||||
/// <returns>The resource registers and completed by database's information (related items and so on)</returns>
|
||||
Task<T> Create<T>([NotNull] T item)
|
||||
where T : class, IResource;
|
||||
|
||||
@ -544,7 +544,7 @@ namespace Kyoo.Abstractions.Controllers
|
||||
/// <param name="resetOld">Should old properties of the resource be discarded or should null values considered as not changed?</param>
|
||||
/// <typeparam name="T">The type of resources</typeparam>
|
||||
/// <exception cref="ItemNotFoundException">If the item is not found</exception>
|
||||
/// <returns>The resource edited and completed by database's information (related items & so on)</returns>
|
||||
/// <returns>The resource edited and completed by database's information (related items and so on)</returns>
|
||||
Task<T> Edit<T>(T item, bool resetOld)
|
||||
where T : class, IResource;
|
||||
|
||||
|
@ -135,7 +135,7 @@ namespace Kyoo.Abstractions.Models
|
||||
/// </summary>
|
||||
/// <param name="ep">The episode to transform.</param>
|
||||
/// <param name="library">
|
||||
/// A library manager to retrieve the next and previous episode and load the show & tracks of the episode.
|
||||
/// A library manager to retrieve the next and previous episode and load the show and tracks of the episode.
|
||||
/// </param>
|
||||
/// <returns>A new WatchItem representing the given episode.</returns>
|
||||
public static async Task<WatchItem> FromEpisode(Episode ep, ILibraryManager library)
|
||||
|
@ -16,7 +16,7 @@ namespace Kyoo.Utils
|
||||
/// </summary>
|
||||
/// <param name="self">The IEnumerable to map. If self is null, an empty list is returned</param>
|
||||
/// <param name="mapper">The function that will map each items</param>
|
||||
/// <typeparam name="T">The type of items in <see cref="self"/></typeparam>
|
||||
/// <typeparam name="T">The type of items in <paramref name="self"/></typeparam>
|
||||
/// <typeparam name="T2">The type of items in the returned list</typeparam>
|
||||
/// <returns>The list mapped.</returns>
|
||||
/// <exception cref="ArgumentNullException">The list or the mapper can't be null</exception>
|
||||
@ -48,11 +48,11 @@ namespace Kyoo.Utils
|
||||
/// Note: <see cref="SelectAsync{T,T2}"/> might interest you.
|
||||
/// </summary>
|
||||
/// <param name="self">The IEnumerable to map.</param>
|
||||
/// <param name="mapper">The asynchronous function that will map each items</param>
|
||||
/// <typeparam name="T">The type of items in <see cref="self"/></typeparam>
|
||||
/// <typeparam name="T2">The type of items in the returned list</typeparam>
|
||||
/// <returns>The list mapped as an AsyncEnumerable</returns>
|
||||
/// <exception cref="ArgumentNullException">The list or the mapper can't be null</exception>
|
||||
/// <param name="mapper">The asynchronous function that will map each items.</param>
|
||||
/// <typeparam name="T">The type of items in <paramref name="self"/>.</typeparam>
|
||||
/// <typeparam name="T2">The type of items in the returned list.</typeparam>
|
||||
/// <returns>The list mapped as an AsyncEnumerable.</returns>
|
||||
/// <exception cref="ArgumentNullException">The list or the mapper can't be null.</exception>
|
||||
[LinqTunnel]
|
||||
public static IAsyncEnumerable<T2> MapAsync<T, T2>([NotNull] this IEnumerable<T> self,
|
||||
[NotNull] Func<T, int, Task<T2>> mapper)
|
||||
@ -82,7 +82,7 @@ namespace Kyoo.Utils
|
||||
/// </summary>
|
||||
/// <param name="self">The IEnumerable to map</param>
|
||||
/// <param name="mapper">The asynchronous function that will map each items</param>
|
||||
/// <typeparam name="T">The type of items in <see cref="self"/></typeparam>
|
||||
/// <typeparam name="T">The type of items in <paramref name="self"/></typeparam>
|
||||
/// <typeparam name="T2">The type of items in the returned list</typeparam>
|
||||
/// <returns>The list mapped as an AsyncEnumerable</returns>
|
||||
/// <exception cref="ArgumentNullException">The list or the mapper can't be null</exception>
|
||||
@ -198,6 +198,7 @@ namespace Kyoo.Utils
|
||||
/// </summary>
|
||||
/// <param name="self">The list to enumerate. If this is null, the function result in a no-op</param>
|
||||
/// <param name="action">The action to execute for each arguments</param>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
public static async Task ForEachAsync([CanBeNull] this IEnumerable self, Func<object, Task> action)
|
||||
{
|
||||
if (self == null)
|
||||
@ -212,6 +213,7 @@ namespace Kyoo.Utils
|
||||
/// <param name="self">The list to enumerate. If this is null, the function result in a no-op</param>
|
||||
/// <param name="action">The asynchronous action to execute for each arguments</param>
|
||||
/// <typeparam name="T">The type of items in the list.</typeparam>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
public static async Task ForEachAsync<T>([CanBeNull] this IEnumerable<T> self, Func<T, Task> action)
|
||||
{
|
||||
if (self == null)
|
||||
@ -226,6 +228,7 @@ namespace Kyoo.Utils
|
||||
/// <param name="self">The async list to enumerate. If this is null, the function result in a no-op</param>
|
||||
/// <param name="action">The action to execute for each arguments</param>
|
||||
/// <typeparam name="T">The type of items in the list.</typeparam>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
public static async Task ForEachAsync<T>([CanBeNull] this IAsyncEnumerable<T> self, Action<T> action)
|
||||
{
|
||||
if (self == null)
|
||||
|
@ -146,7 +146,7 @@ namespace Kyoo.Utils
|
||||
/// <param name="first">The object to assign</param>
|
||||
/// <param name="second">The object containing new values</param>
|
||||
/// <typeparam name="T">Fields of T will be used</typeparam>
|
||||
/// <returns><see cref="first"/></returns>
|
||||
/// <returns><paramref name="first"/></returns>
|
||||
public static T Assign<T>(T first, T second)
|
||||
{
|
||||
Type type = typeof(T);
|
||||
@ -189,7 +189,7 @@ namespace Kyoo.Utils
|
||||
/// Filter fields that will be merged
|
||||
/// </param>
|
||||
/// <typeparam name="T">Fields of T will be completed</typeparam>
|
||||
/// <returns><see cref="first"/></returns>
|
||||
/// <returns><paramref name="first"/></returns>
|
||||
/// <exception cref="ArgumentNullException">If first is null</exception>
|
||||
public static T Complete<T>([NotNull] T first,
|
||||
[CanBeNull] T second,
|
||||
@ -244,7 +244,7 @@ namespace Kyoo.Utils
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This will set missing values of <see cref="first"/> to the corresponding values of <see cref="second"/>.
|
||||
/// This will set missing values of <paramref name="first"/> to the corresponding values of <paramref name="second"/>.
|
||||
/// Enumerable will be merged (concatenated) and Dictionaries too.
|
||||
/// At the end, the OnMerge method of first will be called if first is a <see cref="IOnMerge"/>.
|
||||
/// </summary>
|
||||
@ -261,7 +261,7 @@ namespace Kyoo.Utils
|
||||
/// Filter fields that will be merged
|
||||
/// </param>
|
||||
/// <typeparam name="T">Fields of T will be merged</typeparam>
|
||||
/// <returns><see cref="first"/></returns>
|
||||
/// <returns><paramref name="first"/></returns>
|
||||
[ContractAnnotation("first:notnull => notnull; second:notnull => notnull", true)]
|
||||
public static T Merge<T>([CanBeNull] T first,
|
||||
[CanBeNull] T second,
|
||||
@ -329,11 +329,11 @@ namespace Kyoo.Utils
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set every fields of <see cref="obj"/> to the default value.
|
||||
/// Set every fields of <paramref name="obj"/> to the default value.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to nullify</param>
|
||||
/// <typeparam name="T">Fields of T will be nullified</typeparam>
|
||||
/// <returns><see cref="obj"/></returns>
|
||||
/// <returns><paramref name="obj"/></returns>
|
||||
public static T Nullify<T>(T obj)
|
||||
{
|
||||
Type type = typeof(T);
|
||||
|
@ -22,6 +22,7 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The first parameter of the action.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T>(Action<T> action)
|
||||
{
|
||||
@ -32,6 +33,8 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The first parameter of the action.</typeparam>
|
||||
/// <typeparam name="T2">The second parameter of the action.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T, T2>(Action<T, T2> action)
|
||||
{
|
||||
@ -42,6 +45,9 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The first parameter of the action.</typeparam>
|
||||
/// <typeparam name="T2">The second parameter of the action.</typeparam>
|
||||
/// <typeparam name="T3">The third parameter of the action.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T, T2, T3>(Action<T, T2, T3> action)
|
||||
{
|
||||
@ -52,6 +58,7 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The return type of function.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T>(Func<T> action)
|
||||
{
|
||||
@ -62,6 +69,8 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The first parameter of the function.</typeparam>
|
||||
/// <typeparam name="T2">The return type of function.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T, T2>(Func<T, T2> action)
|
||||
{
|
||||
@ -72,6 +81,9 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The first parameter of the function.</typeparam>
|
||||
/// <typeparam name="T2">The second parameter of the function.</typeparam>
|
||||
/// <typeparam name="T3">The return type of function.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T, T2, T3>(Func<T, T2, T3> action)
|
||||
{
|
||||
@ -82,6 +94,10 @@ namespace Kyoo.Utils
|
||||
/// Get a MethodInfo from a direct method.
|
||||
/// </summary>
|
||||
/// <param name="action">The method (without any arguments or return value.</param>
|
||||
/// <typeparam name="T">The first parameter of the function.</typeparam>
|
||||
/// <typeparam name="T2">The second parameter of the function.</typeparam>
|
||||
/// <typeparam name="T3">The third parameter of the function.</typeparam>
|
||||
/// <typeparam name="T4">The return type of function.</typeparam>
|
||||
/// <returns>The <see cref="MethodInfo"/> of the given method</returns>
|
||||
public static MethodInfo MethodOf<T, T2, T3, T4>(Func<T, T2, T3, T4> action)
|
||||
{
|
||||
|
@ -18,7 +18,6 @@ namespace Kyoo.Utils
|
||||
/// </param>
|
||||
/// <typeparam name="T">The type of the item in the task.</typeparam>
|
||||
/// <returns>A continuation task wrapping the initial task and adding a continuation method.</returns>
|
||||
/// <exception cref="TaskCanceledException"></exception>
|
||||
/// <exception cref="TaskCanceledException">The source task has been canceled.</exception>
|
||||
public static Task<T> Then<T>(this Task<T> task, Action<T> then)
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ namespace Kyoo.Authentication
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a new certificate key and put it in the file at <see cref="file"/>.
|
||||
/// Generate a new certificate key and put it in the file at <paramref name="file"/>.
|
||||
/// </summary>
|
||||
/// <param name="file">The path of the output file</param>
|
||||
/// <param name="password">The password of the new certificate</param>
|
||||
|
@ -30,11 +30,11 @@ namespace Kyoo.Authentication
|
||||
/// <summary>
|
||||
/// Convert a user to an <see cref="IdentityServerUser"/>.
|
||||
/// </summary>
|
||||
/// <param name="user">The user to convert</param>
|
||||
/// <param name="user">The user to convert.</param>
|
||||
/// <returns>The corresponding identity server user.</returns>
|
||||
public static IdentityServerUser ToIdentityUser(this User user)
|
||||
{
|
||||
return new(user.ID.ToString())
|
||||
return new IdentityServerUser(user.ID.ToString())
|
||||
{
|
||||
DisplayName = user.Username,
|
||||
AdditionalClaims = new[] { new Claim("permissions", string.Join(',', user.Permissions)) }
|
||||
|
@ -31,7 +31,7 @@ namespace Kyoo.Authentication.Models.DTO
|
||||
/// <summary>
|
||||
/// Convert this register request to a new <see cref="User"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <returns>A user representing this request.</returns>
|
||||
public User ToUser()
|
||||
{
|
||||
return new User
|
||||
|
@ -168,7 +168,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// </summary>
|
||||
/// <param name="config">The configuration to transform</param>
|
||||
/// <returns>A strongly typed representation of the configuration.</returns>
|
||||
[SuppressMessage("ReSharper", "RedundantJumpStatement")]
|
||||
[SuppressMessage("ReSharper", "RedundantJumpStatement", Justification = "A catch block should not be empty.")]
|
||||
private ExpandoObject _ToObject(IConfiguration config)
|
||||
{
|
||||
ExpandoObject obj = new();
|
||||
|
@ -142,7 +142,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// Set track's index and ensure that every tracks is well-formed.
|
||||
/// </summary>
|
||||
/// <param name="resource">The resource to fix.</param>
|
||||
/// <returns>The <see cref="resource"/> parameter is returned.</returns>
|
||||
/// <returns>The <paramref name="resource"/> parameter is returned.</returns>
|
||||
private async Task<Episode> _ValidateTracks(Episode resource)
|
||||
{
|
||||
if (resource.Tracks == null)
|
||||
|
@ -106,7 +106,7 @@ namespace Kyoo.Core.Controllers
|
||||
=> throw new InvalidOperationException();
|
||||
|
||||
/// <summary>
|
||||
/// Get a basic queryable for a library with the right mapping from shows & collections.
|
||||
/// Get a basic queryable for a library with the right mapping from shows and collections.
|
||||
/// Shows contained in a collection are excluded.
|
||||
/// </summary>
|
||||
/// <param name="selector">Only items that are part of a library that match this predicate will be returned.</param>
|
||||
|
@ -34,7 +34,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// <summary>
|
||||
/// Create a new base <see cref="LocalRepository{T}"/> with the given database handle.
|
||||
/// </summary>
|
||||
/// <param name="database">A database connection to load resources of type <see cref="T"/></param>
|
||||
/// <param name="database">A database connection to load resources of type <typeparamref name="T"/></param>
|
||||
protected LocalRepository(DbContext database)
|
||||
{
|
||||
Database = database;
|
||||
@ -114,11 +114,11 @@ namespace Kyoo.Core.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply filters to a query to ease sort, pagination & where queries for resources of this repository
|
||||
/// Apply filters to a query to ease sort, pagination and where queries for resources of this repository
|
||||
/// </summary>
|
||||
/// <param name="query">The base query to filter.</param>
|
||||
/// <param name="where">An expression to filter based on arbitrary conditions</param>
|
||||
/// <param name="sort">The sort settings (sort order & sort by)</param>
|
||||
/// <param name="sort">The sort settings (sort order and sort by)</param>
|
||||
/// <param name="limit">Pagination information (where to start and how many to get)</param>
|
||||
/// <returns>The filtered query</returns>
|
||||
protected Task<ICollection<T>> ApplyFilters(IQueryable<T> query,
|
||||
@ -130,14 +130,14 @@ namespace Kyoo.Core.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply filters to a query to ease sort, pagination & where queries for any resources types.
|
||||
/// For resources of type <see cref="T"/>, see <see cref="ApplyFilters"/>
|
||||
/// Apply filters to a query to ease sort, pagination and where queries for any resources types.
|
||||
/// For resources of type <typeparamref name="T"/>, see <see cref="ApplyFilters"/>
|
||||
/// </summary>
|
||||
/// <param name="query">The base query to filter.</param>
|
||||
/// <param name="get">A function to asynchronously get a resource from the database using it's ID.</param>
|
||||
/// <param name="defaultSort">The default sort order of this resource's type.</param>
|
||||
/// <param name="where">An expression to filter based on arbitrary conditions</param>
|
||||
/// <param name="sort">The sort settings (sort order & sort by)</param>
|
||||
/// <param name="sort">The sort settings (sort order and sort by)</param>
|
||||
/// <param name="limit">Pagination information (where to start and how many to get)</param>
|
||||
/// <typeparam name="TValue">The type of items to query.</typeparam>
|
||||
/// <returns>The filtered query</returns>
|
||||
@ -247,8 +247,8 @@ namespace Kyoo.Core.Controllers
|
||||
/// The non edited resource
|
||||
/// </param>
|
||||
/// <param name="changed">
|
||||
/// The new version of <see cref="resource"/>.
|
||||
/// This item will be saved on the database and replace <see cref="resource"/>
|
||||
/// The new version of <paramref name="resource"/>.
|
||||
/// This item will be saved on the database and replace <paramref name="resource"/>
|
||||
/// </param>
|
||||
/// <param name="resetOld">
|
||||
/// A boolean to indicate if all values of resource should be discarded or not.
|
||||
|
@ -31,16 +31,16 @@ namespace Kyoo.Core.Tasks
|
||||
private readonly ICollection<IMetadataProvider> _metadataProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="MetadataProviderLoader"/> task.
|
||||
/// Create a new <see cref="MetadataProviderLoader"/> task.
|
||||
/// </summary>
|
||||
/// <param name="providers">
|
||||
/// The provider repository used to create in-db providers from metadata providers.
|
||||
/// The provider repository used to create in-db providers from metadata providers.
|
||||
/// </param>
|
||||
/// <param name="thumbnails">
|
||||
/// The thumbnail manager used to download providers logo.
|
||||
/// The thumbnail manager used to download providers logo.
|
||||
/// </param>
|
||||
/// <param name="metadataProviders">
|
||||
/// The list of metadata providers to register.
|
||||
/// The list of metadata providers to register.
|
||||
/// </param>
|
||||
public MetadataProviderLoader(IProviderRepository providers,
|
||||
IThumbnailsManager thumbnails,
|
||||
|
@ -1,19 +1,11 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using Kyoo.Abstractions.Models;
|
||||
using Kyoo.Abstractions.Models.Attributes;
|
||||
using Kyoo.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Kyoo.Core.Api
|
||||
{
|
||||
|
||||
public class PeopleRoleConverter : JsonConverter<PeopleRole>
|
||||
{
|
||||
public override void WriteJson(JsonWriter writer, PeopleRole value, JsonSerializer serializer)
|
||||
|
@ -1,19 +1,11 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using Kyoo.Abstractions.Models;
|
||||
using Kyoo.Abstractions.Models.Attributes;
|
||||
using Kyoo.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Kyoo.Core.Api
|
||||
{
|
||||
|
||||
public class SerializeAsProvider : IValueProvider
|
||||
{
|
||||
private string _format;
|
||||
|
@ -348,7 +348,7 @@ namespace Kyoo.Database
|
||||
/// Return a new or an in cache temporary object wih the same ID as the one given
|
||||
/// </summary>
|
||||
/// <param name="model">If a resource with the same ID is found in the database, it will be used.
|
||||
/// <see cref="model"/> will be used otherwise</param>
|
||||
/// <paramref name="model"/> will be used otherwise</param>
|
||||
/// <typeparam name="T">The type of the resource</typeparam>
|
||||
/// <returns>A resource that is now tracked by this context.</returns>
|
||||
public T GetTemporaryObject<T>(T model)
|
||||
|
@ -22,6 +22,7 @@ namespace Kyoo.Host.Console
|
||||
/// Main function of the program
|
||||
/// </summary>
|
||||
/// <param name="args">Command line arguments</param>
|
||||
/// <returns>A <see cref="Task"/> representing the lifetime of the program.</returns>
|
||||
public static Task Main(string[] args)
|
||||
{
|
||||
Application application = new(Environment);
|
||||
|
@ -1,15 +1,15 @@
|
||||
<Project>
|
||||
<!-- Project file used instead of the default csproj when the host system is not windows. This only skip the build. -->
|
||||
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<NoWarn>NU1503</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
|
||||
<Target Name="Build">
|
||||
<Message Importance="high" Text="Detected current operating system is not windows, skipping WindowsHost build." />
|
||||
</Target>
|
||||
@ -18,9 +18,9 @@
|
||||
<Target Name="Pack" />
|
||||
<Target Name="Restore" />
|
||||
<Target Name="Publish" />
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="@(Compile)" />
|
||||
<None Include="@(Compile)" Visible="true" />
|
||||
<Compile Remove="*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
Loading…
x
Reference in New Issue
Block a user