diff --git a/README.md b/README.md index cbfa93e..c25189b 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ Then run `./activate.sh` to activate the shell. ffmpeg and ffprobe are both version: 5.0 ## Release History + * 2.6: Bugfix, `add_paths(...)` can now be called multiple times without polluting the os env path. * 2.5: `add_paths()` now has optional `weak` parameter (default False). If True then `ffmpeg/ffprobe` binaries are only only if either `ffmpeg` OR `ffprobe` doesn't already exist on path * 2.3: Adds `static_ffmpeg.add_paths()` * 2.2: Addressed [bug 9](https://github.com/zackees/static_ffmpeg/issues/9) in some cases static_ffmpeg couldn't handle spaces in mp4 names. diff --git a/setup.py b/setup.py index 61fb6bc..62845ec 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ EMAIL = "dont@email.me" AUTHOR = "Zach Vorhies" REQUIRES_PYTHON = ">=3.6.0" -VERSION = "2.5" +VERSION = "2.6" # The text of the README file with open(os.path.join(HERE, "README.md")) as fd: diff --git a/static_ffmpeg/_add_paths.py b/static_ffmpeg/_add_paths.py index 05adb59..23298d1 100644 --- a/static_ffmpeg/_add_paths.py +++ b/static_ffmpeg/_add_paths.py @@ -21,5 +21,7 @@ def add_paths(weak=False) -> bool: if has_ffmpeg and has_ffprobe: return False ffmpeg, _ = get_or_fetch_platform_executables_else_raise() - os.environ["PATH"] = os.pathsep.join([os.path.dirname(ffmpeg), os.environ["PATH"]]) + ffmpeg_path = os.path.dirname(ffmpeg) + if ffmpeg_path not in os.environ["PATH"]: + os.environ["PATH"] = os.pathsep.join([ffmpeg_path, os.environ["PATH"]]) return True