From 056c0456f94d828530108e70d3bc7cfb60c66ab8 Mon Sep 17 00:00:00 2001 From: cwilvx Date: Thu, 3 Apr 2025 14:25:44 +0300 Subject: [PATCH] install libev on build scripts + fix: scanning system dirs on mac --- .github/workflows/release.yml | 2 +- .gitignore | 3 +++ aarch64_buildscript | 2 +- app/arg_handler.py | 2 +- app/lib/populate.py | 3 +-- app/lib/tagger.py | 4 ---- app/utils/filesystem.py | 10 ++++++++++ 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6c1f8cd..35e4531f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: - name: Activate virtualenv (linux) if: matrix.os == 'ubuntu-20.04' run: | - source .venv/bin/activate && pip install bjoern + apt-get install libev-dev && source .venv/bin/activate && pip install bjoern - name: Activate virtualenv (windows) if: matrix.os == 'windows-2019' run: | diff --git a/.gitignore b/.gitignore index 8b104bf5..206d1029 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ testdata.py test.py nohup.out *s.json + + +.DS_Store \ No newline at end of file diff --git a/aarch64_buildscript b/aarch64_buildscript index 218b9e33..188d3de1 100755 --- a/aarch64_buildscript +++ b/aarch64_buildscript @@ -23,7 +23,7 @@ cd swingmusicbuilder git clone --quiet https://github.com/swing-opensource/swingmusic-client.git git clone --quiet https://github.com/swing-opensource/swingmusic.git -# Manual poetry installation as installers are broken. + python3.11 -m venv venv source venv/bin/activate diff --git a/app/arg_handler.py b/app/arg_handler.py index e8efa1a8..f98b7ea1 100644 --- a/app/arg_handler.py +++ b/app/arg_handler.py @@ -71,7 +71,7 @@ def handle_build(*args, **kwargs): f"--add-data=client{_s}client", f"--add-data=version.txt{_s}.", f"--add-data={flask_openapi_path}/templates/static{_s}flask_openapi3/templates/static", - f"--icon=assets/logo-fill.light.ico", + "--icon=assets/logo-fill.light.ico", "-y", ] ) diff --git a/app/lib/populate.py b/app/lib/populate.py index 26494a26..0498b83e 100644 --- a/app/lib/populate.py +++ b/app/lib/populate.py @@ -1,5 +1,4 @@ from dataclasses import asdict -import math import os from concurrent.futures import ProcessPoolExecutor import platform @@ -45,7 +44,7 @@ class CordinateMedia: ) log.error(e) # REVIEW More informations = good else: - log.warning(f"No internet connection. Downloading artist images suspended!") + log.warning("No internet connection. Downloading artist images suspended!") # Re-process the new artist images. if tried_to_download_new_images: diff --git a/app/lib/tagger.py b/app/lib/tagger.py index e0e799a1..67e71b5d 100644 --- a/app/lib/tagger.py +++ b/app/lib/tagger.py @@ -1,4 +1,3 @@ -import math import os from functools import partial from multiprocessing import Pool, cpu_count @@ -116,9 +115,6 @@ class IndexTracks: return unmodified_paths, modified_tracks - def get_untagged(self): - tracks = TrackTable.get_all() - @staticmethod def _process_file(file: str, config: UserConfig) -> dict | None: """Worker function to process individual files""" diff --git a/app/utils/filesystem.py b/app/utils/filesystem.py index 8f1ec5e7..b437438a 100644 --- a/app/utils/filesystem.py +++ b/app/utils/filesystem.py @@ -14,6 +14,16 @@ def run_fast_scandir(_dir: str, full=False) -> tuple[list[str], list[str]]: Scans a directory for files with a specific extension. Returns a list of files and folders in the directory. """ + # if on mac, ignore Library folder and its children + if os.name == "posix": + dir_path = Path(_dir) + library_path = Path.home() / "Library" + if dir_path == library_path or library_path in dir_path.parents: + return [], [] + + # if the path contains "node_modules" ignore + if "node_modules" in _dir: + return [], [] if _dir == "": return [], []