mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fixing task services resolving
This commit is contained in:
parent
9d45af3dd2
commit
6542062bb8
@ -178,6 +178,7 @@ namespace Kyoo.Models
|
|||||||
EpisodeID = ep.ID,
|
EpisodeID = ep.ID,
|
||||||
Slug = ep.Slug,
|
Slug = ep.Slug,
|
||||||
ShowSlug = ep.Show.Slug,
|
ShowSlug = ep.Show.Slug,
|
||||||
|
ShowTitle = ep.Show.Title,
|
||||||
SeasonNumber = ep.SeasonNumber,
|
SeasonNumber = ep.SeasonNumber,
|
||||||
EpisodeNumber = ep.EpisodeNumber,
|
EpisodeNumber = ep.EpisodeNumber,
|
||||||
AbsoluteNumber = ep.AbsoluteNumber,
|
AbsoluteNumber = ep.AbsoluteNumber,
|
||||||
|
@ -20,7 +20,7 @@ namespace Kyoo
|
|||||||
RegisterTask<T>(this ContainerBuilder builder)
|
RegisterTask<T>(this ContainerBuilder builder)
|
||||||
where T : class, ITask
|
where T : class, ITask
|
||||||
{
|
{
|
||||||
return builder.RegisterType<T>().As<ITask>().SingleInstance();
|
return builder.RegisterType<T>().As<ITask>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -75,7 +75,7 @@ namespace Kyoo.Postgresql
|
|||||||
DatabaseContext context = provider.GetRequiredService<DatabaseContext>();
|
DatabaseContext context = provider.GetRequiredService<DatabaseContext>();
|
||||||
context.Database.Migrate();
|
context.Database.Migrate();
|
||||||
|
|
||||||
NpgsqlConnection conn = (NpgsqlConnection)context.Database.GetDbConnection();
|
using NpgsqlConnection conn = (NpgsqlConnection)context.Database.GetDbConnection();
|
||||||
conn.Open();
|
conn.Open();
|
||||||
conn.ReloadTypes();
|
conn.ReloadTypes();
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ namespace Kyoo.Controllers
|
|||||||
Dictionary<string, object> arguments,
|
Dictionary<string, object> arguments,
|
||||||
CancellationToken? cancellationToken = null)
|
CancellationToken? cancellationToken = null)
|
||||||
{
|
{
|
||||||
using (_logger.BeginScope("Task: {Task}", task.Metadata.Name))
|
using (_logger.BeginScope("Task: {Task}", task.Metadata.Name))
|
||||||
{
|
{
|
||||||
await using Owned<ITask> taskObj = task.Factory.Invoke();
|
await using Owned<ITask> taskObj = task.Factory.Invoke();
|
||||||
ICollection<TaskParameter> all = taskObj.Value.GetParameters();
|
ICollection<TaskParameter> all = taskObj.Value.GetParameters();
|
||||||
|
@ -138,7 +138,6 @@ namespace Kyoo.Tasks
|
|||||||
_taskManager.StartTask<RegisterEpisode>(reporter, new Dictionary<string, object>
|
_taskManager.StartTask<RegisterEpisode>(reporter, new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
["path"] = episodePath,
|
["path"] = episodePath,
|
||||||
["relativePath"] = episodePath[path.Length..],
|
|
||||||
["library"] = library
|
["library"] = library
|
||||||
}, cancellationToken);
|
}, cancellationToken);
|
||||||
percent += 100f / paths.Length;
|
percent += 100f / paths.Length;
|
||||||
@ -161,8 +160,7 @@ namespace Kyoo.Tasks
|
|||||||
{
|
{
|
||||||
_taskManager.StartTask<RegisterSubtitle>(reporter, new Dictionary<string, object>
|
_taskManager.StartTask<RegisterSubtitle>(reporter, new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
["path"] = trackPath,
|
["path"] = trackPath
|
||||||
["relativePath"] = trackPath[path.Length..]
|
|
||||||
}, cancellationToken);
|
}, cancellationToken);
|
||||||
percent += 100f / subtitles.Length;
|
percent += 100f / subtitles.Length;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user