aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-05 11:57:51 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-05 11:57:51 -0400
commit6cefbdcdbfd946075c01764d2fd3ab9386047063 (patch)
tree51b1577dc01ad45116dc0c28f75fc2e660ab1394
parentdbcb62e462fd2ef14d310160c13fdc9ae14e26b4 (diff)
fixes #101 - Subtitles for TV
-rw-r--r--MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs
index 957000ae2..cae74a910 100644
--- a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs
+++ b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs
@@ -21,7 +21,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
/// </summary>
public class FFProbeVideoInfoProvider : BaseFFProbeProvider<Video>
{
- public FFProbeVideoInfoProvider(IIsoManager isoManager, IBlurayExaminer blurayExaminer, IProtobufSerializer protobufSerializer, ILogManager logManager, IServerConfigurationManager configurationManager)
+ public FFProbeVideoInfoProvider(IIsoManager isoManager, IBlurayExaminer blurayExaminer, IProtobufSerializer protobufSerializer, ILogManager logManager, IServerConfigurationManager configurationManager)
: base(logManager, configurationManager)
{
if (isoManager == null)
@@ -253,16 +253,23 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
if (string.Equals(extension, ".srt", StringComparison.OrdinalIgnoreCase))
{
+ if (video.VideoType == VideoType.VideoFile)
+ {
+ // For video files the subtitle filename must match video filename
+ if (!string.Equals(Path.GetFileNameWithoutExtension(video.Path), Path.GetFileNameWithoutExtension(file.Path)))
+ {
+ continue;
+ }
+ }
+
streams.Add(new MediaStream
{
- Index = startIndex,
+ Index = startIndex++,
Type = MediaStreamType.Subtitle,
IsExternal = true,
Path = file.Path,
Codec = "srt"
});
-
- startIndex++;
}
}