update subtitle methods
This commit is contained in:
parent
3bb65c6f99
commit
3178896004
|
@ -689,7 +689,7 @@ namespace MediaBrowser.Api.Playback
|
|||
|
||||
// TODO: Perhaps also use original_size=1920x800 ??
|
||||
return string.Format("subtitles=filename='{0}'{1},setpts=PTS -{2}/TB",
|
||||
subtitlePath.Replace('\\', '/').Replace("'", "\\'").Replace(":/", "\\:/"),
|
||||
subtitlePath.Replace('\\', '/').Replace(":/", "\\:/"),
|
||||
charsetParam,
|
||||
seconds.ToString(UsCulture));
|
||||
}
|
||||
|
@ -697,7 +697,7 @@ namespace MediaBrowser.Api.Playback
|
|||
var mediaPath = state.MediaPath ?? string.Empty;
|
||||
|
||||
return string.Format("subtitles='{0}:si={1}',setpts=PTS -{2}/TB",
|
||||
mediaPath.Replace('\\', '/').Replace("'", "\\'").Replace(":/", "\\:/"),
|
||||
mediaPath.Replace('\\', '/').Replace(":/", "\\:/"),
|
||||
state.InternalSubtitleStreamOffset.ToString(UsCulture),
|
||||
seconds.ToString(UsCulture));
|
||||
}
|
||||
|
|
|
@ -902,13 +902,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
// TODO: Perhaps also use original_size=1920x800 ??
|
||||
return string.Format("subtitles=filename='{0}'{1},setpts=PTS -{2}/TB",
|
||||
subtitlePath.Replace('\\', '/').Replace("'", "\\'").Replace(":/", "\\:/"),
|
||||
subtitlePath.Replace('\\', '/').Replace(":/", "\\:/"),
|
||||
charsetParam,
|
||||
seconds.ToString(UsCulture));
|
||||
}
|
||||
|
||||
return string.Format("subtitles='{0}:si={1}',setpts=PTS -{2}/TB",
|
||||
state.MediaPath.Replace('\\', '/').Replace("'", "\\'").Replace(":/", "\\:/"),
|
||||
state.MediaPath.Replace('\\', '/').Replace(":/", "\\:/"),
|
||||
state.InternalSubtitleStreamOffset.ToString(UsCulture),
|
||||
seconds.ToString(UsCulture));
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
<Compile Include="Subtitles\AssParser.cs" />
|
||||
<Compile Include="Subtitles\SsaParser.cs" />
|
||||
<Compile Include="Subtitles\SubtitleEncoder.cs" />
|
||||
<Compile Include="Subtitles\SubtitleTrackInfo.cs" />
|
||||
<Compile Include="Subtitles\TtmlWriter.cs" />
|
||||
<Compile Include="Subtitles\VttWriter.cs" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
public class SubtitleTrackInfo
|
||||
{
|
||||
public List<SubtitleTrackEvent> TrackEvents { get; set; }
|
||||
|
||||
public SubtitleTrackInfo()
|
||||
{
|
||||
TrackEvents = new List<SubtitleTrackEvent>();
|
||||
}
|
||||
}
|
||||
|
||||
public class SubtitleTrackEvent
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Text { get; set; }
|
||||
public long StartPositionTicks { get; set; }
|
||||
public long EndPositionTicks { get; set; }
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ using System.IO;
|
|||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.IO;
|
|||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
{
|
||||
|
|
|
@ -821,6 +821,12 @@
|
|||
<Compile Include="..\MediaBrowser.Model\MediaInfo\SubtitleFormat.cs">
|
||||
<Link>MediaInfo\SubtitleFormat.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\SubtitleTrackEvent.cs">
|
||||
<Link>MediaInfo\SubtitleTrackEvent.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\SubtitleTrackInfo.cs">
|
||||
<Link>MediaInfo\SubtitleTrackInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\TransportStreamTimestamp.cs">
|
||||
<Link>MediaInfo\TransportStreamTimestamp.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
@ -777,6 +777,12 @@
|
|||
<Compile Include="..\MediaBrowser.Model\MediaInfo\SubtitleFormat.cs">
|
||||
<Link>MediaInfo\SubtitleFormat.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\SubtitleTrackEvent.cs">
|
||||
<Link>MediaInfo\SubtitleTrackEvent.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\SubtitleTrackInfo.cs">
|
||||
<Link>MediaInfo\SubtitleTrackInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\TransportStreamTimestamp.cs">
|
||||
<Link>MediaInfo\TransportStreamTimestamp.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
@ -169,6 +169,8 @@
|
|||
<Compile Include="Configuration\MetadataPluginType.cs" />
|
||||
<Compile Include="Dlna\SubtitleProfile.cs" />
|
||||
<Compile Include="MediaInfo\MediaProtocol.cs" />
|
||||
<Compile Include="MediaInfo\SubtitleTrackEvent.cs" />
|
||||
<Compile Include="MediaInfo\SubtitleTrackInfo.cs" />
|
||||
<Compile Include="Net\HttpResponse.cs" />
|
||||
<Compile Include="Net\MimeTypes.cs" />
|
||||
<Compile Include="Notifications\NotificationOption.cs" />
|
||||
|
|
11
MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
Normal file
11
MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
namespace MediaBrowser.Model.MediaInfo
|
||||
{
|
||||
public class SubtitleTrackEvent
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Text { get; set; }
|
||||
public long StartPositionTicks { get; set; }
|
||||
public long EndPositionTicks { get; set; }
|
||||
}
|
||||
}
|
14
MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
Normal file
14
MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.MediaInfo
|
||||
{
|
||||
public class SubtitleTrackInfo
|
||||
{
|
||||
public List<SubtitleTrackEvent> TrackEvents { get; set; }
|
||||
|
||||
public SubtitleTrackInfo()
|
||||
{
|
||||
TrackEvents = new List<SubtitleTrackEvent>();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -122,7 +122,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
}).Items;
|
||||
|
||||
// Add search hints based on item name
|
||||
hints.AddRange(mediaItems.Where(i => (user == null || i.IsVisibleStandalone(user)) && !(i is CollectionFolder)).Select(item =>
|
||||
hints.AddRange(mediaItems.Where(i => IncludeInSearch(i) && (user == null || i.IsVisibleStandalone(user)) && !(i is CollectionFolder)).Select(item =>
|
||||
{
|
||||
var index = GetIndex(item.Name, searchTerm, terms);
|
||||
|
||||
|
|
|
@ -1001,6 +1001,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
}
|
||||
|
||||
dict["Recording"] = new[] { typeof(LiveTvAudioRecording).FullName, typeof(LiveTvVideoRecording).FullName };
|
||||
dict["Program"] = new[] { typeof(LiveTvProgram).FullName };
|
||||
dict["TvChannel"] = new[] { typeof(LiveTvChannel).FullName };
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Text;
|
||||
using MediaBrowser.MediaEncoding.Subtitles;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Threading;
|
||||
using MediaBrowser.MediaEncoding.Subtitles;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace MediaBrowser.Tests.MediaEncoding.Subtitles
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using MediaBrowser.MediaEncoding.Subtitles;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace MediaBrowser.Tests.MediaEncoding.Subtitles {
|
||||
|
|
|
@ -304,11 +304,11 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
}
|
||||
}
|
||||
|
||||
var version = GetType().Assembly.GetName().Version;
|
||||
var versionString = !string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase) ? "?v=" + appVersion : string.Empty;
|
||||
|
||||
var imports = new[]
|
||||
{
|
||||
"vulcanize-out.html?v=" + appVersion
|
||||
"vulcanize-out.html" + versionString
|
||||
};
|
||||
var importsHtml = string.Join("", imports.Select(i => "<link rel=\"import\" href=\"" + i + "\">").ToArray());
|
||||
|
||||
|
@ -316,7 +316,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
// In chrome it is causing the body to be hidden while loading, which leads to width-check methods to return 0 for everything
|
||||
//imports = "";
|
||||
|
||||
html = html.Replace("<head>", "<head>" + GetMetaTags(mode) + GetCommonCss(mode, version) + GetInitialJavascript(mode, version) + importsHtml + GetCommonJavascript(mode, version));
|
||||
html = html.Replace("<head>", "<head>" + GetMetaTags(mode) + GetCommonCss(mode, appVersion) + GetInitialJavascript(mode, appVersion) + importsHtml + GetCommonJavascript(mode, appVersion));
|
||||
|
||||
var bytes = Encoding.UTF8.GetBytes(html);
|
||||
|
||||
|
@ -412,7 +412,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// <param name="mode">The mode.</param>
|
||||
/// <param name="version">The version.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetCommonCss(string mode, Version version)
|
||||
private string GetCommonCss(string mode, string version)
|
||||
{
|
||||
var versionString = !string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase) ? "?v=" + version : string.Empty;
|
||||
|
||||
|
@ -433,7 +433,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// <param name="mode">The mode.</param>
|
||||
/// <param name="version">The version.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetInitialJavascript(string mode, Version version)
|
||||
private string GetInitialJavascript(string mode, string version)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
|
||||
|
@ -457,7 +457,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// <param name="mode">The mode.</param>
|
||||
/// <param name="version">The version.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetCommonJavascript(string mode, Version version)
|
||||
private string GetCommonJavascript(string mode, string version)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user