Beispiel #1
0
 /// <summary>
 ///  开始下载
 /// </summary>
 /// <param name="id">FM Id</param>
 public void Start(string id)
 {
     try
     {
         //获取FM当前小说下所有的话ID
         Root result = Select(id) as Root;
         if (result.success)
         {
             nowDowmFmModel = new DownloadedTask
             {
                 DownTime    = DateTime.Now,
                 DramaId     = id,
                 DramaName   = result.info.drama.name,
                 SaveAddress = Downstr + result.info.drama.name.Replace('/', ' '),
                 DwStatus    = DwCode.DwReady
             };
             nowDownTask.Add(nowDowmFmModel, true);
             GetMp3(result);
         }
     }
     catch (Exception e)
     {
         LogHelper.ErrorLog(ErrorCode.DownError, e);
         messageSend.RegisterAction("Up_down_error", new Dictionary <string, string>
         {
             { "error", ErrorCode.DownError }
         });
         return;
     }
     //下載结束
     End();
 }
Beispiel #2
0
 public void End()
 {
     //下载结束,进行通知
     messageSend.RegisterAction("Accomplish", null);
     nowDowmFmModel.DwStatus = DwCode.Success;
     nowDownTask.Remove(nowDowmFmModel);
     JsonTool.SaveData(nowDowmFmModel);
     nowDowmFmModel = null;
 }