Add EnableOutputInSubFolder back

This commit is contained in:
Bond_009 2019-03-27 16:26:33 +01:00
parent ca37ca291f
commit b647959ec4
2 changed files with 11 additions and 3 deletions

View File

@ -32,6 +32,8 @@ namespace MediaBrowser.Api.Playback
{
protected static readonly CultureInfo UsCulture = CultureInfo.ReadOnly(new CultureInfo("en-US"));
protected virtual bool EnableOutputInSubFolder => false;
/// <summary>
/// Gets or sets the application paths.
/// </summary>
@ -142,10 +144,16 @@ namespace MediaBrowser.Api.Playback
data += "-" + (state.Request.DeviceId ?? string.Empty)
+ "-" + (state.Request.PlaySessionId ?? string.Empty);
var filename = data.GetMD5().ToString("N") + outputFileExtension.ToLowerInvariant();
var filename = data.GetMD5().ToString("N");
var ext = outputFileExtension.ToLowerInvariant();
var folder = ServerConfigurationManager.ApplicationPaths.TranscodingTempPath;
return Path.Combine(folder, filename);
if (EnableOutputInSubFolder)
{
return Path.Combine(folder, filename, filename + ext);
}
return Path.Combine(folder, filename + ext);
}
protected virtual string GetDefaultH264Preset() => "superfast";

View File

@ -99,7 +99,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
var currentMs = startMs + val.TotalMilliseconds;
percent = 100 * currentMs / totalMs;
percent = 100.0 * currentMs / totalMs;
transcodingPosition = val;
}