#79: Added query parameter to randomize filename when downloading songs (#96)

* #79: Added query parameter to randomize filename when downloading songs

Right now only the  endpoint has this parameter added

* #79: Added functionality to the comressed song endpoint

* Added functionality to the download cover art
This commit was merged in pull request #96.
This commit is contained in:
Kun Deng
2024-06-16 19:04:10 -04:00
committed by GitHub
parent 270b7d059c
commit ebb15b7cdb
7 changed files with 90 additions and 40 deletions
+3 -3
View File
@@ -85,7 +85,7 @@ public class SongCompression
if (songDetails.Filename.Contains(Constants.FileExtensions.WAV_EXTENSION))
{
_compressedSongFilename = StripMP3Extension(songDetails.Filename);
_compressedSongFilename = StripExtension(songDetails.Filename);
}
return tmpZipFilePath;
@@ -110,7 +110,7 @@ public class SongCompression
}
string StripMP3Extension(string filename)
string StripExtension(string filename)
{
Console.WriteLine($"Before: {filename}");
int filenameLength = filename.Length;
@@ -119,7 +119,7 @@ public class SongCompression
var startIndex = endIndex - 3;
Console.WriteLine($"Starting index {startIndex} and ending index {endIndex}");
var stripped = filename.Remove(startIndex, 4);
stripped += ".zip";
stripped += Constants.FileExtensions.ZIP_EXTENSION;
Console.WriteLine($"After {stripped}");
return stripped;