aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-08-21 22:59:10 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-08-21 22:59:10 -0400
commitde133cb8aa2b078ba653ee7c3e1cef4fd16996d6 (patch)
tree32921d4b76c387227a5d30f86bc0e1a17a2fd360 /MediaBrowser.Server.Implementations/LiveTv
parent4307c67b5e518ef2514740b0a874f5832f31e537 (diff)
update search
Diffstat (limited to 'MediaBrowser.Server.Implementations/LiveTv')
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs18
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs5
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs9
3 files changed, 12 insertions, 20 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 708828d47..3c65ac739 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -627,31 +627,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
private async Task UpdateTimersForSeriesTimer(List<ProgramInfo> epgData, SeriesTimerInfo seriesTimer)
{
- var newTimers = GetTimersForSeries(seriesTimer, epgData, _recordingProvider.GetAll()).ToList();
-
- var existingTimers = _timerProvider.GetAll()
- .Where(i => string.Equals(i.SeriesTimerId, seriesTimer.Id, StringComparison.OrdinalIgnoreCase))
- .ToList();
-
var registration = await GetRegistrationInfo("seriesrecordings").ConfigureAwait(false);
if (registration.IsValid)
{
+ var newTimers = GetTimersForSeries(seriesTimer, epgData, _recordingProvider.GetAll()).ToList();
+
foreach (var timer in newTimers)
{
_timerProvider.AddOrUpdate(timer);
}
}
-
- var newTimerIds = newTimers.Select(i => i.Id).ToList();
-
- foreach (var timer in existingTimers)
- {
- if (!newTimerIds.Contains(timer.Id, StringComparer.OrdinalIgnoreCase))
- {
- CancelTimerInternal(timer.Id);
- }
- }
}
private IEnumerable<TimerInfo> GetTimersForSeries(SeriesTimerInfo seriesTimer, IEnumerable<ProgramInfo> allPrograms, IReadOnlyList<RecordingInfo> currentRecordings)
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index 7a6860d65..129f922b3 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
@@ -304,7 +304,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
IsKids = string.Equals(details.audience, "children", StringComparison.OrdinalIgnoreCase),
IsSports = showType.IndexOf("sports", StringComparison.OrdinalIgnoreCase) != -1,
IsMovie = showType.IndexOf("movie", StringComparison.OrdinalIgnoreCase) != -1 || showType.IndexOf("film", StringComparison.OrdinalIgnoreCase) != -1,
- ShowId = programInfo.programID
+ ShowId = programInfo.programID,
+ Etag = programInfo.md5
};
if (programInfo.videoProperties != null)
@@ -408,7 +409,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
;
});
imageIdString = imageIdString.TrimEnd(',') + "]";
- _logger.Debug("Json for show images = " + imageIdString);
+
var httpOptions = new HttpRequestOptions()
{
Url = ApiUrl + "/metadata/programs",
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index 4109617db..1721d6101 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -593,7 +593,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Name = info.Name,
Id = id,
DateCreated = DateTime.UtcNow,
- DateModified = DateTime.UtcNow
+ DateModified = DateTime.UtcNow,
+ Etag = info.Etag
};
}
@@ -639,7 +640,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}
else
{
- await _libraryManager.UpdateItem(item, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
+ if (string.IsNullOrWhiteSpace(info.Etag) || !string.Equals(info.Etag, item.Etag, StringComparison.OrdinalIgnoreCase))
+ {
+ item.Etag = info.Etag;
+ await _libraryManager.UpdateItem(item, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
+ }
}
_providerManager.QueueRefresh(item.Id, new MetadataRefreshOptions());