mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Add episode count in season
This commit is contained in:
parent
234d3c9c7c
commit
9b606cf9ac
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Autofac" Version="7.0.1" />
|
<PackageReference Include="Autofac" Version="7.0.1" />
|
||||||
|
<PackageReference Include="EntityFrameworkCore.Projectables" Version="3.0.4" />
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
|
||||||
|
@ -20,6 +20,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using EntityFrameworkCore.Projectables;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Kyoo.Abstractions.Controllers;
|
using Kyoo.Abstractions.Controllers;
|
||||||
using Kyoo.Abstractions.Models.Attributes;
|
using Kyoo.Abstractions.Models.Attributes;
|
||||||
@ -119,5 +120,13 @@ namespace Kyoo.Abstractions.Models
|
|||||||
/// The list of episodes that this season contains.
|
/// The list of episodes that this season contains.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[LoadableRelation] public ICollection<Episode>? Episodes { get; set; }
|
[LoadableRelation] public ICollection<Episode>? Episodes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The number of episodes in this season.
|
||||||
|
/// </summary>
|
||||||
|
[Projectable(UseMemberBody = nameof(_EpisodeCount))]
|
||||||
|
public int EpisodeCount { get; set; }
|
||||||
|
|
||||||
|
private int _EpisodeCount => Episodes!.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
|
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
|
||||||
|
<PackageReference Include="EntityFrameworkCore.Projectables" Version="3.0.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
@ -87,7 +87,8 @@ namespace Kyoo.Postgresql
|
|||||||
["MAXPOOLSIZE"] = "95",
|
["MAXPOOLSIZE"] = "95",
|
||||||
["TIMEOUT"] = "30"
|
["TIMEOUT"] = "30"
|
||||||
};
|
};
|
||||||
x.UseNpgsql(builder.ConnectionString);
|
x.UseNpgsql(builder.ConnectionString)
|
||||||
|
.UseProjectables();
|
||||||
if (_environment.IsDevelopment())
|
if (_environment.IsDevelopment())
|
||||||
x.EnableDetailedErrors().EnableSensitiveDataLogging();
|
x.EnableDetailedErrors().EnableSensitiveDataLogging();
|
||||||
}, ServiceLifetime.Transient);
|
}, ServiceLifetime.Transient);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user