diff --git a/tubearchivist/config/management/commands/ta_migpath.py b/tubearchivist/config/management/commands/ta_migpath.py index 4d039a5d..78b4c2fc 100644 --- a/tubearchivist/config/management/commands/ta_migpath.py +++ b/tubearchivist/config/management/commands/ta_migpath.py @@ -178,6 +178,9 @@ class ChannelMigration: def delete_old(self, all_videos): """delete old folder path if empty""" + if not all_videos: + return + channel_name = os.path.split(all_videos[0]["media_url"])[0] old_path = os.path.join(self.videos, channel_name) if os.path.exists(old_path) and not os.listdir(old_path):