delete channel path building

This commit is contained in:
simon 2023-05-18 20:32:58 +07:00
parent 9d6ab6b7b3
commit 8ef59f5bff
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -14,7 +14,6 @@ from home.src.download.yt_dlp_base import YtWrap
from home.src.es.connect import ElasticWrap, IndexPaginate from home.src.es.connect import ElasticWrap, IndexPaginate
from home.src.index.generic import YouTubeItem from home.src.index.generic import YouTubeItem
from home.src.index.playlist import YoutubePlaylist from home.src.index.playlist import YoutubePlaylist
from home.src.ta.helper import clean_string
class YoutubeChannel(YouTubeItem): class YoutubeChannel(YouTubeItem):
@ -177,12 +176,10 @@ class YoutubeChannel(YouTubeItem):
def get_folder_path(self): def get_folder_path(self):
"""get folder where media files get stored""" """get folder where media files get stored"""
channel_name = self.json_data["channel_name"] folder_path = os.path.join(
folder_name = clean_string(channel_name) self.app_conf["videos"],
if len(folder_name) <= 3: self.json_data["channel_id"],
# 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 return folder_path
def delete_es_videos(self): def delete_es_videos(self):