mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 10:43:30 +01:00
add db startup error handling
This commit is contained in:
@@ -126,14 +126,10 @@ namespace MediaBrowser.Api.Playback
|
||||
/// <summary>
|
||||
/// Gets the output file path.
|
||||
/// </summary>
|
||||
/// <param name="state">The state.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetOutputFilePath(StreamState state)
|
||||
private string GetOutputFilePath(StreamState state, string outputFileExtension)
|
||||
{
|
||||
var folder = ServerConfigurationManager.ApplicationPaths.TranscodingTempPath;
|
||||
|
||||
var outputFileExtension = GetOutputFileExtension(state);
|
||||
|
||||
var data = GetCommandLineArguments("dummy\\dummy", state, false);
|
||||
|
||||
data += "-" + (state.Request.DeviceId ?? string.Empty);
|
||||
@@ -802,7 +798,7 @@ namespace MediaBrowser.Api.Playback
|
||||
{
|
||||
state.User = UserManager.GetUserById(auth.UserId);
|
||||
}
|
||||
|
||||
|
||||
//if ((Request.UserAgent ?? string.Empty).IndexOf("iphone", StringComparison.OrdinalIgnoreCase) != -1 ||
|
||||
// (Request.UserAgent ?? string.Empty).IndexOf("ipad", StringComparison.OrdinalIgnoreCase) != -1 ||
|
||||
// (Request.UserAgent ?? string.Empty).IndexOf("ipod", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
@@ -876,11 +872,16 @@ namespace MediaBrowser.Api.Playback
|
||||
|
||||
var container = Path.GetExtension(state.RequestedUrl);
|
||||
|
||||
if (string.IsNullOrEmpty(container))
|
||||
{
|
||||
container = request.Container;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(container))
|
||||
{
|
||||
container = request.Static ?
|
||||
state.InputContainer :
|
||||
(Path.GetExtension(GetOutputFilePath(state)) ?? string.Empty).TrimStart('.');
|
||||
GetOutputFileExtension(state);
|
||||
}
|
||||
|
||||
state.OutputContainer = (container ?? string.Empty).TrimStart('.');
|
||||
@@ -923,7 +924,10 @@ namespace MediaBrowser.Api.Playback
|
||||
ApplyDeviceProfileSettings(state);
|
||||
}
|
||||
|
||||
state.OutputFilePath = GetOutputFilePath(state);
|
||||
var ext = string.IsNullOrWhiteSpace(state.OutputContainer)
|
||||
? GetOutputFileExtension(state)
|
||||
: ("." + state.OutputContainer);
|
||||
state.OutputFilePath = GetOutputFilePath(state, ext);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user