From 345e8228aba96d47b62f8ebea15e44e696bac8ab Mon Sep 17 00:00:00 2001 From: emeric Date: Mon, 21 Jul 2025 23:55:53 +0200 Subject: [PATCH] Fixed freebsd build + added some ci basic checks, fixes #717 --- .github/workflows/build-freebsd-basic.yml | 20 +++++++++++++++++++ .../scanner/impl/steps/ScanStepScanFiles.cpp | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-freebsd-basic.yml diff --git a/.github/workflows/build-freebsd-basic.yml b/.github/workflows/build-freebsd-basic.yml new file mode 100644 index 00000000..9e20df03 --- /dev/null +++ b/.github/workflows/build-freebsd-basic.yml @@ -0,0 +1,20 @@ +name: Basic Build (FreeBSD) +on: [pull_request] +jobs: + Build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build + uses: vmactions/freebsd-vm@v1.2.1 + with: + usesh: true + prepare: | + pkg install -y cmake pkgconf boost-libs ffmpeg stb libconfig taglib libarchive xxhash wt googletest + + run: | + mkdir build + cd build + cmake .. -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DBUILD_BENCHMARKS=OFF + make -j$(nproc) + make test diff --git a/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp b/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp index 85af7f8c..3953a318 100644 --- a/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp +++ b/src/libs/services/scanner/impl/steps/ScanStepScanFiles.cpp @@ -127,10 +127,12 @@ namespace lms::scanner continue; FileToScan fileToScan; - fileToScan.filePath = file.path(); fileToScan.mediaLibrary = _mediaLibrary; - fileToScan.lastWriteTime.setTime_t(Wt::WDateTime{ std::chrono::file_clock::to_sys(file.last_write_time()) }.toTime_t()); // sec resolution, as stored in the database + { + const std::chrono::system_clock::time_point lastWriteTime{ std::chrono::time_point_cast(std::chrono::file_clock::to_sys(file.last_write_time())) }; + fileToScan.lastWriteTime.setTime_t(std::chrono::system_clock::to_time_t(lastWriteTime)); // sec resolution, as stored in the database + } fileToScan.fileSize = file.file_size(); if (_fullScan || scanner->needsScan(fileToScan))