|
Lines 53-58
Link Here
|
| 53 |
private Dictionary<TorrentManager, long> torrentPreviousUpload; |
53 |
private Dictionary<TorrentManager, long> torrentPreviousUpload; |
| 54 |
private Dictionary<TorrentManager, long> torrentPreviousDownload; |
54 |
private Dictionary<TorrentManager, long> torrentPreviousDownload; |
| 55 |
private MainWindow mainWindow; |
55 |
private MainWindow mainWindow; |
|
|
56 |
public MainWindow MainWindow |
| 57 |
{ |
| 58 |
get { return mainWindow; } |
| 59 |
} |
| 56 |
|
60 |
|
| 57 |
private List<TorrentManager> torrentsDownloading; |
61 |
private List<TorrentManager> torrentsDownloading; |
| 58 |
private List<TorrentManager> torrentsSeeding; |
62 |
private List<TorrentManager> torrentsSeeding; |
|
Lines 197-203
Link Here
|
| 197 |
if (!isUrl && moveToStorage && (prefSettings.TorrentStorageLocation != Directory.GetParent(torrentPath).ToString()) ) { |
201 |
if (!isUrl && moveToStorage && (prefSettings.TorrentStorageLocation != Directory.GetParent(torrentPath).ToString()) ) { |
| 198 |
newPath = Path.Combine(prefSettings.TorrentStorageLocation, Path.GetFileName(torrentPath)); |
202 |
newPath = Path.Combine(prefSettings.TorrentStorageLocation, Path.GetFileName(torrentPath)); |
| 199 |
logger.Debug("Copying torrent to " + newPath); |
203 |
logger.Debug("Copying torrent to " + newPath); |
| 200 |
File.Copy(torrentPath, newPath, true); |
204 |
// The files should already be in the TorrentStorageLocation |
|
|
205 |
//File.Copy(torrentPath, newPath, true); |
| 201 |
|
206 |
|
| 202 |
if (removeOriginal) { |
207 |
if (removeOriginal) { |
| 203 |
logger.Info("Deleting original torrent " + torrentPath); |
208 |
logger.Info("Deleting original torrent " + torrentPath); |
|
Lines 462-470
Link Here
|
| 462 |
{ |
467 |
{ |
| 463 |
if(!prefSettings.ImportEnabled) |
468 |
if(!prefSettings.ImportEnabled) |
| 464 |
return; |
469 |
return; |
| 465 |
|
470 |
|
| 466 |
logger.Info("New torrent detected, adding " + args.TorrentPath); |
471 |
GLib.Timeout.Add (250, delegate { |
| 467 |
addTorrent(args.TorrentPath, prefSettings.StartNewTorrents, true, prefSettings.RemoveOnImport, null); |
472 |
string newPath = Path.Combine(MainWindow.Preferences.TorrentStorageLocation, Path.GetFileName(args.TorrentPath)); |
|
|
473 |
logger.Info ("Copying: {0} to {1}", args.TorrentPath, newPath); |
| 474 |
try |
| 475 |
{ |
| 476 |
if (File.Exists (newPath)) |
| 477 |
File.Delete (newPath); |
| 478 |
|
| 479 |
File.Copy(args.TorrentPath, newPath ,true); |
| 480 |
} |
| 481 |
catch (Exception ex) |
| 482 |
{ |
| 483 |
|
| 484 |
} |
| 485 |
return false; |
| 486 |
}); |
| 487 |
//addTorrent(args.TorrentPath, prefSettings.StartNewTorrents, true, prefSettings.RemoveOnImport, null); |
| 468 |
} |
488 |
} |
| 469 |
|
489 |
|
| 470 |
public void LoadStoredTorrents() |
490 |
public void LoadStoredTorrents() |