aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-09-21 13:14:11 -0400
committerGitHub <noreply@github.com>2016-09-21 13:14:11 -0400
commit22fa3eca16d874a43abb5b899e61626eedcea7b4 (patch)
tree361e5ddc08370ae6c50b1ebdf03b9f4ee9858e90 /MediaBrowser.Server.Implementations
parentd61258f29033f53479104c45c32f15ba8d08e200 (diff)
parentd94598a75e303c0b4f76392e1e26b819d73e87c1 (diff)
Merge pull request #2183 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs18
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs24
2 files changed, 34 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 2dd23857a..d4b21102d 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -843,6 +843,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
if (recordingEndDate <= DateTime.UtcNow)
{
_logger.Warn("Recording timer fired for timer {0}, Id: {1}, but the program has already ended.", timer.Name, timer.Id);
+ _timerProvider.Delete(timer);
return;
}
@@ -1273,6 +1274,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
writer.WriteElementString("rating", timer.CommunityRating.Value.ToString(CultureInfo.InvariantCulture));
}
+ if (timer.IsSports)
+ {
+ AddGenre(timer.Genres, "Sports");
+ }
+ if (timer.IsKids)
+ {
+ AddGenre(timer.Genres, "Kids");
+ }
+
foreach (var genre in timer.Genres)
{
writer.WriteElementString("genre", genre);
@@ -1294,6 +1304,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
}
}
+ private void AddGenre(List<string> genres, string genre)
+ {
+ if (!genres.Contains(genre, StringComparer.OrdinalIgnoreCase))
+ {
+ genres.Add(genre);
+ }
+ }
+
private ProgramInfo GetProgramInfoFromCache(string channelId, string programId)
{
var epgData = GetEpgDataForChannel(channelId);
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index 0bc84a2e5..c3907c045 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
@@ -339,13 +339,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
channelNumber = channelNumber.TrimStart('0');
_logger.Debug("Found channel: " + channelNumber + " in Schedules Direct");
- if (root.stations != null)
+
+ var schChannel = (root.stations ?? new List<ScheduleDirect.Station>()).FirstOrDefault(item => string.Equals(item.stationID, map.stationID, StringComparison.OrdinalIgnoreCase));
+ if (schChannel != null)
{
- var schChannel = root.stations.FirstOrDefault(item => string.Equals(item.stationID, map.stationID, StringComparison.OrdinalIgnoreCase));
- if (schChannel != null)
+ AddToChannelPairCache(listingsId, channelNumber, schChannel);
+ }
+ else
+ {
+ AddToChannelPairCache(listingsId, channelNumber, new ScheduleDirect.Station
{
- AddToChannelPairCache(listingsId, channelNumber, schChannel);
- }
+ stationID = map.stationID
+ });
}
}
_logger.Info("Added " + GetChannelPairCacheCount(listingsId) + " channels to the dictionary");
@@ -361,8 +366,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
channel.ImageUrl = station.logo.URL;
channel.HasImage = true;
}
- string channelName = station.name;
- channel.Name = channelName;
+
+ if (!string.IsNullOrWhiteSpace(station.name))
+ {
+ channel.Name = station.name;
+ }
}
else
{
@@ -993,7 +1001,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
var name = channelNumber;
var station = GetStation(listingsId, channelNumber, null);
- if (station != null)
+ if (station != null && !string.IsNullOrWhiteSpace(station.name))
{
name = station.name;
}