Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue refresh after adding child #196

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Jellyfin.Plugin.Tvdb/Providers/TvdbMissingEpisodeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Tvdb.Sdk;
Expand All @@ -35,6 +36,7 @@ public class TvdbMissingEpisodeProvider : IHostedService
private readonly IProviderManager _providerManager;
private readonly ILocalizationManager _localization;
private readonly ILibraryManager _libraryManager;
private readonly IFileSystem _fileSystem;
private readonly ILogger<TvdbMissingEpisodeProvider> _logger;

/// <summary>
Expand All @@ -45,20 +47,23 @@ public class TvdbMissingEpisodeProvider : IHostedService
/// <param name="providerManager">Instance of the <see cref="IProviderManager"/> interface.</param>
/// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param>
/// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
/// <param name="logger">Instance of the <see cref="ILogger{TvdbMissingEpisodeProvider}"/> interface.</param>
public TvdbMissingEpisodeProvider(
TvdbClientManager tvdbClientManager,
IBaseItemManager baseItemManager,
IProviderManager providerManager,
ILocalizationManager localization,
ILibraryManager libraryManager,
IFileSystem fileSystem,
ILogger<TvdbMissingEpisodeProvider> logger)
{
_tvdbClientManager = tvdbClientManager;
_baseItemManager = baseItemManager;
_providerManager = providerManager;
_localization = localization;
_libraryManager = libraryManager;
_fileSystem = fileSystem;
_logger = logger;
}

Expand Down Expand Up @@ -428,6 +433,7 @@ private Season AddVirtualSeason(int season, Series series)
};

series.AddChild(newSeason);
_providerManager.QueueRefresh(newSeason.Id, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), RefreshPriority.High);

return newSeason;
}
Expand Down Expand Up @@ -481,6 +487,7 @@ private void AddVirtualEpisode(EpisodeBaseRecord? episode, Season? season)
episode.Number);

season.AddChild(newEpisode);
_providerManager.QueueRefresh(newEpisode.Id, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), RefreshPriority.High);
}

/// <inheritdoc />
Expand Down