diff options
| author | Bond_009 <Bond.009@outlook.com> | 2019-03-27 16:26:33 +0100 |
|---|---|---|
| committer | Bond_009 <Bond.009@outlook.com> | 2019-03-27 16:26:33 +0100 |
| commit | b647959ec41373c513ee55075e4c973bfb68dbcd (patch) | |
| tree | fd4843755ce3f6486019c412d711ff9d477ad2e4 | |
| parent | ca37ca291fb06e8b46257ae1dbc0f2786c948d36 (diff) | |
Add EnableOutputInSubFolder back
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/JobLogger.cs | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 674f3170e..cde6f725a 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -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"; diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs index d0d5ebfd6..ac989f6ba 100644 --- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs +++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs @@ -99,7 +99,7 @@ namespace MediaBrowser.Controller.MediaEncoding { var currentMs = startMs + val.TotalMilliseconds; - percent = 100 * currentMs / totalMs; + percent = 100.0 * currentMs / totalMs; transcodingPosition = val; } |
