From c3b706287c3452eacc46417190e006d1062173c5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 28 Aug 2015 15:10:44 -0400 Subject: [PATCH] update osd --- MediaBrowser.Api/Library/LibraryService.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 3e49c1c9e5..ed3f2c6333 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -270,6 +270,7 @@ namespace MediaBrowser.Api.Library private readonly ILiveTvManager _liveTv; private readonly IChannelManager _channelManager; private readonly ITVSeriesManager _tvManager; + private readonly ILibraryMonitor _libraryMonitor; /// /// Initializes a new instance of the class. @@ -422,7 +423,25 @@ namespace MediaBrowser.Api.Library public void Post(PostUpdatedSeries request) { - Task.Run(() => _libraryManager.ValidateMediaLibrary(new Progress(), CancellationToken.None)); + var series = _libraryManager.GetItems(new InternalItemsQuery + { + IncludeItemTypes = new[] { typeof(Series).Name } + + }).Items; + + series = series.Where(i => string.Equals(request.TvdbId, i.GetProviderId(MetadataProviders.Tvdb), StringComparison.OrdinalIgnoreCase)).ToArray(); + + if (series.Length > 0) + { + foreach (var item in series) + { + _libraryMonitor.ReportFileSystemChanged(item.Path); + } + } + else + { + Task.Run(() => _libraryManager.ValidateMediaLibrary(new Progress(), CancellationToken.None)); + } } public object Get(GetDownload request)