fixes #1348 - [Feature Request] Option for single subtitle on DLNA config.
This commit is contained in:
parent
ee1e0c7fe3
commit
2e2929c77f
|
@ -175,19 +175,24 @@ namespace MediaBrowser.Dlna.Didl
|
||||||
{
|
{
|
||||||
if (subtitle.DeliveryMethod == SubtitleDeliveryMethod.External)
|
if (subtitle.DeliveryMethod == SubtitleDeliveryMethod.External)
|
||||||
{
|
{
|
||||||
AddSubtitleElement(container, subtitle);
|
var subtitleAdded = AddSubtitleElement(container, subtitle);
|
||||||
|
|
||||||
|
if (subtitleAdded && _profile.EnableSingleSubtitleLimit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddSubtitleElement(XmlElement container, SubtitleStreamInfo info)
|
private bool AddSubtitleElement(XmlElement container, SubtitleStreamInfo info)
|
||||||
{
|
{
|
||||||
var subtitleProfile = _profile.SubtitleProfiles
|
var subtitleProfile = _profile.SubtitleProfiles
|
||||||
.FirstOrDefault(i => string.Equals(info.Format, i.Format, StringComparison.OrdinalIgnoreCase) && i.Method == SubtitleDeliveryMethod.External);
|
.FirstOrDefault(i => string.Equals(info.Format, i.Format, StringComparison.OrdinalIgnoreCase) && i.Method == SubtitleDeliveryMethod.External);
|
||||||
|
|
||||||
if (subtitleProfile == null)
|
if (subtitleProfile == null)
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var subtitleMode = subtitleProfile.DidlMode;
|
var subtitleMode = subtitleProfile.DidlMode;
|
||||||
|
@ -226,6 +231,8 @@ namespace MediaBrowser.Dlna.Didl
|
||||||
|
|
||||||
container.AppendChild(res);
|
container.AppendChild(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddVideoResource(XmlElement container, IHasMediaSources video, string deviceId, Filter filter, string contentFeatures, StreamInfo streamInfo)
|
private void AddVideoResource(XmlElement container, IHasMediaSources video, string deviceId, Filter filter, string contentFeatures, StreamInfo streamInfo)
|
||||||
|
|
|
@ -36,7 +36,8 @@ namespace MediaBrowser.Model.Dlna
|
||||||
public string SerialNumber { get; set; }
|
public string SerialNumber { get; set; }
|
||||||
|
|
||||||
public bool EnableAlbumArtInDidl { get; set; }
|
public bool EnableAlbumArtInDidl { get; set; }
|
||||||
public bool EnableSingleAlbumArtLimit { get; set; }
|
public bool EnableSingleAlbumArtLimit { get; set; }
|
||||||
|
public bool EnableSingleSubtitleLimit { get; set; }
|
||||||
|
|
||||||
public string SupportedMediaTypes { get; set; }
|
public string SupportedMediaTypes { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user