From bf141b070036a55b91f7d0079c802f86897e3b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 8 Aug 2024 09:34:22 +0200 Subject: [PATCH 1/7] Improve logging in SoundSource::getTypeFromFile() --- src/sources/soundsource.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sources/soundsource.cpp b/src/sources/soundsource.cpp index 320efdaf12f..78cb7bf86ae 100644 --- a/src/sources/soundsource.cpp +++ b/src/sources/soundsource.cpp @@ -59,7 +59,11 @@ QString SoundSource::getTypeFromFile(const QFileInfo& fileInfo) { // type, using the generic type application/octet-stream as a fallback. // This might also occur for missing files as seen on Qt 5.12. if (!mimeType.isValid() || mimeType.isDefault()) { - qInfo() << "Unable to detect MIME type from file" << fileInfo.filePath(); + if (fileInfo.exists()) { + qInfo() << "Unable to detect MIME type from file" << fileInfo.filePath(); + } else { + qInfo() << "Unable to detect MIME type from not existing file" << fileInfo.filePath(); + } mimeType = QMimeDatabase().mimeTypeForFile( fileInfo, QMimeDatabase::MatchExtension); if (!mimeType.isValid() || mimeType.isDefault()) { From 16bd1ba520b326be533f797f4abdcb8d0f00b748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 8 Aug 2024 18:35:40 +0200 Subject: [PATCH 2/7] Add new random tracks if a track is not loadable. --- src/library/autodj/autodjprocessor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index fe632109e5b..14be1ed44a7 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -899,6 +899,8 @@ TrackPointer AutoDJProcessor::getNextTrackFromQueue() { // Remove missing song from auto DJ playlist. m_pAutoDJTableModel->removeTrack( m_pAutoDJTableModel->index(0, 0)); + // Don't "Requeue" missing tracks to avoid andless loops + maybeFillRandomTracks(); } } else { // We're out of tracks. Return the null TrackPointer. From cb76b0a334fdbbf46eb5c799f0ebae2b624a2954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 9 Aug 2024 08:30:13 +0200 Subject: [PATCH 3/7] Log a warning if Auto DJ skips a track --- src/library/autodj/autodjprocessor.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index 14be1ed44a7..4bb57bd5d1b 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -889,14 +889,15 @@ TrackPointer AutoDJProcessor::getNextTrackFromQueue() { } while (true) { - TrackPointer nextTrack = m_pAutoDJTableModel->getTrack( - m_pAutoDJTableModel->index(0, 0)); + TrackPointer pNextTrack = m_pAutoDJTableModel->getTrack( + m_pAutoDJTableModel->index(0, 0)); - if (nextTrack) { - if (nextTrack->getFileInfo().checkFileExists()) { - return nextTrack; + if (pNextTrack) { + if (pNextTrack->getFileInfo().checkFileExists()) { + return pNextTrack; } else { - // Remove missing song from auto DJ playlist. + // Remove missing track from auto DJ playlist. + qWarning() << "Auto DJ: Skip missing track" << pNextTrack->getLocation(); m_pAutoDJTableModel->removeTrack( m_pAutoDJTableModel->index(0, 0)); // Don't "Requeue" missing tracks to avoid andless loops @@ -904,7 +905,7 @@ TrackPointer AutoDJProcessor::getNextTrackFromQueue() { } } else { // We're out of tracks. Return the null TrackPointer. - return nextTrack; + return pNextTrack; } } } From 709376d2692358a1074f47eee418a31fa82e213a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 9 Aug 2024 08:32:00 +0200 Subject: [PATCH 4/7] Fail early when trying to read metadata from an inaccessible file --- src/sources/soundsourceproxy.cpp | 7 +++++++ src/track/trackrecord.cpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/sources/soundsourceproxy.cpp b/src/sources/soundsourceproxy.cpp index 4ec589cd21c..abd948291b8 100644 --- a/src/sources/soundsourceproxy.cpp +++ b/src/sources/soundsourceproxy.cpp @@ -656,6 +656,13 @@ SoundSourceProxy::UpdateTrackFromSourceResult SoundSourceProxy::updateTrackFromS mixxx::TrackMetadata trackMetadata = m_pTrack->getMetadata(&sourceSyncStatus); + if (sourceSyncStatus == mixxx::TrackRecord::SourceSyncStatus::Undefined) { + kLogger.warning() + << "Unable to update track from missing or inaccessible file" + << getUrl().toString(); + return UpdateTrackFromSourceResult::NotUpdated; + } + // Save for later to replace the unreliable and imprecise audio // properties imported from file tags (see below). const auto preciseStreamInfo = trackMetadata.getStreamInfo(); diff --git a/src/track/trackrecord.cpp b/src/track/trackrecord.cpp index 521abee151d..090d18d9288 100644 --- a/src/track/trackrecord.cpp +++ b/src/track/trackrecord.cpp @@ -161,6 +161,12 @@ TrackRecord::SourceSyncStatus TrackRecord::checkSourceSyncStatus( // 37 don't have a synchronization time stamp. return SourceSyncStatus::Unknown; } + if (!fileInfo.exists()) { + kLogger.warning() + << "Failed to obtain synchronization time stamp for not existing file" + << mixxx::FileInfo(fileInfo); + return SourceSyncStatus::Undefined; + } const QDateTime fileSourceSynchronizedAt = MetadataSource::getFileSynchronizedAt(fileInfo.toQFile()); if (!fileSourceSynchronizedAt.isValid()) { From fdc63e133235985bc8b8fd8f3921c04476efd794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 5 Dec 2024 13:30:27 +0100 Subject: [PATCH 5/7] chore: upgrade macos runner to macos-13 Ventura and xcode15 This applies again failing changes form #13606. Since macos-12 is no longer available we hav no other chance. I apply this to 2.4 to keep the CI allive. until 2.5.0 is finally released. --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b5e8e3bee4..a280ac071e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,8 +60,8 @@ jobs: artifacts_path: build/*.deb artifacts_slug: ubuntu-jammy qt_qpa_platform: offscreen - - name: macOS 12 x64 - os: macos-12 + - name: macOS 13 x64 + os: macos-13 cmake_args: >- -DBULK=ON -DCOREAUDIO=ON @@ -83,8 +83,8 @@ jobs: artifacts_path: build/*.dmg artifacts_slug: macos-macosintel qt_qpa_platform: offscreen - - name: macOS 12 arm64 - os: macos-12 + - name: macOS 13 arm64 + os: macos-13 cmake_args: >- -DBULK=ON -DCOREAUDIO=ON From 8a063691647ac0506097aa76566817bdf7ec1c9d Mon Sep 17 00:00:00 2001 From: fwcd Date: Fri, 6 Dec 2024 04:03:44 +0100 Subject: [PATCH 6/7] CI: Use retry loop for CPack to work around macOS issue --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a280ac071e7..517a87128dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -351,8 +351,15 @@ jobs: - name: "Package" if: matrix.cpack_generator != null - run: cpack -G ${{ matrix.cpack_generator }} -V - working-directory: build + # Use retry loop to work around a race condition on macOS causing + # 'Resource busy' errors with 'hdiutil'. See + # https://github.com/actions/runner-images/issues/7522 + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 12 + retry_wait_seconds: 1 + command: cd build && cpack -G ${{ matrix.cpack_generator }} -V - name: "[Ubuntu] Import PPA GPG key" if: startsWith(matrix.os, 'ubuntu') && env.RRYAN_AT_MIXXX_DOT_ORG_GPG_PRIVATE_KEY != null From 43905f8e7dab2dc03f95ebf813fea8e3ec8ac0d2 Mon Sep 17 00:00:00 2001 From: fwcd Date: Fri, 6 Dec 2024 04:41:40 +0100 Subject: [PATCH 7/7] CI: Fix shell syntax on Windows --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 517a87128dc..e17c68195c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -359,7 +359,9 @@ jobs: timeout_minutes: 30 max_attempts: 12 retry_wait_seconds: 1 - command: cd build && cpack -G ${{ matrix.cpack_generator }} -V + command: | + cd build + cpack -G ${{ matrix.cpack_generator }} -V - name: "[Ubuntu] Import PPA GPG key" if: startsWith(matrix.os, 'ubuntu') && env.RRYAN_AT_MIXXX_DOT_ORG_GPG_PRIVATE_KEY != null