예제 #1
0
        internal async Task UpdateStatus(VoiceListItem item)
        {
            await Task.Delay(100);

            string serverDirPath = AppEnvironment.dataService.ServerUserDataDirPath + "/";

            string serverFilePath = Path.Combine(serverDirPath, $"{item.Section}_{item.Chapter}_{item.Number}.mp3");

            if (FTPService.CheckFileExist(serverFilePath))
            {
                item.IsUploaded      = true;
                item.CompletedText   = AppResources.Successed;
                item.UploadTextColor = Color.Green;
            }
            else
            {
                item.IsUploaded      = false;
                item.CompletedText   = AppResources.NonSuccessed;
                item.UploadTextColor = Color.Red;
            }
        }
예제 #2
0
        private void CheckFirstVoiceStatusFile()
        {
            string filePath   = Path.Combine(LocalDataPath, firstVoiceSetStatusFile);
            string serverPath = Path.Combine(ServerUserDataDirPath, firstVoiceSetStatusFile);

            if (!Directory.Exists(LocalDataPath))
            {
                Directory.CreateDirectory(LocalDataPath);
            }

            if (!File.Exists(filePath))
            {
                if (FTPService.CheckFileExist(serverPath))
                {
                    FTPService.DownloadFile(filePath, serverPath);
                }
                else
                {
                    File.WriteAllText(filePath, "");
                }
            }
        }