fixes extensions handling by removing dots

This commit is contained in:
Philipp Häfelfinger 2022-11-19 10:05:39 +01:00
parent 074da8a4d8
commit 3b2384d82f

View File

@ -51,7 +51,7 @@ public static class PiwigoClientExtensions
} }
var supportedFileTypes = await client.Session.GetSupportedFileTypes(cancellationToken); var supportedFileTypes = await client.Session.GetSupportedFileTypes(cancellationToken);
if (!supportedFileTypes.Contains(imageToUpload.Extension.ToLower())) if (!supportedFileTypes.Contains(imageToUpload.Extension.Replace(".", string.Empty).ToLower()))
{ {
throw new PiwigoException( throw new PiwigoException(
$"The file {imageToUpload.Name} has extension {imageToUpload.Extension} which is not supported by the connected piwigo server. Please use one of the following formats {string.Join(",", supportedFileTypes)}"); $"The file {imageToUpload.Name} has extension {imageToUpload.Extension} which is not supported by the connected piwigo server. Please use one of the following formats {string.Join(",", supportedFileTypes)}");