public void Download(string foldertxt, string filename, NyaaseRssViewModel item, string tf, string tc)
        {
            var selectediten = item;
            if (!Directory.Exists(foldertxt)) {
                Directory.CreateDirectory(foldertxt);
            }
            //var file = Tools.DownloadFile(selectediten.Link, tf + @"\");
            //using (var web = new WebClient())
            //{
            //    web.DownloadFile(new Uri(selectediten.Link),
            //        tf + @"\" + selectediten.Name.Replace("'", string.Empty) + @".torrent");
            //}
            Deluge.openFeeddownload(tc, foldertxt, selectediten.Link);

            var i = new AnimeViewModel {
                Name = selectediten.Name,
                Added = DateTime.Now,
                Tag = Path.Combine(foldertxt, item.Name),
                Status = "Not Watched"
            };
            Global.AnimeAdd = i;

            Tools.showBalloon("Nyaa.se", "Downloading\n" + selectediten.Name);
            GC.Collect();
        }
Example #2
0
        public static void CreateDataGridItem(string content, string tag, bool isenabled)
        {
            var itmheader = new AnimeViewModel {
                Tag = Global.OngoingFolder + @"\" + tag,
                Name = content,
                Added = DateTime.Now,
                Status = "Not Watched"
            };
            if (!isenabled)
                itmheader.Status = "Watched";
            //Settings.Default.Listbox += content + "[]" + OngoingFolder + @"\" + tag + "[]" + isenabled + "\n";

            //LstItems.Add(itmheader);
            //Settings.Default.ListboxItems.Insert(0, itmheader);
            //Settings.Default.Save();
            Global.AnimeAdd = itmheader; // (itmheader);
        }
 public bool Open(AnimeViewModel item)
 {
     if (item.Tag.Equals("blank")) return false;
     Process.Start(item.Tag);
     return true;
 }
Example #4
0
 public static void PopulateListbox()
 {
     var getitems = new Getitems();
     foreach (var item in getitems.get()) {
         var iteminfo = item.Split(new[] {"[]"}, StringSplitOptions.None);
         var dataGridAnimeItem = new AnimeViewModel();
         if (iteminfo.Length == 2) {
             dataGridAnimeItem = new AnimeViewModel {
                 Name = iteminfo[0],
                 Tag = iteminfo[1],
                 Status = "Not Watched"
             };
         }
         else {
             dataGridAnimeItem = new AnimeViewModel {
                 Name = iteminfo[0],
                 Tag = iteminfo[1],
                 Added = DateTime.Parse(iteminfo[2]),
                 Status = "Not Watched"
             };
         }
         Global.AnimeAdd = dataGridAnimeItem;
     }
 }