#93: Starting work to implement flac support
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user