|
|
@ -104,6 +104,14 @@ internal partial class MediaDownloader
|
|
|
|
var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName);
|
|
|
|
var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName);
|
|
|
|
var fileExtension = Path.GetExtension(fileName);
|
|
|
|
var fileExtension = Path.GetExtension(fileName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Probably not a file extension, just a dot in a long file name
|
|
|
|
|
|
|
|
// https://github.com/Tyrrrz/DiscordChatExporter/issues/708
|
|
|
|
|
|
|
|
if (fileExtension.Length > 41)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fileNameWithoutExtension = fileName;
|
|
|
|
|
|
|
|
fileExtension = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return PathEx.EscapeFileName(fileNameWithoutExtension.Truncate(42) + '-' + urlHash + fileExtension);
|
|
|
|
return PathEx.EscapeFileName(fileNameWithoutExtension.Truncate(42) + '-' + urlHash + fileExtension);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|