Ejemplo n.º 1
0
        public async Task Delete()
        {
            var baseDirectory = await Reciter.GetStorageFolder();

            var fileQuery = baseDirectory.CreateFileQueryWithOptions(new QueryOptions
            {
                UserSearchFilter = string.Format(CultureInfo.InvariantCulture,
                                                 "{0:000}*.mp3", Surah),
                FolderDepth = FolderDepth.Shallow
            });

            var files = await fileQuery.GetFilesAsync();

            foreach (var file in files)
            {
                await file.DeleteAsync();
            }
            await Refresh();
        }
Ejemplo n.º 2
0
        public async Task Download()
        {
            // checking if need to download mp3
            var missingFiles = await AudioUtils.GetMissingFiles(new QuranAudioTrack
            {
                Surah     = Surah,
                Ayah      = 1,
                ReciterId = Reciter.Id
            });

            if (missingFiles.Count > 0)
            {
                string        url         = Reciter.ServerUrl;
                StorageFolder destination = await Reciter.GetStorageFolder();
                await DownloadMultipleViaHttpClient(
                    missingFiles.Select(f => Path.Combine(url, f)).ToArray(),
                    destination, Resources.loading_audio);
            }

            await Refresh();
        }
Ejemplo n.º 3
0
 public static string GetURLForAyah(Reciter reciter, int suraNumber, int ayahNumber)
 {
     return(baseRecitingURLs[reciter.urlIndex] + reciter.id + "/" + QuranMp3JoinUtil.FileNameForAya(AyaInfo.Create(suraNumber, ayahNumber)));
 }