mirror of
https://github.com/c0re100/qBittorrent-Enhanced-Edition.git
synced 2025-01-07 03:16:40 +08:00
Try to recover missing tags
Tags can go missing from config/resume data. Try to recover them to avoid inconsistent behavior. Original PR: #17290.
This commit is contained in:
parent
26d78f6462
commit
b53eadaec8
@ -4537,6 +4537,24 @@ void Session::startUpTorrents()
|
||||
}
|
||||
}
|
||||
|
||||
Algorithm::removeIf(resumeData.tags, [this, &torrentID](const QString &tag)
|
||||
{
|
||||
if (hasTag(tag))
|
||||
return false;
|
||||
|
||||
if (addTag(tag))
|
||||
{
|
||||
LogMsg(tr("Detected inconsistent data: tag is missing from the configuration file."
|
||||
" Tag will be recovered."
|
||||
" Torrent: \"%1\". Tag: \"%2\"").arg(torrentID.toString(), tag), Log::WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
LogMsg(tr("Detected inconsistent data: invalid tag. Torrent: \"%1\". Tag: \"%2\"")
|
||||
.arg(torrentID.toString(), tag), Log::WARNING);
|
||||
return true;
|
||||
});
|
||||
|
||||
qDebug() << "Starting up torrent" << torrentID.toString() << "...";
|
||||
if (!loadTorrent(resumeData))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user