Skip to content

Commit

Permalink
Queue refresh after adding child (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
scampower3 authored Nov 3, 2024
1 parent ebf651d commit 4e29126
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 4e29126

Please sign in to comment.