add note if directory mounted

This commit is contained in:
Brandon Egger 2024-06-08 21:08:00 -05:00
parent 7f47b65521
commit f3ac6cd344
2 changed files with 18 additions and 0 deletions

View File

@ -1,14 +1,24 @@
import typer
from rich import print
from utils.directory import is_mounted_directory
app = typer.Typer()
@app.command()
def scan(directory: str):
"""
Scan a path for mkv files. Used to test the directory before running a conversion job.
"""
print("Scanning directory:", directory)
if is_mounted_directory(directory):
print("Directory is detected as mounted. To improve file I/O performance, when performing conversions the mkv file will be copied locally during video encoding.")
@app.command()
def convert(directory: str):
"""
Convert all mkv files in a directory to mp4 and split subtitles.
"""
pass
if __name__ == "__main__":

View File

@ -0,0 +1,8 @@
import os
def is_mounted_directory(path: str) -> bool:
"""
Check if a directory is a mounted directory.
"""
return os.path.ismount(path)