improve data extraction, parser and added tests
This commit is contained in:
@@ -3,8 +3,6 @@ package repository
|
||||
import (
|
||||
"context"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"log/slog"
|
||||
|
||||
"github.com/zepyrshut/rating-orama/internal/scraper"
|
||||
"github.com/zepyrshut/rating-orama/internal/sqlc"
|
||||
)
|
||||
@@ -18,11 +16,8 @@ func (r *pgxRepository) CreateTvShowWithEpisodes(ctx context.Context, tvShow sql
|
||||
return err
|
||||
}
|
||||
|
||||
slog.Info("episodes lenght", "episodes", len(episodes))
|
||||
|
||||
for _, episode := range episodes {
|
||||
sqlcEpisodeParams := episode.ToEpisodeParams(tvShow.ID)
|
||||
slog.Info("creating episode", "episode", sqlcEpisodeParams)
|
||||
episode, err := qtx.CreateEpisodes(ctx, sqlcEpisodeParams)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user