mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-02-11 19:09:43 +08:00
Improve torrent name handling
This commit is contained in:
parent
7c48ba2f19
commit
77555cd5c2
@ -661,9 +661,7 @@ QString Session::tempPath() const
|
|||||||
QString Session::torrentTempPath(const TorrentInfo &torrentInfo) const
|
QString Session::torrentTempPath(const TorrentInfo &torrentInfo) const
|
||||||
{
|
{
|
||||||
if ((torrentInfo.filesCount() > 1) && !torrentInfo.hasRootFolder())
|
if ((torrentInfo.filesCount() > 1) && !torrentInfo.hasRootFolder())
|
||||||
return tempPath()
|
return tempPath() + torrentInfo.name() + '/';
|
||||||
+ QString::fromStdString(torrentInfo.nativeInfo()->orig_files().name())
|
|
||||||
+ '/';
|
|
||||||
|
|
||||||
return tempPath();
|
return tempPath();
|
||||||
}
|
}
|
||||||
|
@ -185,17 +185,15 @@ InfoHash TorrentHandleImpl::hash() const
|
|||||||
|
|
||||||
QString TorrentHandleImpl::name() const
|
QString TorrentHandleImpl::name() const
|
||||||
{
|
{
|
||||||
QString name = m_name;
|
if (!m_name.isEmpty())
|
||||||
if (!name.isEmpty()) return name;
|
return m_name;
|
||||||
|
|
||||||
name = QString::fromStdString(m_nativeStatus.name);
|
|
||||||
if (!name.isEmpty()) return name;
|
|
||||||
|
|
||||||
if (hasMetadata())
|
if (hasMetadata())
|
||||||
{
|
return m_torrentInfo.name();
|
||||||
name = QString::fromStdString(m_torrentInfo.nativeInfo()->orig_files().name());
|
|
||||||
if (!name.isEmpty()) return name;
|
const QString name = QString::fromStdString(m_nativeStatus.name);
|
||||||
}
|
if (!name.isEmpty())
|
||||||
|
return name;
|
||||||
|
|
||||||
return m_hash;
|
return m_hash;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ InfoHash TorrentInfo::hash() const
|
|||||||
QString TorrentInfo::name() const
|
QString TorrentInfo::name() const
|
||||||
{
|
{
|
||||||
if (!isValid()) return {};
|
if (!isValid()) return {};
|
||||||
return QString::fromStdString(m_nativeInfo->name());
|
return QString::fromStdString(m_nativeInfo->orig_files().name());
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime TorrentInfo::creationDate() const
|
QDateTime TorrentInfo::creationDate() const
|
||||||
|
Loading…
Reference in New Issue
Block a user