add umask to channel folder, fix if folder already exists, #10

This commit is contained in:
Simon 2023-10-18 10:13:04 +07:00
parent 248cc41839
commit 3c88c19eb1
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 7 additions and 3 deletions

View File

@ -99,8 +99,6 @@ Some ideas for why that is:
- JF doesn't have the permissions to see the folder created by the extension.
- You didn't mount the volumes as expected and JF is looking in the wrong place.
You might have to cleanup any leftover year folders in the channel if you have reached a `TimeoutError` before you can run it again.
## Migration problems
Due to the filesystem change between Tube Archivist v0.3.6 to v0.4.0, this will reset your YouTube videos in Jellyfin and will add them as new again. Unfortunately there is no migration path.

View File

@ -192,7 +192,13 @@ class Show:
os.path.split(jf_ep["Path"].replace("\\", "/"))[0]
)[-1]
season_folder = os.path.join(base, channel_folder, expected_season)
os.makedirs(season_folder)
if not os.path.exists(season_folder):
original_umask = os.umask(0)
try:
os.mkdir(season_folder, mode=0o777)
finally:
os.umask(original_umask)
self._wait_for_season(expected_season)
return season_folder