Skip to content

Commit

Permalink
add endline at the end of files
Browse files Browse the repository at this point in the history
  • Loading branch information
fsadannn committed Sep 16, 2020
1 parent d26b0c5 commit 8aa190e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion video_diet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ def convert_video_progress_bar(source: str, dest: str, manager=None):
res += proc.read()
exitstatus = proc.wait()
if exitstatus:
raise ffmpeg.Error('ffmpeg','',res)
raise ffmpeg.Error('ffmpeg','',res)
2 changes: 1 addition & 1 deletion video_diet/__main__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .main import app
app()
app()
28 changes: 14 additions & 14 deletions video_diet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ def get_codec(path: str):
metadata = FFProbe(path)
except:
return None

if 'video' in metadata.streams:
return metadata.video[0].codec_name
return metadata.audio[0].codec_name

return metadata.audio[0].codec_name


def convertion_path(path: Path, audio: bool ):

if not audio:

if path.suffix.lower() not in ['.mkv', '.mp4']:

return path.parent / (path.stem + '.mkv')

else:

if path.suffix.lower() not in ['.aac', '.m4a']:

return path.parent / (path.stem + '.aac')

return path.parent / ('conv-' + path.name)


Expand All @@ -42,14 +42,14 @@ def check_if_video(path: str):
return guess and 'video' in guess

def check_ignore(file_path, ignore_extension:str, ignore_path:str):

ignored_by_extension = ignore_extension is not None \
and str(file_path).lower().endswith(ignore_extension)
ignored_by_path = ignore_path is not None \
and str(ignore_path) in str(file_path)

if ignored_by_extension or ignored_by_path:
typer.secho(f'Ignoring: {file_path}')
return True
return False

return False

0 comments on commit 8aa190e

Please sign in to comment.