mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
feat: add support for adding torrents by raw hash values (#2608)
* Add support for adding torrents by raw hash values Co-authored-by: vjunk <vjunk@mail.ru>
This commit is contained in:
@@ -1695,14 +1695,10 @@ static char const* torrentAdd(tr_session* session, tr_variant* args_in, tr_varia
|
||||
// these two tr_ctorSet*() functions require zero-terminated strings
|
||||
auto const filename_sz = std::string{ filename };
|
||||
|
||||
if (tr_strvStartsWith(filename, "magnet:?"sv))
|
||||
if (!tr_ctorSetMetainfoFromFile(ctor, filename_sz.c_str(), nullptr))
|
||||
{
|
||||
tr_ctorSetMetainfoFromMagnetLink(ctor, filename_sz.c_str(), nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
tr_ctorSetMetainfoFromFile(ctor, filename_sz.c_str(), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
addTorrentImpl(idle_data, ctor);
|
||||
|
||||
Reference in New Issue
Block a user