mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-26 07:28:43 +02:00
update connect
This commit is contained in:
parent
7990f9ca50
commit
00aa3b0de0
|
@ -42,14 +42,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
var options = GetOptions();
|
var options = GetOptions();
|
||||||
|
|
||||||
var threshold = options.ThrottleThresholdInSeconds;
|
if (options.EnableThrottling && IsThrottleAllowed(_job, options.ThrottleThresholdInSeconds))
|
||||||
|
|
||||||
if (!options.EnableThrottling)
|
|
||||||
{
|
|
||||||
threshold *= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsThrottleAllowed(_job, threshold))
|
|
||||||
{
|
{
|
||||||
PauseTranscoding();
|
PauseTranscoding();
|
||||||
}
|
}
|
||||||
|
@ -63,7 +56,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
{
|
{
|
||||||
if (!_isPaused)
|
if (!_isPaused)
|
||||||
{
|
{
|
||||||
//_logger.Debug("Sending pause command to ffmpeg");
|
_logger.Debug("Sending pause command to ffmpeg");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -81,7 +74,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
{
|
{
|
||||||
if (_isPaused)
|
if (_isPaused)
|
||||||
{
|
{
|
||||||
//_logger.Debug("Sending unpause command to ffmpeg");
|
_logger.Debug("Sending unpause command to ffmpeg");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -723,9 +723,20 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
private string GetHostFromUrl(string url)
|
private string GetHostFromUrl(string url)
|
||||||
{
|
{
|
||||||
var start = url.IndexOf("://", StringComparison.OrdinalIgnoreCase) + 3;
|
var index = url.IndexOf("://", StringComparison.OrdinalIgnoreCase);
|
||||||
var len = url.IndexOf('/', start) - start;
|
|
||||||
return url.Substring(start, len);
|
if (index != -1)
|
||||||
|
{
|
||||||
|
url = url.Substring(index + 3);
|
||||||
|
var host = url.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(host))
|
||||||
|
{
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -137,6 +137,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
_connection.AddColumn(_logger, "TypedBaseItems", "IsKids", "BIT");
|
_connection.AddColumn(_logger, "TypedBaseItems", "IsKids", "BIT");
|
||||||
_connection.AddColumn(_logger, "TypedBaseItems", "CommunityRating", "Float");
|
_connection.AddColumn(_logger, "TypedBaseItems", "CommunityRating", "Float");
|
||||||
_connection.AddColumn(_logger, "TypedBaseItems", "CustomRating", "Text");
|
_connection.AddColumn(_logger, "TypedBaseItems", "CustomRating", "Text");
|
||||||
|
_connection.AddColumn(_logger, "TypedBaseItems", "IndexNumber", "INT");
|
||||||
|
_connection.AddColumn(_logger, "TypedBaseItems", "IsLocked", "BIT");
|
||||||
|
_connection.AddColumn(_logger, "TypedBaseItems", "Name", "Text");
|
||||||
|
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRating", "Text");
|
||||||
|
|
||||||
PrepareStatements();
|
PrepareStatements();
|
||||||
|
|
||||||
|
@ -166,10 +170,14 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
"IsMovie",
|
"IsMovie",
|
||||||
"IsSports",
|
"IsSports",
|
||||||
"CommunityRating",
|
"CommunityRating",
|
||||||
"CustomRating"
|
"CustomRating",
|
||||||
|
"IndexNumber",
|
||||||
|
"IsLocked",
|
||||||
|
"Name",
|
||||||
|
"OfficialRating"
|
||||||
};
|
};
|
||||||
_saveItemCommand = _connection.CreateCommand();
|
_saveItemCommand = _connection.CreateCommand();
|
||||||
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11)";
|
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15)";
|
||||||
for (var i = 1; i <= saveColumns.Count; i++)
|
for (var i = 1; i <= saveColumns.Count; i++)
|
||||||
{
|
{
|
||||||
_saveItemCommand.Parameters.Add(_saveItemCommand, "@" + i.ToString(CultureInfo.InvariantCulture));
|
_saveItemCommand.Parameters.Add(_saveItemCommand, "@" + i.ToString(CultureInfo.InvariantCulture));
|
||||||
|
@ -276,6 +284,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
_saveItemCommand.GetParameter(index++).Value = item.CommunityRating;
|
_saveItemCommand.GetParameter(index++).Value = item.CommunityRating;
|
||||||
_saveItemCommand.GetParameter(index++).Value = item.CustomRating;
|
_saveItemCommand.GetParameter(index++).Value = item.CustomRating;
|
||||||
|
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.IndexNumber;
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.IsLocked;
|
||||||
|
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.Name;
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.OfficialRating;
|
||||||
|
|
||||||
_saveItemCommand.Transaction = transaction;
|
_saveItemCommand.Transaction = transaction;
|
||||||
|
|
||||||
_saveItemCommand.ExecuteNonQuery();
|
_saveItemCommand.ExecuteNonQuery();
|
||||||
|
|
|
@ -126,6 +126,9 @@
|
||||||
<Content Include="dashboard-ui\thirdparty\cordova\android\localassetmanager.js">
|
<Content Include="dashboard-ui\thirdparty\cordova\android\localassetmanager.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\thirdparty\cordova\ios\orientation.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\thirdparty\velocity.min.js">
|
<Content Include="dashboard-ui\thirdparty\velocity.min.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Reference in a new issue