diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-06-24 20:28:57 -0400 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2024-06-24 20:28:57 -0400 |
| commit | ac114b27a9c27e46e2f3943bf276c86554215d27 (patch) | |
| tree | af128da82a544f9ecc6ffeafdc285292c780065f | |
| parent | 17d7f5f88e9ca1cfb6b1618f06afbfc75ffde0c5 (diff) | |
Backport pull request #11911 from jellyfin/release-10.9.z
Log album name and id in normalization task
Original-merge: c9b6ebd94fd6e91ea8da2931c7604350343da5bf
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
| -rw-r--r-- | Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs index 7f3a8e291..df0fdcab8 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs @@ -106,13 +106,20 @@ public partial class AudioNormalizationTask : IScheduledTask continue; } - var tempFile = Path.Join(_configurationManager.GetTranscodePath(), Guid.NewGuid() + ".concat"); + _logger.LogInformation("Calculating LUFS for album: {Album} with id: {Id}", a.Name, a.Id); + var tempFile = Path.Join(_configurationManager.GetTranscodePath(), a.Id + ".concat"); var inputLines = albumTracks.Select(x => string.Format(CultureInfo.InvariantCulture, "file '{0}'", x.Path.Replace("'", @"'\''", StringComparison.Ordinal))); await File.WriteAllLinesAsync(tempFile, inputLines, cancellationToken).ConfigureAwait(false); - a.LUFS = await CalculateLUFSAsync( - string.Format(CultureInfo.InvariantCulture, "-f concat -safe 0 -i \"{0}\"", tempFile), - cancellationToken).ConfigureAwait(false); - File.Delete(tempFile); + try + { + a.LUFS = await CalculateLUFSAsync( + string.Format(CultureInfo.InvariantCulture, "-f concat -safe 0 -i \"{0}\"", tempFile), + cancellationToken).ConfigureAwait(false); + } + finally + { + File.Delete(tempFile); + } } _itemRepository.SaveItems(albums, cancellationToken); |
