Ver Fonte

update tv guide

Luke Pulverenti há 10 anos atrás
pai
commit
23bab40308

+ 1 - 1
MediaBrowser.Controller/LiveTv/IListingsProvider.cs

@@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.LiveTv
     {
     {
         string Name { get; }
         string Name { get; }
         string Type { get; }
         string Type { get; }
-        Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, ChannelInfo channel, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken);
+        Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken);
         Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken);
         Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken);
         Task Validate(ListingsProviderInfo info);
         Task Validate(ListingsProviderInfo info);
         Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string location);
         Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string location);

+ 1 - 10
MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

@@ -257,18 +257,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
 
         public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
         public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
         {
         {
-            var allChannels = await GetChannelsAsync(cancellationToken).ConfigureAwait(false);
-            var channelInfo = allChannels.FirstOrDefault(i => string.Equals(channelId, i.Id, StringComparison.OrdinalIgnoreCase));
-
-            if (channelInfo == null)
-            {
-                _logger.Debug("Returning empty program list because channel was not found.");
-                return new List<ProgramInfo>();
-            }
-
             foreach (var provider in GetListingProviders())
             foreach (var provider in GetListingProviders())
             {
             {
-                var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelInfo, startDateUtc, endDateUtc, cancellationToken)
+                var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelId, startDateUtc, endDateUtc, cancellationToken)
                         .ConfigureAwait(false);
                         .ConfigureAwait(false);
                 var list = programs.ToList();
                 var list = programs.ToList();
 
 

+ 2 - 37
MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs

@@ -35,10 +35,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
             _httpClient = httpClient;
             _httpClient = httpClient;
         }
         }
 
 
-        public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, ChannelInfo channel, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
+        public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
         {
         {
-            var channelNumber = channel.Number;
-
             List<ProgramInfo> programsInfo = new List<ProgramInfo>();
             List<ProgramInfo> programsInfo = new List<ProgramInfo>();
 
 
             var token = await GetToken(info, cancellationToken);
             var token = await GetToken(info, cancellationToken);
@@ -74,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
 
 
             ScheduleDirect.Station station = null;
             ScheduleDirect.Station station = null;
 
 
-            if (!_channelPair.TryGetValue("", out station))
+            if (!_channelPair.TryGetValue(channelNumber, out station))
             {
             {
                 return programsInfo;
                 return programsInfo;
             }
             }
@@ -217,39 +215,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
             }
             }
         }
         }
 
 
-        private async Task<ScheduleDirect.Channel> GetLineup(string listingsId, string token, CancellationToken cancellationToken)
-        {
-            var httpOptions = new HttpRequestOptions()
-            {
-                Url = ApiUrl + "/lineups/" + listingsId,
-                UserAgent = UserAgent,
-                CancellationToken = cancellationToken
-            };
-
-            httpOptions.RequestHeaders["token"] = token;
-
-            using (var response = await _httpClient.Get(httpOptions))
-            {
-                var root = _jsonSerializer.DeserializeFromStream<ScheduleDirect.Channel>(response);
-                _logger.Info("Found " + root.map.Count() + " channels on the lineup on ScheduleDirect");
-                _logger.Info("Mapping Stations to Channel");
-                foreach (ScheduleDirect.Map map in root.map)
-                {
-                    var channel = (map.channel ?? (map.atscMajor + "." + map.atscMinor)).TrimStart('0');
-                    _logger.Debug("Found channel: " + channel + " in Schedules Direct");
-
-                    var schChannel = root.stations.FirstOrDefault(item => item.stationID == map.stationID);
-
-                    if (!_channelPair.ContainsKey(channel) && channel != "0.0" && schChannel != null)
-                    {
-                        _channelPair.TryAdd(channel, schChannel);
-                    }
-                }
-
-                return root;
-            }
-        }
-
         private ProgramInfo GetProgram(string channel, ScheduleDirect.Program programInfo,
         private ProgramInfo GetProgram(string channel, ScheduleDirect.Program programInfo,
             ScheduleDirect.ProgramDetails details)
             ScheduleDirect.ProgramDetails details)
         {
         {

+ 5 - 2
MediaBrowser.Server.Implementations/Localization/Server/server.json

@@ -345,7 +345,9 @@
     "ButtonSelectDirectory": "Select Directory",
     "ButtonSelectDirectory": "Select Directory",
     "LabelCustomPaths": "Specify custom paths where desired. Leave fields empty to use the defaults.",
     "LabelCustomPaths": "Specify custom paths where desired. Leave fields empty to use the defaults.",
     "LabelCachePath": "Cache path:",
     "LabelCachePath": "Cache path:",
-    "LabelCachePathHelp": "Specify a custom location for server cache files, such as images.",
+    "LabelCachePathHelp": "Specify a custom location for server cache files, such as images. Leave blank to use the server default.",
+    "LabelRecordingPath": "Recording path:",
+    "LabelRecordingPathHelp": "Specify a custom location to save recordings. Leave blank to use the server default.",
     "LabelImagesByNamePath": "Images by name path:",
     "LabelImagesByNamePath": "Images by name path:",
     "LabelImagesByNamePathHelp": "Specify a custom location for downloaded actor, genre and studio images.",
     "LabelImagesByNamePathHelp": "Specify a custom location for downloaded actor, genre and studio images.",
     "LabelMetadataPath": "Metadata path:",
     "LabelMetadataPath": "Metadata path:",
@@ -1486,5 +1488,6 @@
     "LabelZipCode": "Zip Code:",
     "LabelZipCode": "Zip Code:",
     "GuideProviderListingsStep": "Step 2: Select Listings",
     "GuideProviderListingsStep": "Step 2: Select Listings",
     "GuideProviderLoginStep": "Step 1: Login",
     "GuideProviderLoginStep": "Step 1: Login",
-    "LabelLineup": "Lineup"
+    "LabelLineup": "Lineup",
+    "MessageTunerDeviceNotListed": "Is your tuner device not listed? Try installing an external service plugin for more Live TV options."
 }
 }

+ 1 - 0
MediaBrowser.Server.Implementations/Localization/iso6392.txt

@@ -346,6 +346,7 @@ pli||pi|Pali|pali
 pol||pl|Polish|polonais
 pol||pl|Polish|polonais
 pon|||Pohnpeian|pohnpei
 pon|||Pohnpeian|pohnpei
 por||pt|Portuguese|portugais
 por||pt|Portuguese|portugais
+pob||pt-br|Portuguese (Brazil)|portugais
 pra|||Prakrit languages|prâkrit, langues
 pra|||Prakrit languages|prâkrit, langues
 pro|||Provençal, Old (to 1500)|provençal ancien (jusqu'à 1500)
 pro|||Provençal, Old (to 1500)|provençal ancien (jusqu'à 1500)
 pus||ps|Pushto; Pashto|pachto
 pus||ps|Pushto; Pashto|pachto