feat(meta): add writing metadata by ffmpeg

This commit is contained in:
Unlock Music Dev
2022-12-06 04:27:44 +08:00
parent 8319df6ca3
commit 02e065aac4
3 changed files with 263 additions and 11 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io"
"strings"
"github.com/samber/lo"
@ -102,10 +101,7 @@ func (d *Decoder) GetCoverImage(ctx context.Context) ([]byte, error) {
return nil, fmt.Errorf("qmc[GetCoverImage] extract album art: %w", err)
}
d.cover, err = io.ReadAll(img)
if err != nil {
return nil, fmt.Errorf("qmc[GetCoverImage] read embed cover: %w", err)
}
d.cover = img.Bytes()
return d.cover, nil
}