This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"butterfliu/config"
|
||||
"butterfliu/internal/model"
|
||||
"butterfliu/internal/repository"
|
||||
"butterfliu/internal/util"
|
||||
"errors"
|
||||
"path"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type CoverService struct {
|
||||
@@ -37,9 +34,11 @@ func (s *CoverService) GetSongCover(id int) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
util.ExtractCover(file.Path, id)
|
||||
conf := config.LoadConfig()
|
||||
return path.Join(conf.GetCachePath("cover"), strconv.Itoa(id)+".jpg"), nil
|
||||
cover, err := util.ExtractCover(file.Path, id)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return cover, nil
|
||||
}
|
||||
|
||||
func (s *CoverService) GetAlbumCover(id int) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user