Skip to content

Commit

Permalink
Fix hours missing from total duration in logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
enzo1982 committed Feb 18, 2024
1 parent 881237c commit df60791
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions Readme
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ History
- fixed reading/writing of unencoded string fields from/to ID3v2 tags
- fixed delete/shutdown after encoding options not changing when switching configuration
- fixed ripping automation options not being available after switching configuration
- fixed hours missing from total duration in logs

- Updated codecs

Expand Down
1 change: 1 addition & 0 deletions Readme.de
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Geschichte
- Problem beim Lesen/Schreiben von unkodierten String-Feldern aus/in ID3v2-Tags behoben
- Problem mit Optionen zum Löschen von Dateien und zum Herunterfahren nach der Kodierung beim Wechsel der Konfiguration behoben
- Problem mit nicht verfügbaren Ripping-Automatisierungsoptionen nach Wechsel der Konfiguration behoben
- Problem mit fehlenden Stunden bei Gesamtzeit in Log-Dateien behoben

- Aktualisierte Codecs

Expand Down
4 changes: 1 addition & 3 deletions src/engine/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,7 @@ Void freac::ConvertWorker::LogConversionEnd(const String &uri, Int64 trackLength
if (!Threads::Access::Value(cancel))
{
UnsignedInt64 ticks = S::System::System::Clock() - trackStartTicks;
String duration = String(ticks / 1000 / 60 % 60 < 10 ? "0" : "").Append(String::FromInt(ticks / 1000 / 60 % 60)).Append(":")
.Append(ticks / 1000 % 60 < 10 ? "0" : "").Append(String::FromInt(ticks / 1000 % 60 )).Append(".")
.Append(ticks % 1000 < 100 ? (ticks % 1000 < 10 ? "00" : "0") : "").Append(String::FromInt(ticks % 1000 ));
String duration = BoCA::Utilities::ConvertTicksToTimestamp(ticks);
String speed = String::FromFloat(Math::Round(Float(trackLength) / trackToConvert.GetFormat().rate / (Float(ticks) / 1000.0) * 10.0) / 10.0);

if (!speed.Contains(".")) speed.Append(".0");
Expand Down
4 changes: 1 addition & 3 deletions src/jobs/engine/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,9 +1331,7 @@ Error freac::JobConvert::Perform()
/* Log conversion duration and speed.
*/
UnsignedInt64 ticks = S::System::System::Clock() - startTicks;
String duration = String(ticks / 1000 / 60 % 60 < 10 ? "0" : "").Append(String::FromInt(ticks / 1000 / 60 % 60)).Append(":")
.Append(ticks / 1000 % 60 < 10 ? "0" : "").Append(String::FromInt(ticks / 1000 % 60 )).Append(".")
.Append(ticks % 1000 < 100 ? (ticks % 1000 < 10 ? "00" : "0") : "").Append(String::FromInt(ticks % 1000 ));
String duration = BoCA::Utilities::ConvertTicksToTimestamp(ticks);
String speed = String::FromFloat(Math::Round(totalSeconds / (Float(ticks) / 1000.0) * 10.0) / 10.0);

if (!speed.Contains(".")) speed.Append(".0");
Expand Down

0 comments on commit df60791

Please sign in to comment.