Skip to content

Commit

Permalink
[core] Generate a proper file path as the fallback
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alanmcgovern committed Dec 2, 2020
1 parent f875ae6 commit 09c1860
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<IList<string>> ();
if (magnetLink.AnnounceUrls != null)
announces.Add (magnetLink.AnnounceUrls);
Expand Down

0 comments on commit 09c1860

Please sign in to comment.