Repository navigation
feat: Check GitHub for a newer release at startup - #68
Merged
Merged
Conversation
Add libcurl4-openssl-dev to the build dependencies that the Ubuntu setup installs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set ENABLE_FRONTEND_API and ENABLE_QT to true in the template preset that every configure preset inherits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When OBS finishes loading, a worker thread asks the GitHub API for the latest release and compares its X.Y.Z tag with the plugin version. For a newer release that has a file for this platform with a sha256 digest, the plugin asks whether to download it. The file is saved to the Downloads folder and kept only when its sha256 matches the digest; a file already there with that sha256 is used as it is. Then, on Windows and macOS, the plugin asks whether to start the installer, and on Linux it shows where the package is and offers to open the folder. The requests use libcurl, linked when ENABLE_FRONTEND_API and ENABLE_QT are on, because the Qt that OBS Studio 33.0.1 ships on Windows has no TLS backend. The Tools menu gets a checkable item that turns the check at startup on or off; it is on until turned off, and the choice is stored in the plugin's config.json. Unloading the plugin stops a running request and waits for the worker thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a section on the update check at startup, its Tools menu item, the confirmation before the download, the sha256 check and the installer prompt to the English and Japanese READMEs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
semnil
force-pushed
the
feat/update-check
branch
from
November 1, 2026 05:12
e93da25 to
d6cccb2
Compare
QStandardPaths can return a Downloads folder that does not exist, and QSaveFile does not create the folder, so the download stopped with a log line. Use the temporary folder when the Downloads folder is not an existing directory, and say so in the READMEs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The temporary folder that downloads fell back to is /tmp on Linux, which other users can write to. Fall back to the plugin's folder in the OBS settings folder instead, which belongs to the current user and is created when it is missing, and say so in the READMEs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file already at the download path was reused when its sha256 matched. Reuse it only when it is a regular file, not a symbolic link, and, outside Windows, owned by the current user. The sha256 helper moves to src/update-version.hpp with this check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Iterating a QJsonArray yields temporaries, and binding them to a const QJsonValue reference is an error with clang under -Werror (-Wrange-loop-bind-reference), which stopped the macOS build. Take each value by value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
At startup the plugin checks GitHub for a newer release. When there is one, it asks before downloading it, checks the downloaded file against the SHA-256 that GitHub reports, and asks before starting the installer.
Behavior
OBS_FRONTEND_EVENT_FINISHED_LOADING), a worker thread requestshttps://api.github.com/repos/semnil/MixTrack2Source/releases/latestand compares itstag_namewith the plugin version. Only theX.Y.Zform is compared, the form.github/scripts/release-tag-shapeaccepts for a release that is not a prerelease;releases/latestdoes not return prereleases.-windows-x64-Installer.exe,-macos-universal.pkg,-x86_64-linux-gnu.deb, mirroring the names thatPackage-Windows.ps1,package-macosandCPACK_PACKAGE_FILE_NAMEproduce). It needs an https URL and asha256:digest in the API response.Mix Track to Source %1 is available. Download it?(Mix Track to Source %1 が公開されています。ダウンロードしますか?) with Download and Later.QSaveFileto the Downloads folder, or to the plugin's folder in the OBS settings folder (plugin_config/mix-track-to-source) when the Downloads folder does not exist. Both belong to the current user; a temporary folder that other users can write to (/tmpon Linux) is not used. The file is kept only when its SHA-256 matches the digest.QDesktopServices::openUrl.sudo dpkg -i. Open Folder opens the folder.plugin_config/mix-track-to-source/config.json.Build
ENABLE_FRONTEND_APIandENABLE_QTare on in the template preset. The update check is compiled only when both are on (ENABLE_UPDATE_CHECK).CURL::libcurl), not Qt Network. With the Qt DLLs and plugin folder of OBS Studio 33.0.1 on Windows, Qt 6.11.1 has no TLS backend and an HTTPS request fails withTLS initialization failed. obs-deps has libcurl 8.12.1 for Windows, and OBS shipslibcurl.dll.libcurl4-openssl-dev.Impact
KERNEL32.dll,MSVCP140.dll,Qt6Core.dll,Qt6Gui.dll,Qt6Widgets.dll,VCRUNTIME140.dll,VCRUNTIME140_1.dll,api-ms-win-crt-heap-l1-1-0.dll,api-ms-win-crt-runtime-l1-1-0.dll,api-ms-win-crt-stdio-l1-1-0.dll,libcurl.dll,obs-frontend-api.dllandobs.dll; the OBS and Qt ones are in OBS Studio 33.0.1'sbin\64bit, andMSVCP140.dllis inSystem32.X-RateLimit-Limit).obs_frontend_add_event_callbackat run time instead of linking obs-frontend-api; this change links it. Both add a call beforeobs_log(LOG_INFO, "plugin unloaded")inobs_module_unload, sogit merge-tree --write-treereports a conflict insrc/plugin-main.cthere; keeping both calls resolves it. fix: Keep the input track out of the plugin's outputs when they are set #66 merges without conflicts.git merge-tree --write-tree).Verification
cmake --preset windows-x64 -DCMAKE_COMPILE_WARNING_AS_ERROR=ON,cmake --buildandcmake --installpass. clang-format 19.1.1 (the version CI requires) reports no changes forsrc/plugin-main.c,src/update-check.cpp,src/update-check.handsrc/update-version.hpp; gersemi 0.21.0 reports none forCMakeLists.txt.supportsSsl0 andTLS initialization failedfor the request above. The same program with obs-deps' Qt 6.8.3 and its plugin folder reportscert-only,schanneland HTTP 200.src/update-version.hpppasses its checks:v1.0.2,1.0,1.0.2.3,1.0.2-rc1, a trailing newline, a leading space, an empty tag, an overflowing number and a negative one.releases/latest(1.0.2), from which it picks the Windows, macOS and Ubuntu files with their digests.v1.0.2,1.0.2.3,1.0.2-rc1, the trailing newline and the leading space are accepted, and those checks fail. Without the existence check, the missing folder and the file path keep the preferred path. Comparing only that the file can be read, the file with another SHA-256 and the empty SHA-256 are reused.QSaveFile::openfails for a path whose parent folder does not exist (OpenError, 「指定されたパスが見つかりません。」), which is what the Downloads fallback avoids.OBS_PLUGINS_PATH:plugin loaded successfully (version 1.0.1),update 1.0.2 is available, then, after Download,downloading update as mix-track-to-source-1.0.2-windows-x64-Installer.exeanddownloaded update as mix-track-to-source-1.0.2-windows-x64-Installer.exed17801b540c76932963794ef7e3256e958a7565024bcd0401a49fc5b9d9121e5, the size anddigestthat the API reports for the release filesrc/update-check.cppwere renamed (CONNECT_TIMEOUT_SECONDS,LOW_SPEED_TIME_SECONDS), a comment insrc/update-version.hppwas extended, and the fallback folder and reuse checks above were addedmasterat e95a844 (which contains this change) in Docker, with the obsproject PPA's OBS onubuntu:24.04(32.2.0) andubuntu:26.04(33.0.0): every OBS start under Xvfb logs[mix-track-to-source] no update (latest release 1.0.2), whichcheck_for_updatelogs only afterfetchhas returned the latest release and its tag has been compared with the installed version.src/update-version.hppwith Ubuntu's Qt 6 pass all their checks: a regular file of the current user with the expected SHA-256 is reused, while a symbolic link to such a file and a matching file owned by uid 65534 are not.🤖 Generated with Claude Code