#93: Starting work to implement flac support

This commit is contained in:
kdeng00
2024-07-08 19:08:26 -04:00
parent fbb761fb5c
commit bde264fedc
4 changed files with 39 additions and 0 deletions
@@ -9,6 +9,8 @@ public class MetadataRetriever
{
#region Fields
private static NLog.Logger _logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
private List<string> _supportedAudioFileTypes = new List<string> {"wav", "flac"};
private List<string> _supportedImageFileTypes = new List<string> {"jpeg", "jpg", "png"};
private Song _updatedSong;
private string _message;
private string _title;
@@ -106,6 +108,22 @@ public class MetadataRetriever
}
}
public bool IsSupportedFile(IFormFile file)
{
var supportedTypes = this._supportedAudioFileTypes;
this._supportedImageFileTypes.ForEach(t =>
{
if (!supportedTypes.Contains(t))
{
supportedTypes.Add(t);
}
});
var extensionType = this.FileExtensionType(file).ToLower();
return supportedTypes.Contains(extensionType);
}
public Song RetrieveMetaData(string filePath)
{
Song song = new Song();