fix podcast mkdir for podcast episode

This commit is contained in:
sentriz
2024-04-20 19:38:40 +01:00
parent 7b21e82aaf
commit 38ab0b0929

View File

@@ -484,7 +484,7 @@ func (p *Podcasts) doPodcastDownload(podcast *db.Podcast, podcastEpisode *db.Pod
if err := p.db.Save(&podcastEpisode).Error; err != nil {
return fmt.Errorf("save podcast episode: %w", err)
}
if err := os.MkdirAll(filepath.Dir(podcastEpisode.Filename), os.ModePerm); err != nil {
if err := os.MkdirAll(filepath.Dir(filepath.Join(podcast.RootDir, podcastEpisode.Filename)), os.ModePerm); err != nil {
return fmt.Errorf("make podcast root dir: %w", err)
}
file, err := os.Create(filepath.Join(podcast.RootDir, podcastEpisode.Filename))