Komorebi-Fork / komorebi

A beautiful and customisable wallpaper manager for Linux
GNU General Public License v3.0
271 stars 17 forks source link

[BUG]: Wallpaper Creator - Unable to create video wallpaper in python rewrite #93

Open Kangie opened 4 months ago

Kangie commented 4 months ago

What I did

Attempt to create a video wallpaper from a file on a local disk

What I got

PYTHONPATH="/usr/local/lib/python3.11/site-packages:${PATH}" python3.11 /usr/local/bin/komorebi-wallpaper-creator --log=DEBUG 
Welcome to komorebi Wallpaper Creator
[DEBUG] (22:20:26): Gtk initialized
[DEBUG] (22:20:26): Loading WallpaperWindow...
[DEBUG] (22:20:27): Loaded WindowWallpaper
/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/window.py:156: RuntimeWarning: Expecting to marshal a borrowed reference for <GdkPixbuf.Pixbuf object at 0x7fbed1585980 (GdkPixbuf at 0x562db3e81350)>, but nothing in Python is holding a reference to this object. See: https://bugzilla.gnome.org/show_bug.cgi?id=687522
  self.options_page.set_blank()
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/window.py", line 166, in _on_next_btn_released
    self.stack.add_named(pages.FinalPage(), 'final')
                         ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/pages.py", line 597, in __init__
    self.create_wallpaper()
  File "/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/pages.py", line 624, in create_wallpaper
    Gio.File.new_for_path(utilities.thumbnail_path).copy(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Argument 0 does not allow None as a value

The wallpaper is created, but komorebi thinks that it is invalid.

The wallpaper directory only contains a copy of the video file and no configuration.

What I expected

For the wallpaper creator to succeed when not given a thumbnail!

Note: [WARNING] (22:23:52): found an invalid wallpaper with name: komorebi.gresource should probably be fixed here too.

Kangie commented 4 months ago

In this case the issue is because if a thumbnail is not specified we try and unconditionally move(!) it into the dir anyway and never end up writing out the wallpaper config.

https://github.com/Komorebi-Fork/komorebi/blob/ff925cb9bda32094cbd7b36868809c64576dc4cf/komorebi/wallpaper_creator/pages.py#L624-L626

What we really need to do is: