mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Use unique temp directories
Save torrent in temp_path/<torrent_hash> directory. Closes #5154.
This commit is contained in:
@@ -331,6 +331,11 @@ QString Session::tempPath() const
|
||||
return m_tempPath;
|
||||
}
|
||||
|
||||
QString Session::torrentTempPath(const InfoHash &hash) const
|
||||
{
|
||||
return m_tempPath + QString(hash) + "/";
|
||||
}
|
||||
|
||||
bool Session::isValidCategoryName(const QString &name)
|
||||
{
|
||||
QRegExp re(R"(^([^\\\/]|[^\\\/]([^\\\/]|\/(?=[^\/]))*[^\\\/])$)");
|
||||
@@ -1398,7 +1403,7 @@ bool Session::findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) c
|
||||
|
||||
bool found = findInDir(savePath, torrentInfo);
|
||||
if (!found && isTempPathEnabled()) {
|
||||
savePath = m_tempPath;
|
||||
savePath = torrentTempPath(torrentInfo.hash());
|
||||
found = findInDir(savePath, torrentInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user