fix channel delete for channel_id fallback folders

This commit is contained in:
simon 2022-01-30 08:33:10 +07:00
parent 8e860d4f01
commit e5e83287ab
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 3 additions and 0 deletions

View File

@ -198,6 +198,9 @@ class YoutubeChannel(YouTubeItem):
"""get folder where media files get stored"""
channel_name = self.json_data["channel_name"]
folder_name = clean_string(channel_name)
if len(folder_name) <= 3:
# fall back to channel id
folder_name = self.json_data["channel_id"]
folder_path = os.path.join(self.app_conf["videos"], folder_name)
return folder_path