#79: Added functionality to the comressed song endpoint

This commit is contained in:
kdeng00
2024-06-16 17:56:25 -04:00
parent c7a530107f
commit 0394ad38da
3 changed files with 23 additions and 7 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;