diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 852bc3a8b72..39f2b52fcd7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ default_language_version: rust: 1.64.0 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: fix-byte-order-marker exclude: ^.*(\.cbproj|\.groupproj|\.props|\.sln|\.vcxproj|\.vcxproj.filters|UTF-8-BOM.txt)$ @@ -51,7 +51,7 @@ repos: # protect main and any branch that has a semver-like name args: [-b, main, -p, '^\d+\.\d+(?:\.\d+)?$'] - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.3.0 hooks: - id: codespell args: @@ -66,7 +66,7 @@ repos: ] exclude: ^(packaging/wix/LICENSE.rtf.in|src/dialog/dlgabout\.cpp|.*\.(?:pot?|(? samples) { SINT AnalyzerSilence::findLastSoundInChunk(std::span samples) { // -1 is required, because the distance from the fist sample index (0) to crend() is 1, SINT ret = std::distance(first_sound(samples.rbegin(), samples.rend()), samples.rend()) - 1; - if (ret == -1) { - ret = samples.size(); - } return ret; } @@ -98,7 +95,7 @@ bool AnalyzerSilence::processSamples(const CSAMPLE* pIn, SINT count) { } if (m_signalStart >= 0) { const SINT lastSoundSample = findLastSoundInChunk(samples); - if (lastSoundSample < count - 1) { // not only sound or silence + if (lastSoundSample >= 0) { m_signalEnd = m_framesProcessed + lastSoundSample / m_channelCount + 1; } } diff --git a/src/library/export/engineprimeexportjob.cpp b/src/library/export/engineprimeexportjob.cpp index b1e4775ae59..d45fded1a9b 100644 --- a/src/library/export/engineprimeexportjob.cpp +++ b/src/library/export/engineprimeexportjob.cpp @@ -563,7 +563,11 @@ void EnginePrimeExportJob::run() { qWarning() << "Failed to export track" << m_pLastLoadedTrack->getId().toString() << ":" << e.what(); - m_lastErrorMessage = e.what(); + //: %1 is the artist %2 is the title and %3 is the original error message + m_lastErrorMessage = tr("Failed to export track %1 - %2:\n%3") + .arg(m_pLastLoadedTrack->getArtist(), + m_pLastLoadedTrack->getTitle(), + e.what()); emit failed(m_lastErrorMessage); return; } diff --git a/src/library/export/libraryexporter.cpp b/src/library/export/libraryexporter.cpp index 5cefd97dfa4..fd46f841cd2 100644 --- a/src/library/export/libraryexporter.cpp +++ b/src/library/export/libraryexporter.cpp @@ -64,9 +64,7 @@ void LibraryExporter::beginEnginePrimeExport( &EnginePrimeExportJob::failed, this, [](const QString& message) { - QMessageBox::critical(nullptr, - tr("Export Failed"), - QString{tr("Export failed: %1")}.arg(message)); + QMessageBox::critical(nullptr, tr("Export Failed"), message); }); // Construct a dialog to monitor job progress and offer cancellation.