Skip to content
Snippets Groups Projects
Commit 00615844 authored by Christian Bager Bach Houmann's avatar Christian Bager Bach Houmann
Browse files

fix: prevent user from downloading episode if no download path is set

parent 4767bdf8
No related branches found
No related tags found
No related merge requests found
import { Menu } from "obsidian";
import { Menu, Notice } from "obsidian";
import createPodcastNote, { getPodcastNote, openPodcastNote } from "src/createPodcastNote";
import downloadEpisodeWithProgessNotice from "src/downloadEpisode";
import { currentEpisode, downloadedEpisodes, favorites, playedEpisodes, playlists, plugin, queue, viewState } from "src/store";
......@@ -58,7 +58,13 @@ export default function spawnEpisodeContextMenu(
if (isDownloaded) {
downloadedEpisodes.removeEpisode(episode, true);
} else {
downloadEpisodeWithProgessNotice(episode, get(plugin).settings.download.path);
const downloadPath = get(plugin).settings.download.path;
if (!downloadPath) {
new Notice(`Please set a download path in the settings.`);
return;
}
downloadEpisodeWithProgessNotice(episode, downloadPath);
}
}));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment