diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 986dc4d2ee..a36b65f744 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -179,7 +179,7 @@ namespace MediaBrowser.Api.Playback if (time > _slowSeekTicks && _slowSeekTicks > 0) { - return string.Format("-ss {0}", MediaEncoder.GetTimeParameter(_slowSeekTicks)); + return string.Format("-ss {0}", MediaEncoder.GetTimeParameter(time)); } return string.Empty; diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 2d8b71a0cc..45d560da7f 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -244,7 +244,7 @@ namespace MediaBrowser.Api.Playback.Hls } catch (FileNotFoundException) { - + } } @@ -675,7 +675,7 @@ namespace MediaBrowser.Api.Playback.Hls builder.AppendLine("#EXTM3U"); builder.AppendLine("#EXT-X-VERSION:3"); - builder.AppendLine("#EXT-X-TARGETDURATION:" + state.SegmentLength.ToString(UsCulture)); + builder.AppendLine("#EXT-X-TARGETDURATION:" + (state.SegmentLength).ToString(UsCulture)); builder.AppendLine("#EXT-X-MEDIA-SEQUENCE:0"); var queryStringIndex = Request.RawUrl.IndexOf('?'); @@ -758,12 +758,14 @@ namespace MediaBrowser.Api.Playback.Hls } var keyFrameArg = string.Format(" -force_key_frames expr:gte(t,n_forced*{0})", - 1.ToString(UsCulture)); + state.SegmentLength.ToString(UsCulture)); var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream; args += " " + GetVideoQualityParam(state, H264Encoder, true) + keyFrameArg; + //args += " -mixed-refs 0 -refs 3 -x264opts b_pyramid=0:weightb=0:weightp=0"; + // Add resolution params, if specified if (!hasGraphicalSubs) { @@ -783,7 +785,7 @@ namespace MediaBrowser.Api.Playback.Hls { var threads = GetNumberOfThreads(state, false); - var inputModifier = GetInputModifier(state); + var inputModifier = GetInputModifier(state, false); // If isEncoding is true we're actually starting ffmpeg var startNumberParam = isEncoding ? GetStartNumber(state).ToString(UsCulture) : "0"; @@ -799,7 +801,8 @@ namespace MediaBrowser.Api.Playback.Hls if (endTime < state.RunTimeTicks.Value) { - toTimeParam = " -to " + MediaEncoder.GetTimeParameter(endTime); + //toTimeParam = " -to " + MediaEncoder.GetTimeParameter(endTime); + toTimeParam = " -t " + MediaEncoder.GetTimeParameter(TimeSpan.FromSeconds(durationSeconds).Ticks); } } @@ -809,11 +812,13 @@ namespace MediaBrowser.Api.Playback.Hls slowSeekParam = " " + slowSeekParam; } + //state.EnableGenericHlsSegmenter = true; + if (state.EnableGenericHlsSegmenter) { var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d.ts"; - return string.Format("{0} {1}{10}{11} -map_metadata -1 -threads {2} {3} {4} -flags -global_header -sc_threshold 0 {5} -f segment -segment_time {6} -segment_start_number {7} -segment_list \"{8}\" -y \"{9}\"", + return string.Format("{0} {11} {1}{10} -map_metadata -1 -threads {2} {3} {4} -flags -global_header -sc_threshold 0 {5} -f segment -segment_time {6} -segment_format mpegts -segment_list_type m3u8 -segment_start_number {7} -segment_list \"{8}\" -y \"{9}\"", inputModifier, GetInputArgument(state), threads, @@ -829,7 +834,7 @@ namespace MediaBrowser.Api.Playback.Hls ).Trim(); } - return string.Format("{0} {1}{10}{11} -map_metadata -1 -threads {2} {3} {4} -flags -global_header -copyts -sc_threshold 0 {5} -hls_time {6} -start_number {7} -hls_list_size {8} -y \"{9}\"", + return string.Format("{0}{11} {1}{10} -map_metadata -1 -threads {2} {3} {4} -output_ts_offset " + MediaEncoder.GetTimeParameter(state.Request.StartTimeTicks ?? 0) + " -flags -global_header -sc_threshold 0 {5} -hls_time {6} -start_number {7} -hls_list_size {8} -y \"{9}\"", inputModifier, GetInputArgument(state), threads, diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 3dda3f1581..be8c1cfbd7 100644 --- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -32,6 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library ".wd_tv", // Synology + "@eaDir", "eaDir" }; diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 8f90f1aca6..579df55a8d 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1243,6 +1243,7 @@ "OptionNoThemeVideo": "No Theme Video", "LabelOneTimeDonationAmount": "Donation amount:", "ButtonDonate": "Donate", + "ButtonPurchase": "Purchase", "OptionActor": "Actor", "OptionComposer": "Composer", "OptionDirector": "Director", diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 07d9ed4979..715f06055f 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -320,6 +320,19 @@ namespace MediaBrowser.WebDashboard.Api await DumpFile(filename, Path.Combine(destination, filename), mode, culture, appVersion).ConfigureAwait(false); } + + var excludeFiles = new List(); + + if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) + { + excludeFiles.Add("supporter.html"); + excludeFiles.Add("supporterkey.html"); + } + + foreach (var file in excludeFiles) + { + File.Delete(Path.Combine(destination, file)); + } } private async Task DumpJs(string source, string mode, string destination, string culture, string appVersion) diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 2823733ea8..a414e41313 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -291,7 +291,7 @@ namespace MediaBrowser.WebDashboard.Api html = ReplaceBetween(html, "", "", string.Empty); // Replace CORDOVA_REPLACE_SUPPORTER_SUBMIT_START - html = ReplaceBetween(html, "", "", "${ButtonDonate}"); + html = ReplaceBetween(html, "", "", "${ButtonPurchase}"); return html; } @@ -299,14 +299,20 @@ namespace MediaBrowser.WebDashboard.Api private string ReplaceBetween(string html, string startToken, string endToken, string newHtml) { var start = html.IndexOf(startToken, StringComparison.OrdinalIgnoreCase); - var end = html.IndexOf(endToken, StringComparison.OrdinalIgnoreCase); - if (start == -1 || end == -1) + if (start == -1) { return html; } - string result = html.Substring(start + 1, end - start - 1); + var end = html.IndexOf(endToken, start, StringComparison.OrdinalIgnoreCase); + + if (end == -1) + { + return html; + } + + string result = html.Substring(start, end - start); html = html.Replace(result, newHtml); return ReplaceBetween(html, startToken, endToken, newHtml); diff --git a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs index b2d276b734..ddbd528d9d 100644 --- a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs +++ b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs @@ -33,7 +33,7 @@ namespace MediaBrowser.XbmcMetadata.Savers { var path = item.ContainingFolderPath; - list.Add(Path.Combine(path, "VIDEO_TS.nfo")); + list.Add(Path.Combine(path, "VIDEO_TS", "VIDEO_TS.nfo")); } if (item.VideoType == VideoType.Dvd || item.VideoType == VideoType.BluRay || item.VideoType == VideoType.HdDvd)