def path_check(name, new_path): if not new_path.exists(): which = shutil.which(str(new_path)) if not which: error_message( f"No {name} instance found at {new_path}, not updated") raise FastFlixInternalException( f"No {name} instance found at {new_path}, not updated") return Path(which) if not new_path.is_file(): error_message(f"{new_path} is not a file") raise FastFlixInternalException( f"No {name} instance found at {new_path}, not updated") return new_path
def add_to_queue(self): if not self.main.encoding_checks(): return False if not self.main.build_commands(): return False for video in self.app.fastflix.conversion_list: if video.status.complete: continue if self.app.fastflix.current_video.source == video.source: source_in_queue = True if self.app.fastflix.current_video.video_settings.output_path == video.video_settings.output_path: raise FastFlixInternalException( f"{video.video_settings.output_path} {t('out file is already in queue')}" ) # if source_in_queue: # TODO ask if ok # return self.app.fastflix.conversion_list.append( copy.deepcopy(self.app.fastflix.current_video)) self.new_source() save_queue(self.app.fastflix.conversion_list, self.app.fastflix.queue_path, self.app.fastflix.config)
def get_settings(self): tracks = [] burn_in_count = 0 for track in self.tracks: if track.enabled: tracks.append( SubtitleTrack( index=track.index, outdex=track.outdex, disposition=track.disposition, language=track.language, burn_in=track.burn_in, )) if track.burn_in: burn_in_count += 1 if burn_in_count > 1: raise FastFlixInternalException( t("More than one track selected to burn in")) self.app.fastflix.current_video.video_settings.subtitle_tracks = tracks