public void Handle(FileInfo fi, TorrentHandler th) { var friendly = fi.Name.TorrentName(); var di = new FileInfo(@"C:\home\media\tv\" + friendly + fi.Extension); if (di.Exists) di.Delete(); fi.MoveTo(di.FullName); Brain.Pipe.ListenNext((s, match, listener) => Process.Start(di.FullName), "play|open|ok"); Brain.ListenerManager.CurrentListener.Output("{0} is ready to be watched.".Template(friendly)); }
/// <summary> /// Loads the torrent to the dataGrid /// </summary> /// <param name="targetTorrent">The torrent file.</param> public static void LoadTarget(string targetTorrent) { if (TorrentHandler.torrentCheck(targetTorrent)) { dataGrid.DataGridAddRow(TorrentHandler.TorrentInfoExtractor(targetTorrent).Item1, TorrentHandler.TorrentInfoExtractor(targetTorrent).Item2, TorrentHandler.TorrentInfoExtractor(targetTorrent).Item3); } if (TorrentHandler.MagnetCheck(targetTorrent)) { dataGrid.DataGridAddRow(targetTorrent, "N/A", targetTorrent); } }
public void Handle(FileInfo fi, TorrentHandler th) { var friendly = fi.Name.TorrentName(); var di = new FileInfo(@"C:\home\media\tv\" + friendly + fi.Extension); if (di.Exists) { di.Delete(); } fi.MoveTo(di.FullName); Brain.Pipe.ListenNext((s, match, listener) => Process.Start(di.FullName), "play|open|ok"); Brain.ListenerManager.CurrentListener.Output("{0} is ready to be watched.".Template(friendly)); }
public void Handle(FileInfo fileInfo, TorrentHandler th) { string tmp = Constants.TmpDirectory.FullName + "/" + fileInfo.Name.ToLower().Replace(".rar", ""); //th.MarkForDeletion(tmp); Directory.CreateDirectory(tmp); string args = String.Format("e -o- \"{0}\" \"{1}\"", fileInfo.FullName, tmp); var psi = new ProcessStartInfo("unrar.exe", args); psi.WindowStyle = ProcessWindowStyle.Hidden; var p = Process.Start(psi); p.WaitForExit(); foreach (string path in Directory.GetFiles(tmp, "*.*", SearchOption.AllDirectories)) { th.AddFile(path); } }
/// <summary> /// Close down main torrent /// </summary> /// <param name="_main"></param> public void ClosedownTorrent() { TorrentHandler.CloseDownloadingTorrent(); InfoWindow.ClearData(); }