Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main module improvements, build improvements and other bits #1302

Merged
merged 64 commits into from
Nov 21, 2024

Conversation

C0rn3j
Copy link
Collaborator

@C0rn3j C0rn3j commented Nov 18, 2024

Supersedes #1285

Apologies for the size of this PR, which will increase still, it could in theory be split into smaller parts if really needed.

  • Fix spamming 2021 on launch from t_extra as a random bit of example code was hanging there
  • Tear out all remaining start imports
  • Put optdepends into requirements_optional.txt
  • Move Windows depends into requirements_windows.txt
  • Attempt to fix win-build.sh for new file paths - untested, though
  • Fix trying to load Windows version on non-Windows systems
  • Remove seemingly useless macOS code for tap.stop(), tap is not defined anywhere in the codebase
  • Fix transfer-playtime-to not copying tags
  • Fix run.sh not deleting egg build folder
  • Make pyproject.toml packaging package assets, themes, templates, modules.
    • Parts of the projects were consolidated under the standard directories - src/tauon
    • Modules are now imported as from tauon.t_modules.t_extra - I suggest dropping the t_ prefix in the future, now that this is packaged together.
  • Remove duplicated alpha_blend function
  • Split migration code from t_main into t_db_migrate
  • Removed a piece of code that was always trying to run with an undefined enc variable
  • Fix broken pylast import
  • Upgrade Gtk to 4.0 in t_main, this complements an earlier fix, 3.0 should no longer be accidentally imported and clash with 4.0
  • Converted parts of code from os file calls to Path from pathlib
  • Converted first 1/10th of t_main from spaces to tabs
  • Fixed reload_albums() in t_main looking unbound current_date and current_title to the type checker
  • BS4 was used in t_main without being imported
  • Put the entire codebase under logging module, log all exceptions, colorize:
    image
  • Fix error loading Xcursor when variables are unset, which seems to be the default on a Wayland session:
    Before: Screencast_20241120_195815.webm
    After: Screencast_20241120_195455.webm
    Frankly am not sure if I like the fixed behavior? Now only set when the variables are set.
  • Fix mishandled SDL_WINDOWEVENT_DISPLAY_CHANGED events - gets rid of the Grrr bug
  • Fix up loading database/setting files even when they don't exist
  • Fix including opusfile.h instead of the correct opus/opusfile.h in phazor.c - seems the same on Windows and Linux

TODO:

  • Fix Found XDG-Music (uh no you didn't) #1240, without XDG implemented this code will crash due to the improved packaging clashing with hardcoded paths
  • Put in translations and anything else that's necessary into pyproject.toml too
    • Advice how to resolve that one welcome.
  • The coloring of logs might need to be disabled or fixed for Windows as it uses UNIX stuff at the moment - maybe modern Windows terminals support it though?
  • I probably won't be addressing it in this PR, but are all those console.print() commands needed now that the logging facility is used? Should we just migrate to logging and get rid of console.print()? Would have to figure out how to log the current messages though to be able to show them in the UI, as it does that. Maybe just log to a file too and open that file on demand?

@Taiko2k
Copy link
Owner

Taiko2k commented Nov 19, 2024

Upgrade Gtk to 4.0 in t_main, this complements an earlier fix, 3.0 should no longer be accidentally imported and clash with 4.0

This issue prevents the app from starting for me so Ive committed this fix ahead of this PR.

@C0rn3j
Copy link
Collaborator Author

C0rn3j commented Nov 20, 2024

Regarding last commit, should that still set even when the env vars are empty? See edited OP too for video demos.

@C0rn3j C0rn3j marked this pull request as ready for review November 21, 2024 03:17
@C0rn3j
Copy link
Collaborator Author

C0rn3j commented Nov 21, 2024

This is still not ideal, with the missing dealing with save dirs, but it's already massive, might as well get it in and deal with that next in another PR.

Force push undid my opus include delete, which is still needed because of
xiph/opusfile#41.

@Taiko2k Taiko2k merged commit ce49825 into Taiko2k:master Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Found XDG-Music (uh no you didn't)
2 participants