def read_configuration(): user_dir = files.get_user_home_directory() configuration_file = user_dir + '/.bommerge/configuration.json' if files.file_exist(configuration_file): configuration = files.load_json_file(configuration_file) token = str(configuration['Distributors']['TME']['token']) app_secret = str(configuration['Distributors']['TME']['app_secret']) tme_config = {'token': token, 'app_secret': app_secret} return tme_config else: print("Unable to read bommerge configuration file. " + str(configuration_file))
def iterate_episodes(self): for season in range(1, 10): season_dir = 'S' + str(season) for ep in range(1, 27): ep_dir = 's' + str(season) + 'e' + str(ep) print(ep_dir) sound_path = self.path_to_audio + '\\' + season_dir + '\\' + ep_dir if not utils_files.file_exist(sound_path): continue self.copy_files(sound_path, season, ep)
def iterate_folder(self): folders = [ 'EQG FG', 'EQG Holidays Unwrapped', 'EQG LoE', 'EQG Original', 'EQG RoF Special Source', 'EQG RR', ] for folder in folders: sound_path = self.path_to_audio + '\\' + folder if not utils_files.file_exist(sound_path): continue print(folder) self.convert_files(sound_path, 'EQG', folder)
def validate(self): if self.path_to_audio is None or not utils_files.file_exist( self.path_to_audio): return False if self.prefix is None: return False if self.pony_name is None: return False if self.noise_filter is None: return False return True
def first_run(): user_dir = files.get_user_home_directory() configuration_file = user_dir + '/.bommerge/configuration.json' return files.file_exist(configuration_file) is False