fix chown for mig new folder

This commit is contained in:
simon 2023-05-19 14:49:49 +07:00
parent 8ef59f5bff
commit 64984bc1b3
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 6 additions and 1 deletions

View File

@ -79,7 +79,8 @@ class ChannelMigration:
def __init__(self, channel):
self.channel = channel
self.videos = AppConfig().config["application"]["videos"]
self.config = AppConfig().config
self.videos = self.config["application"]["videos"]
self.bulk_list = []
def migrate(self):
@ -92,9 +93,13 @@ class ChannelMigration:
def _create_new_folder(self):
"""create new channel id folder"""
host_uid = self.config["application"]["HOST_UID"]
host_gid = self.config["application"]["HOST_GID"]
new_path = os.path.join(self.videos, self.channel["channel_id"])
if not os.path.exists(new_path):
os.mkdir(new_path)
if host_uid and host_gid:
os.chown(new_path, host_uid, host_gid)
def get_channel_videos(self):
"""get all videos of channel"""