Fix dashboard failing to load episodes after RSS import
Build and Deploy / build-and-deploy (push) Successful in 52s
Build and Deploy / build-and-deploy (push) Successful in 52s
The root cause was that modernc.org/sqlite stores time.Time as strings but cannot scan strings back into time.Time, causing ListEpisodes to fail. Changed PublishedAt and CreatedAt in store structs from time.Time to string, with format/parse handled at the application level. Also fixed a secondary issue where the published_at format stored during import had a duplicated timezone offset.
This commit is contained in:
+1
-1
@@ -243,7 +243,7 @@ func (h *ImportHandler) importSelected(w http.ResponseWriter, r *http.Request, r
|
||||
publishedAt = t
|
||||
}
|
||||
|
||||
_, err = h.Store.CreateEpisode(userID, item.Title, item.Description, audioPath, imagePath, publishedAt)
|
||||
_, err = h.Store.CreateEpisode(userID, item.Title, item.Description, audioPath, imagePath, publishedAt.Format("2006-01-02 15:04:05"))
|
||||
if err != nil {
|
||||
errors = append(errors, fmt.Sprintf("%s: database error: %v", item.Title, err))
|
||||
h.removeFile(audioPath)
|
||||
|
||||
Reference in New Issue
Block a user