예제 #1
0
파일: VideoFile.cs 프로젝트: csyolen/Jarvis
 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));
 }
예제 #2
0
 /// <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);
     }
 }
예제 #3
0
        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));
        }
예제 #4
0
파일: RarFile.cs 프로젝트: csyolen/Jarvis
        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); }
        }
예제 #5
0
        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);
            }
        }
예제 #6
0
 /// <summary>
 /// Close down main torrent
 /// </summary>
 /// <param name="_main"></param>
 public void ClosedownTorrent()
 {
     TorrentHandler.CloseDownloadingTorrent();
     InfoWindow.ClearData();
 }