WebUI: Change ServerPathSeparator to be a getter function#24694
Open
vafada wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Easy to test this on non-windows machine, just hardcode qBittorrent/src/webui/api/appcontroller.cpp Lines 100 to 109 in 52d3a96 Try the new |
vafada
marked this pull request as ready for review
July 15, 2026 03:34
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.
This PR #24678 is implemented wrong
1. the
ServerPathSeparatorforwindowswill never be\When
filesystem.jsis included theIIFE (Immediately Invoked Function Expression)is immediately called but the call to thebuildInfoapi might not resolve yet:qBittorrent/src/webui/www/private/scripts/cache.js
Lines 53 to 74 in 52d3a96
so
window.qBittorrent?.Cache.buildInfo.get().platformwill beundefinedandServerPathSeparatorwill be stuck at/To fix this, I replaced the constant to be a getter function
2.
filesystem.jsnow depends onwindow.qBittorrent.Cache. But there are several html files that includesfilesystem.jsbut never includescache.js. This broke a couple of features in the WebUI with a javascript error.Add Torrent File...andAdd Torrent Link...Rename filelinkAgain, the
IIFE (Immediately Invoked Function Expression)infilesystem.jsis invoked butwindow.qBittorrent?.Cacheisundefined.The optional chaining operator must be
window.qBittorrent.Cache?.buildInfo(after theCacheobject), though changing it to a getter function resolves this.I still added
<script defer src="scripts/cache.js?v=${CACHEID}"></script>to all files that includesfilesystem.jssincefilesystem.jsnow depends onwindow.qBittorrent.Cache