public static void SaveMissons()
        {
            if (objs.Count == 0)
            {
                File.Delete(Environment.CurrentDirectory + "/config/download.session");
                return;
            }
            List <DownloadSavedMisson> ms = new List <DownloadSavedMisson>();

            foreach (DownloadObject dobj in DownloadQueue.objs)
            {
                DownloadSavedMisson misson = new DownloadSavedMisson
                {
                    aid      = dobj.aid,
                    cid      = dobj.cid,
                    name     = dobj.name,
                    saveto   = dobj.saveto,
                    quality  = dobj.quality,
                    avname   = dobj.avname,
                    bilicode = dobj.bilicode
                };
                ms.Add(misson);
            }
            File.WriteAllText(Environment.CurrentDirectory + "/config/download.session", JsonConvert.SerializeObject(ms));
        }
Example #2
0
        public static void SaveMissons()
        {
            if (objs.Count == 0)
            {
                File.Delete(Environment.CurrentDirectory + "/config/download.session");
                return;
            }
            List <DownloadSavedMisson> ms = new List <DownloadSavedMisson>();

            foreach (DownloadObject dobj in DownloadQueue.objs)
            {
                DownloadSavedMisson misson = new DownloadSavedMisson();
                misson.aid     = dobj.parent.aid;
                misson.cid     = dobj.parent.cid;
                misson.name    = dobj.parent.name;
                misson.saveto  = dobj.parent.savedir;
                misson.quality = dobj.parent.selectedquality;
                ms.Add(misson);
            }
            File.WriteAllText(Environment.CurrentDirectory + "/config/download.session", JsonConvert.SerializeObject(ms));
        }