Beispiel #1
0
        /// <summary>
        /// Method to get a path to a single album.
        /// <para>Create directory if not exists.</para>
        /// </summary>
        /// <param name="albumId">The primary key of the album.</param>
        /// <returns>The path to the album directory.</returns>
        public static async Task <string> GetAlbumDirectoryAsync(int albumId)
        {
            // Format Album path by Primary Key
            int    root = (int)Math.Floor((double)(albumId / 1024));
            string path = Path.Combine(root.ToString().PadLeft(4, '0'), albumId.ToString().PadLeft(4, '0'));

            return(await SysDirectory.CreateAsync(await GetAlbumsDirectoryAsync(), path));
        }
Beispiel #2
0
 /// <summary>
 /// <para>Method to get a path to a cache directory.</para>
 /// <para>Create directory if not exists.</para>
 /// </summary>
 /// <param name="relativeUrl">The relative url of the directory based from the cache directory.</param>
 /// <returns>The absolute path to the directory.</returns>
 public static async Task <string> GetDirectoryAsync(string relativeUrl)
 {
     return(await SysDirectory.CreateAsync(ApplicationBase.Directories.Cache, relativeUrl));
 }