Skip to content

Commit 1fd2d95

Browse files
authored
Merge branch 'c0re100:v5_0_x' into v5_0_x
2 parents be4fd43 + fce6849 commit 1fd2d95

File tree

137 files changed

+7977
-7892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+7977
-7892
lines changed

.github/workflows/build_appimage.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ prepare_ssl() {
187187
touch "/usr/src/openssl-${openssl_ver}/.unpack_ok"
188188
fi
189189
cd "/usr/src/openssl-${openssl_ver}"
190-
./Configure --openssldir=/etc/ssl
190+
./Configure no-tests --openssldir=/etc/ssl
191191
make -j$(nproc)
192192
make install_sw
193193
ldconfig
@@ -270,7 +270,8 @@ prepare_qt() {
270270

271271
preapare_libboost() {
272272
# build latest boost
273-
boost_ver="$(retry curl -ksSfL --compressed https://www.boost.org/users/download/ \| grep "'>Version\s*'" \| sed -r "'s/.*Version\s*([^<]+).*/\1/'" \| head -1)"
273+
# boost_ver="$(retry curl -ksSfL --compressed https://www.boost.org/users/download/ \| grep "'>Version\s*'" \| sed -r "'s/.*Version\s*([^<]+).*/\1/'" \| head -1)"
274+
boost_ver="1.86.0"
274275
echo "boost version ${boost_ver}"
275276
mkdir -p "/usr/src/boost-${boost_ver}"
276277
if [ ! -f "/usr/src/boost-${boost_ver}/.unpack_ok" ]; then

.github/workflows/cross_build.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ prepare_ssl() {
244244
touch "/usr/src/openssl-${openssl_ver}/.unpack_ok"
245245
fi
246246
cd "/usr/src/openssl-${openssl_ver}/"
247-
./Configure -static --openssldir=/etc/ssl --cross-compile-prefix="${CROSS_HOST}-" --prefix="${CROSS_PREFIX}" "${OPENSSL_COMPILER}"
247+
./Configure -static no-tests --openssldir=/etc/ssl --cross-compile-prefix="${CROSS_HOST}-" --prefix="${CROSS_PREFIX}" "${OPENSSL_COMPILER}"
248248
make -j$(nproc)
249249
make install_sw
250250
if [ -f "${CROSS_PREFIX}/lib64/libssl.a" ]; then
@@ -256,7 +256,8 @@ prepare_ssl() {
256256
}
257257

258258
prepare_boost() {
259-
boost_ver="$(retry curl -ksSL --compressed https://www.boost.org/users/download/ \| grep "'>Version\s*'" \| sed -r "'s/.*Version\s*([^<]+).*/\1/'" \| head -1)"
259+
# boost_ver="$(retry curl -ksSL --compressed https://www.boost.org/users/download/ \| grep "'>Version\s*'" \| sed -r "'s/.*Version\s*([^<]+).*/\1/'" \| head -1)"
260+
boost_ver="1.86.0"
260261
echo "Boost version ${boost_ver}"
261262
if [ ! -f "/usr/src/boost-${boost_ver}/.unpack_ok" ]; then
262263
boost_latest_url="https://sourceforge.net/projects/boost/files/boost/${boost_ver}/boost_${boost_ver//./_}.tar.bz2/download"

Changelog

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Mon Dec 16th 2024 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.0.3
2+
- BUGFIX: Discard obsolete "state update" events after torrent is reloaded (glassez)
3+
- BUGFIX: Fix incorrect SQL column definition (glassez)
4+
- BUGFIX: Avoid redundant requests of announce entries from libtorrent (glassez)
5+
- WEBUI: Fix removing tracker URL with '|' character (Thomas Piccirello)
6+
- WEBUI: Fix reloading page after login (Evgenii Ryshkov)
7+
- WEBAPI: Fix incorrect key in torrent creator (Bartu Özen)
8+
- RSS: Don't add duplicate episodes to previously matched (wavygecko)
9+
- RSS: Use cached current time when parsing RSS feed (glassez)
10+
- WINDOWS: Don't follow symlink when creating torrents on Windows (Chocobo1)
11+
- WINDOWS: NSIS: Update Italian translation (Giacomo411)
12+
113
Sun Nov 17th 2024 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.0.2
214
- BUGFIX: Remove trackers from previous category when moved to new one (glassez)
315
- BUGFIX: Fix `.torrent` file could not be deleted when torrent is canceled (glassez)

README.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,11 @@ Latest AppImage download: [qBittorrent-Enhanced-Edition-x86_64.AppImage](https:/
4141

4242
#### Debian (Maintainer: [Kolcha](https://github.com/Kolcha))
4343

44-
##### Qt5 variants (Debian 11 and above):
45-
4644
[GUI](https://software.opensuse.org//download.html?project=home%3Anikoneko%3Atest&package=qbittorrent-enhanced)
4745

4846
[nox](https://software.opensuse.org//download.html?project=home%3Anikoneko%3Atest&package=qbittorrent-enhanced-nox)
4947

50-
##### Qt6 variants (Debian Testing and above):
51-
52-
[GUI](https://software.opensuse.org//download.html?project=home%3Anikoneko%3Atest&package=qbittorrent-enhanced-qt6)
53-
54-
[nox](https://software.opensuse.org//download.html?project=home%3Anikoneko%3Atest&package=qbittorrent-enhanced-nox-qt6)
55-
56-
The one [repository](https://build.opensuse.org/project/show/home:nikoneko:test) contains all 4 variants listed above, links to specific packages are provided for convenience.
48+
The one [repository](https://build.opensuse.org/project/show/home:nikoneko:test) contains all variants, links to specific packages are provided for convenience.
5749

5850
#### openSUSE (Maintainer: [openSUSE Chinese Community](https://github.com/openSUSE-zh))
5951

dist/mac/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<key>CFBundlePackageType</key>
5656
<string>APPL</string>
5757
<key>CFBundleShortVersionString</key>
58-
<string>5.0.2</string>
58+
<string>5.0.3</string>
5959
<key>CFBundleExecutable</key>
6060
<string>${EXECUTABLE_NAME}</string>
6161
<key>CFBundleIdentifier</key>

dist/unix/org.qbittorrent.qBittorrent.desktop

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Name[ta]=qBittorrent
161161
GenericName[te]=క్యు బిట్ టొరెంట్ క్లయింట్
162162
Comment[te]=క్యు బిట్ టొరెంట్ తో ఫైల్స్ దిగుమతి చేసుకోండి , పంచుకోండి
163163
Name[te]=qBittorrent
164-
GenericName[th]=โปรแกรมบิตทอร์เรนต์
164+
GenericName[th]=ไคลเอนต์บิททอร์เรนต์
165165
Comment[th]=ดาวน์โหลดและแชร์ไฟล์ผ่านบิตทอร์เรนต์
166166
Name[th]=qBittorrent
167167
GenericName[tr]=BitTorrent istemcisi

dist/unix/org.qbittorrent.qBittorrent.metainfo.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@
6262
<url type="contribute">https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md</url>
6363
<content_rating type="oars-1.1"/>
6464
<releases>
65-
<release version="5.0.2" date="2024-11-17"/>
65+
<release version="5.0.3" date="2024-12-16"/>
6666
</releases>
6767
</component>

dist/windows/config.nsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
; 4.5.1.3 -> good
1515
; 4.5.1.3.2 -> bad
1616
; 4.5.0beta -> bad
17-
!define /ifndef QBT_VERSION "5.0.2.10"
17+
!define /ifndef QBT_VERSION "5.0.3.10"
1818

1919
; Option that controls the installer's window name
2020
; If set, its value will be used like this:

dist/windows/installer-translations/italian.nsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LangString launch_qbt ${LANG_ITALIAN} "Esegui qBittorrent."
2929
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
3030
LangString inst_requires_64bit ${LANG_ITALIAN} "Questo installer funziona solo con versioni di Windows a 64bit."
3131
;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
32-
LangString inst_requires_win10 ${LANG_ITALIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
32+
LangString inst_requires_win10 ${LANG_ITALIAN} "Questo installer richiede almeno Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_ITALIAN} "Disinstalla qBittorrent"
3535

src/base/bittorrent/dbresumedatastorage.cpp

+26-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace
6767
{
6868
const QString DB_CONNECTION_NAME = u"ResumeDataStorage"_s;
6969

70-
const int DB_VERSION = 7;
70+
const int DB_VERSION = 8;
7171

7272
const QString DB_TABLE_META = u"meta"_s;
7373
const QString DB_TABLE_TORRENTS = u"torrents"_s;
@@ -628,7 +628,31 @@ void BitTorrent::DBResumeDataStorage::updateDB(const int fromVersion) const
628628
}
629629

630630
if (fromVersion <= 6)
631-
addColumn(DB_TABLE_TORRENTS, DB_COLUMN_SHARE_LIMIT_ACTION, "TEXTNOT NULL DEFAULT `Default`");
631+
addColumn(DB_TABLE_TORRENTS, DB_COLUMN_SHARE_LIMIT_ACTION, "TEXT NOT NULL DEFAULT `Default`");
632+
633+
if (fromVersion == 7)
634+
{
635+
const QString TEMP_COLUMN_NAME = DB_COLUMN_SHARE_LIMIT_ACTION.name + u"_temp";
636+
637+
auto queryStr = u"ALTER TABLE %1 ADD %2 %3"_s
638+
.arg(quoted(DB_TABLE_TORRENTS), TEMP_COLUMN_NAME, u"TEXT NOT NULL DEFAULT `Default`");
639+
if (!query.exec(queryStr))
640+
throw RuntimeError(query.lastError().text());
641+
642+
queryStr = u"UPDATE %1 SET %2 = %3"_s
643+
.arg(quoted(DB_TABLE_TORRENTS), quoted(TEMP_COLUMN_NAME), quoted(DB_COLUMN_SHARE_LIMIT_ACTION.name));
644+
if (!query.exec(queryStr))
645+
throw RuntimeError(query.lastError().text());
646+
647+
queryStr = u"ALTER TABLE %1 DROP %2"_s.arg(quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_SHARE_LIMIT_ACTION.name));
648+
if (!query.exec(queryStr))
649+
throw RuntimeError(query.lastError().text());
650+
651+
queryStr = u"ALTER TABLE %1 RENAME %2 TO %3"_s
652+
.arg(quoted(DB_TABLE_TORRENTS), quoted(TEMP_COLUMN_NAME), quoted(DB_COLUMN_SHARE_LIMIT_ACTION.name));
653+
if (!query.exec(queryStr))
654+
throw RuntimeError(query.lastError().text());
655+
}
632656

633657
const QString updateMetaVersionQuery = makeUpdateStatement(DB_TABLE_META, {DB_COLUMN_NAME, DB_COLUMN_VALUE});
634658
if (!query.prepare(updateMetaVersionQuery))

src/base/bittorrent/sessionimpl.cpp

+16-19
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
#include <QJsonDocument>
6767
#include <QJsonObject>
6868
#include <QJsonValue>
69+
#include <QMutexLocker>
6970
#include <QNetworkAddressEntry>
7071
#include <QNetworkInterface>
7172
#include <QRegularExpression>
@@ -1674,7 +1675,7 @@ void SessionImpl::endStartup(ResumeSessionContext *context)
16741675
reannounceToAllTrackers();
16751676
}
16761677

1677-
m_wakeupCheckTimestamp = QDateTime::currentDateTime();
1678+
m_wakeupCheckTimestamp = now;
16781679
});
16791680
m_wakeupCheckTimestamp = QDateTime::currentDateTime();
16801681
m_wakeupCheckTimer->start(30s);
@@ -5728,8 +5729,6 @@ void SessionImpl::readAlerts()
57285729

57295730
// Some torrents may become "finished" after different alerts handling.
57305731
processPendingFinishedTorrents();
5731-
5732-
processTrackerStatuses();
57335732
}
57345733

57355734
void SessionImpl::handleAddTorrentAlert(const lt::add_torrent_alert *alert)
@@ -6405,7 +6404,12 @@ void SessionImpl::handleTrackerAlert(const lt::tracker_alert *alert)
64056404
if (!torrent)
64066405
return;
64076406

6407+
[[maybe_unused]] const QMutexLocker updatedTrackerStatusesLocker {&m_updatedTrackerStatusesMutex};
6408+
6409+
const auto prevSize = m_updatedTrackerStatuses.size();
64086410
QMap<int, int> &updateInfo = m_updatedTrackerStatuses[torrent->nativeHandle()][std::string(alert->tracker_url())][alert->local_endpoint];
6411+
if (prevSize < m_updatedTrackerStatuses.size())
6412+
updateTrackerEntryStatuses(torrent->nativeHandle());
64096413

64106414
if (alert->type() == lt::tracker_reply_alert::alert_type)
64116415
{
@@ -6467,17 +6471,6 @@ void SessionImpl::handleTorrentConflictAlert(const lt::torrent_conflict_alert *a
64676471
}
64686472
#endif
64696473

6470-
void SessionImpl::processTrackerStatuses()
6471-
{
6472-
if (m_updatedTrackerStatuses.isEmpty())
6473-
return;
6474-
6475-
for (auto it = m_updatedTrackerStatuses.cbegin(); it != m_updatedTrackerStatuses.cend(); ++it)
6476-
updateTrackerEntryStatuses(it.key(), it.value());
6477-
6478-
m_updatedTrackerStatuses.clear();
6479-
}
6480-
64816474
void SessionImpl::saveStatistics() const
64826475
{
64836476
if (!m_isStatisticsDirty)
@@ -6502,15 +6495,19 @@ void SessionImpl::loadStatistics()
65026495
m_previouslyUploaded = value[u"AlltimeUL"_s].toLongLong();
65036496
}
65046497

6505-
void SessionImpl::updateTrackerEntryStatuses(lt::torrent_handle torrentHandle, QHash<std::string, QHash<lt::tcp::endpoint, QMap<int, int>>> updatedTrackers)
6498+
void SessionImpl::updateTrackerEntryStatuses(lt::torrent_handle torrentHandle)
65066499
{
6507-
invokeAsync([this, torrentHandle = std::move(torrentHandle), updatedTrackers = std::move(updatedTrackers)]() mutable
6500+
invokeAsync([this, torrentHandle = std::move(torrentHandle)]() mutable
65086501
{
65096502
try
65106503
{
65116504
std::vector<lt::announce_entry> nativeTrackers = torrentHandle.trackers();
6512-
invoke([this, torrentHandle, nativeTrackers = std::move(nativeTrackers)
6513-
, updatedTrackers = std::move(updatedTrackers)]
6505+
6506+
QMutexLocker updatedTrackerStatusesLocker {&m_updatedTrackerStatusesMutex};
6507+
QHash<std::string, QHash<lt::tcp::endpoint, QMap<int, int>>> updatedTrackers = m_updatedTrackerStatuses.take(torrentHandle);
6508+
updatedTrackerStatusesLocker.unlock();
6509+
6510+
invoke([this, torrentHandle, nativeTrackers = std::move(nativeTrackers), updatedTrackers = std::move(updatedTrackers)]
65146511
{
65156512
TorrentImpl *torrent = m_torrents.value(torrentHandle.info_hash());
65166513
if (!torrent || torrent->isStopped())
@@ -6565,7 +6562,7 @@ void SessionImpl::handleRemovedTorrent(const TorrentID &torrentID, const QString
65656562
m_removingTorrents.erase(removingTorrentDataIter);
65666563
}
65676564

6568-
QDateTime SessionImpl::fromLTTimePoint32(const libtorrent::time_point32 &timePoint) const
6565+
QDateTime SessionImpl::fromLTTimePoint32(const lt::time_point32 &timePoint) const
65696566
{
65706567
const auto secsSinceNow = lt::duration_cast<lt::seconds>(timePoint - m_ltNow + lt::milliseconds(500)).count();
65716568
return m_qNow.addSecs(secsSinceNow);

src/base/bittorrent/sessionimpl.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <QElapsedTimer>
4242
#include <QHash>
4343
#include <QMap>
44+
#include <QMutex>
4445
#include <QPointer>
4546
#include <QSet>
4647
#include <QVector>
@@ -567,7 +568,6 @@ namespace BitTorrent
567568
void populateAdditionalTrackers();
568569
void enableIPFilter();
569570
void disableIPFilter();
570-
void processTrackerStatuses();
571571
void processTorrentShareLimits(TorrentImpl *torrent);
572572
void populateExcludedFileNamesRegExpList();
573573
void prepareStartup();
@@ -633,7 +633,7 @@ namespace BitTorrent
633633
void saveStatistics() const;
634634
void loadStatistics();
635635

636-
void updateTrackerEntryStatuses(lt::torrent_handle torrentHandle, QHash<std::string, QHash<lt::tcp::endpoint, QMap<int, int>>> updatedTrackers);
636+
void updateTrackerEntryStatuses(lt::torrent_handle torrentHandle);
637637

638638
void handleRemovedTorrent(const TorrentID &torrentID, const QString &partfileRemoveError = {});
639639

@@ -832,6 +832,7 @@ namespace BitTorrent
832832
// This field holds amounts of peers reported by trackers in their responses to announces
833833
// (torrent.tracker_name.tracker_local_endpoint.protocol_version.num_peers)
834834
QHash<lt::torrent_handle, QHash<std::string, QHash<lt::tcp::endpoint, QMap<int, int>>>> m_updatedTrackerStatuses;
835+
QMutex m_updatedTrackerStatusesMutex;
835836

836837
// I/O errored torrents
837838
QSet<TorrentID> m_recentErroredTorrents;

src/base/bittorrent/torrent.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,15 @@ namespace BitTorrent
215215
virtual int piecesCount() const = 0;
216216
virtual int piecesHave() const = 0;
217217
virtual qreal progress() const = 0;
218+
218219
virtual QDateTime addedTime() const = 0;
220+
virtual QDateTime completedTime() const = 0;
221+
virtual QDateTime lastSeenComplete() const = 0;
222+
virtual qlonglong activeTime() const = 0;
223+
virtual qlonglong finishedTime() const = 0;
224+
virtual qlonglong timeSinceUpload() const = 0;
225+
virtual qlonglong timeSinceDownload() const = 0;
226+
virtual qlonglong timeSinceActivity() const = 0;
219227

220228
// Share limits
221229
virtual qreal ratioLimit() const = 0;
@@ -254,20 +262,13 @@ namespace BitTorrent
254262
virtual QString error() const = 0;
255263
virtual qlonglong totalDownload() const = 0;
256264
virtual qlonglong totalUpload() const = 0;
257-
virtual qlonglong activeTime() const = 0;
258-
virtual qlonglong finishedTime() const = 0;
259265
virtual qlonglong eta() const = 0;
260266
virtual int seedsCount() const = 0;
261267
virtual int peersCount() const = 0;
262268
virtual int leechsCount() const = 0;
263269
virtual int totalSeedsCount() const = 0;
264270
virtual int totalPeersCount() const = 0;
265271
virtual int totalLeechersCount() const = 0;
266-
virtual QDateTime lastSeenComplete() const = 0;
267-
virtual QDateTime completedTime() const = 0;
268-
virtual qlonglong timeSinceUpload() const = 0;
269-
virtual qlonglong timeSinceDownload() const = 0;
270-
virtual qlonglong timeSinceActivity() const = 0;
271272
virtual int downloadLimit() const = 0;
272273
virtual int uploadLimit() const = 0;
273274
virtual bool superSeeding() const = 0;

src/base/bittorrent/torrentcreator.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <libtorrent/file_storage.hpp>
3737
#include <libtorrent/torrent_info.hpp>
3838

39+
#include <QtSystemDetection>
3940
#include <QDirIterator>
4041
#include <QFileInfo>
4142
#include <QHash>
@@ -123,7 +124,14 @@ void TorrentCreator::run()
123124
// need to sort the file names by natural sort order
124125
QStringList dirs = {m_params.sourcePath.data()};
125126

126-
QDirIterator dirIter {m_params.sourcePath.data(), (QDir::AllDirs | QDir::NoDotAndDotDot), QDirIterator::Subdirectories};
127+
#ifdef Q_OS_WIN
128+
// libtorrent couldn't handle .lnk files on Windows
129+
// Also, Windows users do not expect torrent creator to traverse into .lnk files so skip over them
130+
const QDir::Filters dirFilters {QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks};
131+
#else
132+
const QDir::Filters dirFilters {QDir::AllDirs | QDir::NoDotAndDotDot};
133+
#endif
134+
QDirIterator dirIter {m_params.sourcePath.data(), dirFilters, QDirIterator::Subdirectories};
127135
while (dirIter.hasNext())
128136
{
129137
const QString filePath = dirIter.next();
@@ -138,7 +146,12 @@ void TorrentCreator::run()
138146
{
139147
QStringList tmpNames; // natural sort files within each dir
140148

141-
QDirIterator fileIter {dir, QDir::Files};
149+
#ifdef Q_OS_WIN
150+
const QDir::Filters fileFilters {QDir::Files | QDir::NoSymLinks};
151+
#else
152+
const QDir::Filters fileFilters {QDir::Files};
153+
#endif
154+
QDirIterator fileIter {dir, fileFilters};
142155
while (fileIter.hasNext())
143156
{
144157
const QFileInfo fileInfo = fileIter.nextFileInfo();

0 commit comments

Comments
 (0)