mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
add mappings to add meta data method
This commit is contained in:
parent
18df678d3f
commit
2538889943
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
using MediaBrowser.Model.Extensions;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.LiveTv
|
namespace MediaBrowser.Model.LiveTv
|
||||||
{
|
{
|
||||||
|
@ -90,5 +91,17 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
EnableAllTuners = true;
|
EnableAllTuners = true;
|
||||||
ChannelMappings = new NameValuePair[] {};
|
ChannelMappings = new NameValuePair[] {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetMappedChannel(string channelNumber)
|
||||||
|
{
|
||||||
|
foreach (NameValuePair mapping in ChannelMappings)
|
||||||
|
{
|
||||||
|
if (StringHelper.EqualsIgnoreCase(mapping.Name, channelNumber))
|
||||||
|
{
|
||||||
|
return mapping.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return channelNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
result.Item3.Release();
|
result.Item3.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
_libraryMonitor.ReportFileSystemChangeComplete(recordPath, false);
|
_libraryMonitor.ReportFileSystemChangeComplete(recordPath, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
|
|
|
@ -107,11 +107,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
||||||
var reader = new XmlTvReader(info.Path, GetLanguage(), null);
|
var reader = new XmlTvReader(info.Path, GetLanguage(), null);
|
||||||
var results = reader.GetChannels().ToList();
|
var results = reader.GetChannels().ToList();
|
||||||
|
|
||||||
if (channels != null && channels.Count > 0)
|
if (channels != null)
|
||||||
{
|
{
|
||||||
channels.ForEach(c =>
|
channels.ForEach(c =>
|
||||||
{
|
{
|
||||||
var match = results.FirstOrDefault(r => r.Id == c.Id);
|
var channelNumber = info.GetMappedChannel(c.Number);
|
||||||
|
var match = results.FirstOrDefault(r => string.Equals(r.Id, channelNumber, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
if (match != null && match.Icon != null && !String.IsNullOrEmpty(match.Icon.Source))
|
if (match != null && match.Icon != null && !String.IsNullOrEmpty(match.Icon.Source))
|
||||||
{
|
{
|
||||||
c.ImageUrl = match.Icon.Source;
|
c.ImageUrl = match.Icon.Source;
|
||||||
|
|
Loading…
Reference in a new issue