Skip to content

Commit

Permalink
If destination file exist, delete if
Browse files Browse the repository at this point in the history
  • Loading branch information
hiancdtrsnm committed Sep 16, 2020
1 parent 56bf7f1 commit dd72226
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "video-diet"
version = "0.1.8"
version = "0.1.9"
description = ""
authors = ["hian <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion video_diet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
else:
import pexpect as expect

__version__ = '0.1.8'
__version__ = '0.1.9'

pattern_duration = re.compile('duration[ \t\r]?:[ \t\r]?(.+?),[ \t\r]?start',re.IGNORECASE)
pattern_progress = re.compile('time=(.+?)[ \t\r]?bitrate',re.IGNORECASE)
Expand Down
6 changes: 6 additions & 0 deletions video_diet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def folder(path: Path = typer.Argument(
if get_codec(str(video)) != 'hevc':
new_path = convertion_path(video, False)

if new_path.exists():
os.remove(str(new_path))

try:
#convert_video(str(video), str(new_path))
convert_video_progress_bar(str(video), str(new_path), manager)
Expand All @@ -90,6 +93,9 @@ def folder(path: Path = typer.Argument(

new_path = convertion_path(audio, True)

if new_path.exists():
os.remove(str(new_path))

try:

convert_file(str(audio),str(new_path))
Expand Down

0 comments on commit dd72226

Please sign in to comment.