Skip to content

Commit

Permalink
Update version to 2.6 and fix add_paths multiple call bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed Mar 7, 2024
1 parent 506ad8c commit b511688
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
EMAIL = "[email protected]"
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:
Expand Down
4 changes: 3 additions & 1 deletion static_ffmpeg/_add_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b511688

Please sign in to comment.