Beispiel #1
0
        /// <summary>
        ///		Obtiene el nombre del archivo de descarga
        /// </summary>
        private string GetDownloadFileName(MediaFileModel file)
        {
            string fileName = string.Empty;

            // Calcula el nombre del archivo
            if (!string.IsNullOrEmpty(file.Url))
            {
                // Obtiene el nombre de archivo
                fileName = Path.Combine(PathBase, HelperFiles.Normalize(file.Album.Name),
                                        HelperFiles.Normalize(Path.GetFileName(file.Url)));
                // Ajusta el nombre de archivo
                fileName = HelperFiles.GetConsecutiveFileName(Path.GetDirectoryName(fileName), Path.GetFileName(fileName));
            }
            // Devuelve el nombre de archivo
            return(fileName);
        }
Beispiel #2
0
        /// <summary>
        ///		Obtiene un nombre de archivo
        /// </summary>
        private string GetFileName(string file, bool consecutive)
        {
            string path = Manager.UrlDownload;

            // Obtiene el directorio
            if (string.IsNullOrEmpty(path) || !System.IO.Directory.Exists(path))
            {
                path = Manager.PathBase;
            }
            // Obtiene el nombre de archivo
            if (consecutive)
            {
                return(HelperFiles.GetConsecutiveFileName(path, file));
            }
            else
            {
                return(System.IO.Path.Combine(path, file));
            }
        }