giantpinkrobots / varia

Download manager based on aria2
https://giantpinkrobots.github.io/varia/
Mozilla Public License 2.0
270 stars 25 forks source link

Cannot run app on chromeOS #94

Open andrea-scape opened 2 months ago

andrea-scape commented 2 months ago

the app installs just fine but it does not run. Here is the terminal log:

ascape@penguin:~$ flatpak run io.github.giantpinkrobots.varia Traceback (most recent call last): File "/app/share/varia/varia/variamain.py", line 323, in main if (os.path.exists(GLib.get_user_special_dir(GLib.USER_DIRECTORY_DOWNLOAD))): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 19, in exists TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/share/varia/../../bin/varia-py.py", line 36, in sys.exit(main(VERSION, aria2cexec)) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/share/varia/varia/variamain.py", line 328, in main download_directory = GLib.get_user_special_dir(GLib.USER_DIRECTORY_HOME) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gi/overrides/init.py", line 31, in getattr return getattr(self._introspection_module, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gi/module.py", line 130, in getattr raise AttributeError("%r object has no attribute %r" % ( AttributeError: 'gi.repository.GLib' object has no attribute 'USER_DIRECTORY_HOME'

giantpinkrobots commented 2 months ago

I know what's going on here but I had postponed writing a solution for it because I didn't think anyone would encounter it. Basically if Varia can't find your downloads directory, it will try to set the main user directory as the place it will download things into. There is no fallback after the user directory check so it'll crash if that can't be found either.

You could try to create a HOME directory in the Linux terminal using mkhomedir_helper. I have no idea how Chrome OS' Linux environment differs from a standard Linux install though and even if this issue is fixed, more difficult to fix issues may arise later. You should know you're on unsupported territory.

giantpinkrobots commented 1 month ago

Hey, just thought of something. Can you run "xdg-user-dirs-update" inside of the Linux command line?

andrea-scape commented 1 month ago

You are a genius, it worked! I love your app!

[image: image.png]

On Fri, May 10, 2024, 10:40 AM Giant Pink Robots! @.***> wrote:

Hey, just thought of something. Can you run "xdg-user-dirs-update" inside of the Linux command line?

— Reply to this email directly, view it on GitHub https://github.com/giantpinkrobots/varia/issues/94#issuecomment-2104195795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQPJNNX4XPULA666EP77OXTZBSBWBAVCNFSM6AAAAABHGDHZWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUGE4TKNZZGU . You are receiving this because you authored the thread.Message ID: @.***>

giantpinkrobots commented 1 month ago

Alright, glad it worked. It was just because you didn't have a standard Downloads folder. I will add a function that handles that instead of just letting the app crash.