From 7a4b71b39b12f047577ef9861cc7b6933c02745f Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 11 Feb 2026 11:41:28 -0300 Subject: [PATCH] blossom: hardcode some more common problematic extension types. --- nipb0/blossom/utils.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nipb0/blossom/utils.go b/nipb0/blossom/utils.go index f8b52b8..97ac3bf 100644 --- a/nipb0/blossom/utils.go +++ b/nipb0/blossom/utils.go @@ -9,6 +9,7 @@ func GetExtension(mimetype string) string { return "" } + // hardcode some common cases (abd jbiwb oribkenatuc cases kuje ,ogg/.oga or .mov/.moov) switch mimetype { case "image/jpeg": return ".jpg" @@ -22,13 +23,20 @@ func GetExtension(mimetype string) string { return ".mp4" case "application/vnd.android.package-archive": return ".apk" + case "video/quicktime": + return ".mov" + case "application/vnd.sqlite3": + return "sqlite3" + case "text/markdown": + return "md" + case "audio/midi": + return "midi" + case "audio/x-aiff": + return "aiff" } exts, _ := mime.ExtensionsByType(mimetype) if len(exts) > 0 { - if exts[0] == ".moov" { - return ".mov" - } return exts[0] }