Skip to content

Commit

Permalink
don't panic when we can't find an old podcast episode path in migration
Browse files Browse the repository at this point in the history
related #393
  • Loading branch information
sentriz committed Oct 18, 2023
1 parent 69c02e8 commit d503282
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions db/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ func migratePlaylistsPaths(tx *gorm.DB, ctx MigrationContext) error {
filepath.Join(ctx.PodcastsPath, p.Title),
)
if err != nil {
return fmt.Errorf("find old podcast path: %w", err)
log.Printf("error finding old podcast path: %v. ignoring", err)
continue
}
newPath := filepath.Join(ctx.PodcastsPath, fileutil.Safe(p.Title))
p.RootDir = newPath
Expand Down Expand Up @@ -696,7 +697,8 @@ func migratePlaylistsPaths(tx *gorm.DB, ctx MigrationContext) error {
filepath.Join(pe.Podcast.RootDir, pe.Filename),
)
if err != nil {
return fmt.Errorf("find old podcast episode path: %w", err)
log.Printf("error finding old podcast episode path: %v. ignoring", err)
continue
}
newName := fileutil.Safe(filepath.Base(oldPath))
pe.Filename = newName
Expand Down

0 comments on commit d503282

Please sign in to comment.