mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix event issue
This commit is contained in:
parent
b753fdd2b0
commit
0f96f02df5
@ -80,7 +80,7 @@ namespace Kyoo.Abstractions.Models
|
||||
/// <summary>
|
||||
/// The slug of the Show that contain this episode. If this is not set, this episode is ill-formed.
|
||||
/// </summary>
|
||||
[SerializeIgnore] public string ShowSlug { private get; set; }
|
||||
[SerializeIgnore] public string ShowSlug { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the Show containing this episode.
|
||||
|
@ -78,7 +78,11 @@ namespace Kyoo.Core.Controllers
|
||||
shows.OnEdited += async (show) =>
|
||||
{
|
||||
foreach (Episode ep in _database.Episodes.Where(x => x.ShowID == show.ID))
|
||||
{
|
||||
Console.WriteLine("BFR ID: {0}; Slug: {1}; ShowSlug: {2}", ep.ID, ep.Slug, ep.ShowSlug);
|
||||
ep.ShowSlug = show.Slug;
|
||||
Console.WriteLine("AFT ID: {0}; Slug: {1}; ShowSlug: {2}", ep.ID, ep.Slug, ep.ShowSlug);
|
||||
}
|
||||
await _database.SaveChangesAsync();
|
||||
};
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// <param name="obj">The resource newly created.</param>
|
||||
protected void OnResourceCreated(T obj)
|
||||
{
|
||||
OnCreated.Invoke(obj);
|
||||
OnCreated?.Invoke(obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@ -390,7 +390,7 @@ namespace Kyoo.Core.Controllers
|
||||
Merger.Complete(old, edited, x => x.GetCustomAttribute<LoadableRelationAttribute>() == null);
|
||||
await EditRelations(old, edited, resetOld);
|
||||
await Database.SaveChangesAsync();
|
||||
OnEdited.Invoke(old);
|
||||
OnEdited?.Invoke(old);
|
||||
return old;
|
||||
}
|
||||
finally
|
||||
@ -469,7 +469,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc/>
|
||||
public virtual Task Delete(T obj)
|
||||
{
|
||||
OnDeleted.Invoke(obj);
|
||||
OnDeleted?.Invoke(obj);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user