ProjectBabble icon indicating copy to clipboard operation
ProjectBabble copied to clipboard

(bug) Platform detection check failure in `misc_utils.py`

Open dfgHiatus opened this issue 1 year ago • 1 comments

During my efforts to get the Linux installer working, I observed some odd behavior coming from misc_utils.py. The culprit block of code is at its start:

9  from pygrabber.dshow_graph import FilterGraph
10
11 is_nt = True if sys.platform.startswith('win') else False
12 graph = FilterGraph()
13
...
26
27 if is_nt:
28    from pygrabber.dshow_graph import FilterGraph
29    graph = FilterGraph()
30

It looks like there is logic to avoid running some code on a non-windows platform, but it's being run anyways. Removing this on my windows machine still lets the app function as normal AFAIK, I would suggest removing this.

Also: The dep pygrabber exists in the requirement.txt in the top-level folder, but not the BabbleApp folder. This may cause some problems in the future.

dfgHiatus avatar Sep 28 '24 03:09 dfgHiatus

Also, we need only one platform check. IE:

is_nt = True if sys.platform.startswith('win') else False
is_nt = True if os.name == "nt" else False

Can just be:

is_nt = os.name == "nt"

dfgHiatus avatar Sep 28 '24 21:09 dfgHiatus