-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmedia.py
37 lines (28 loc) · 1.17 KB
/
media.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
from pick import pick
def get_media_type():
title = "Please choose the type of media you want to import: "
media_type = ['Movies', 'TV Shows', 'Anime']
media_type, index = pick(media_type, title, indicator='->')
return media_type
def create_show_directory(root_path, media_type):
show_name = input(f"Please provide the name of the {media_type}. This will be the name of the show's folder: ")
if os.path.exists(root_path):
show_path = os.path.join(root_path, media_type, show_name)
else:
print(f"Error, {root_path} not found.")
exit(1)
if not os.path.exists(show_path):
os.makedirs(show_path)
else:
print(f"{show_path} folder already exists.")
return show_path
def create_season_directory(show_path):
season = input("Please provide which season you are importing, only type a number. This will be the season's folder: ")
show_path = os.path.join(show_path, f'Season {season}')
if not os.path.exists(show_path):
os.makedirs(show_path)
print(f"successfully created {show_path} folder.")
else:
print(f'{show_path} folder already exists.')
return show_path