From 09c1860bb6cae48eb63a4ebbd177bc6f315e7cd1 Mon Sep 17 00:00:00 2001 From: Alan McGovern Date: Wed, 2 Dec 2020 18:13:44 +0000 Subject: [PATCH] [core] Generate a proper file path as the fallback The API expects this to be the path to a specific file, so when we autogenerate a value ensure we actually generate a full path. --- src/MonoTorrent/MonoTorrent.Client/Managers/TorrentManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MonoTorrent/MonoTorrent.Client/Managers/TorrentManager.cs b/src/MonoTorrent/MonoTorrent.Client/Managers/TorrentManager.cs index eadc1fb7b..8249b5192 100644 --- a/src/MonoTorrent/MonoTorrent.Client/Managers/TorrentManager.cs +++ b/src/MonoTorrent/MonoTorrent.Client/Managers/TorrentManager.cs @@ -355,7 +355,7 @@ public TorrentManager (MagnetLink magnetLink, string savePath, TorrentSettings s InfoHash = magnetLink.InfoHash; Settings = settings; - this.torrentSave = string.IsNullOrEmpty (torrentSave) ? Environment.CurrentDirectory : Path.GetFullPath (torrentSave); + this.torrentSave = string.IsNullOrEmpty (torrentSave) ? Path.Combine (Environment.CurrentDirectory, "metadata", $"{InfoHash.ToHex ()}.torrent") : Path.GetFullPath (torrentSave); var announces = new List> (); if (magnetLink.AnnounceUrls != null) announces.Add (magnetLink.AnnounceUrls);