public static void deleteTorrent(string hash, bool deleteFileToo = false) { log.Trace("requested delete({0}, deleteFile:{1})", hash, deleteFileToo); Core.TorrentHandle th = getTorrentHandle(hash); _torrentSession.remove_torrent(th, Convert.ToInt32(deleteFileToo)); TorrentHandles.TryRemove(hash, out th); File.Delete(Environment.CurrentDirectory + "./Fastresume/" + hash + ".fastresume"); File.Delete(Environment.CurrentDirectory + "./Fastresume/" + hash + ".torrent"); }
public void deleteTorrent(string hash, bool deleteFileToo = false) { if (_streamingHash == hash && _isStreaming) { _streamingList[hash].StopStreaming(BufferingReadyCallback); } log.Trace("requested delete({0}, deleteFile:{1})", hash, deleteFileToo); Core.TorrentHandle th = getTorrentHandle(hash); _torrentSession.remove_torrent(th, Convert.ToInt32(deleteFileToo)); TorrentHandles.TryRemove(hash, out th); th?.Dispose(); th = null; try { File.Delete(Environment.CurrentDirectory + "./Fastresume/" + hash + ".fastresume"); File.Delete(Environment.CurrentDirectory + "./Fastresume/" + hash + ".torrent"); } catch (Exception) { } }