mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 14:04:23 +00:00
- Fix "Append .!qB extension" feature. It appeared only for empty files (instead of incomplete ones)
This commit is contained in:
parent
c87a0bde0b
commit
475d63dad8
@ -1300,7 +1300,8 @@ void Bittorrent::appendqBextensionToTorrent(QTorrentHandle h, bool append) {
|
|||||||
h.file_progress(fp);
|
h.file_progress(fp);
|
||||||
for(int i=0; i<h.num_files(); ++i) {
|
for(int i=0; i<h.num_files(); ++i) {
|
||||||
if(append) {
|
if(append) {
|
||||||
if(fp[i] < 1.) {
|
qulonglong file_size = h.filesize_at(i);
|
||||||
|
if(file_size > 0 && (fp[i]/(double)file_size) < 1.) {
|
||||||
QString name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
QString name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
||||||
if(!name.endsWith(".!qB")) {
|
if(!name.endsWith(".!qB")) {
|
||||||
qDebug("Renaming %s to %s", name.toLocal8Bit().data(), (name+".!qB").toLocal8Bit().data());
|
qDebug("Renaming %s to %s", name.toLocal8Bit().data(), (name+".!qB").toLocal8Bit().data());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user