fix a few bugs that claude pointed out
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-05-12 15:58:45 -04:00
parent a7c5e1708c
commit c45a2e1057
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -221,8 +221,8 @@ func (m *MySQL) UpdateBook(ctx context.Context, old, new *media.Book) error {
res, err := m.connection.ExecContext(ctx, `
UPDATE `+m.tableName+`
SET
id=? title=? authors=? sortauthor=? isbn10=? isbn13=? format=? genre=? publisher=?
series=? volume=? year=? signed=? description=? notes=? coverurl=? childrens=?
title=?, authors=?, sortauthor=?, isbn10=?, isbn13=?, format=?, genre=?, publisher=?,
series=?, volume=?, year=?, signed=?, description=?, notes=?, coverurl=?, childrens=?
WHERE id=?`,
new.Title, strings.Join(new.Authors, ";"), new.SortAuthor, new.ISBN10, new.ISBN13, new.Format, new.Genre, new.Publisher,
new.Series, new.Volume, new.Year, new.Signed, new.Description, new.Notes, new.CoverURL, new.Childrens, old.ID,
+2
View File
@@ -100,6 +100,7 @@ func (c *DiscogsCache) loadRecordsFromFS(ctx context.Context) ([]media.Record, t
if err != nil {
return nil, time.Time{}, fmt.Errorf("error opening cache file %s: %w", c.persistFile, err)
}
defer f.Close()
err = gob.NewDecoder(f).Decode(p)
if err != nil {
return nil, time.Time{}, fmt.Errorf("error readhing from cache file %s: %w", c.persistFile, err)
@@ -120,6 +121,7 @@ func (c *DiscogsCache) saveRecordsToCache(ctx context.Context, records []media.R
if err != nil {
return fmt.Errorf("error opening cache file %s: %w", c.persistFile, err)
}
defer f.Close()
err = gob.NewEncoder(f).Encode(p)
if err != nil {
return fmt.Errorf("error writing to cache file %s: %w", c.persistFile, err)