fix: nil pointer panic

This commit is contained in:
Mikkel Rask 2026-04-01 11:46:40 +02:00
parent 0ec7b458cc
commit 13566e58a2
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import (
"github.com/gabehf/koito/internal/cfg"
"github.com/gabehf/koito/internal/db"
"github.com/gabehf/koito/internal/logger"
"github.com/gabehf/koito/internal/mbz"
mbz "github.com/gabehf/koito/internal/mbz"
)
type SpotifyExportItem struct {
@ -24,7 +24,7 @@ type SpotifyExportItem struct {
MsPlayed int32 `json:"ms_played"`
}
func ImportSpotifyFile(ctx context.Context, store db.DB, filename string) error {
func ImportSpotifyFile(ctx context.Context, store db.DB, mbzc mbz.MusicBrainzCaller, filename string) error {
l := logger.FromContext(ctx)
l.Info().Msgf("Beginning spotify import on file: %s", filename)
file, err := os.Open(path.Join(cfg.ConfigDir(), "import", filename))