Skip to content

Commit

Permalink
Add file extension for audio/aac, for Windows
Browse files Browse the repository at this point in the history
Fixes an issue reported in #51
  • Loading branch information
Tim van der Molen committed Sep 10, 2024
1 parent 548a212 commit f05c08b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd_export_attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ func cmdExportAttachments(args []string) cmdStatus {
}
}

if err := addContentTypes(); err != nil {
log.Print(err)
}

var ctx *signal.Context
if key == nil {
ctx, err = signal.Open(signalDir)
Expand Down
4 changes: 4 additions & 0 deletions mime.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func unveilMimeFiles() error {
return nil
}

func addContentTypes() error {
return mime.AddExtensionType(".aac", "audio/aac")
}

func extensionFromContentType(contentType string) (string, error) {
// Avoid silly results, such as .jpe for image/jpeg
switch t, _, _ := strings.Cut(contentType, ";"); t {
Expand Down

0 comments on commit f05c08b

Please sign in to comment.