From ed96578c1434c28b391252e6abc0eebd640df629 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Mon, 8 Jan 2018 05:52:05 -0600 Subject: [PATCH] Fix background images bug. --- themes/default/js/greeter.js | 4 ++-- web-greeter/bridge/ThemeUtils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/default/js/greeter.js b/themes/default/js/greeter.js index 032f160..d995d77 100644 --- a/themes/default/js/greeter.js +++ b/themes/default/js/greeter.js @@ -193,14 +193,14 @@ class ThemeConfig { this.logo = greeter_config.branding.logo || 'img/antergos.png'; this.user_image = greeter_config.branding.user_image || 'img/antergos-logo-user.png'; - this.background_images_dir = greeter_config.branding.background_images || '/usr/share/backgrounds'; + this.background_images_dir = greeter_config.branding.background_images_dir || '/usr/share/backgrounds'; this.debug = greeter_config.greeter.debug_mode || false; this.background_images = this._get( 'background_manager', 'background_images' ); this.images_cache_expires = moment.unix( parseInt( this._get( 'background_manager', 'cache_expires' ) ) ); let expired = ( null === this.background_images || ! this.images_cache_expires.isValid() || moment().isAfter( this.images_cache_expires ) ); - if ( ! expired || ! this.background_images_dir ) { + if ( this.background_images && this.background_images.length > 0 && ! expired ) { this.background_images = JSON.parse( this.background_images ); return callback(); } diff --git a/web-greeter/bridge/ThemeUtils.py b/web-greeter/bridge/ThemeUtils.py index b05d7bf..5f4fdf4 100644 --- a/web-greeter/bridge/ThemeUtils.py +++ b/web-greeter/bridge/ThemeUtils.py @@ -74,7 +74,7 @@ class ThemeUtils(BridgeObject): return [] if only_images: - file_types = ('jpg', 'jpeg', 'png', 'gif', 'bmp') + file_types = ('jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp') result = [ glob('{0}/**/*.{1}'.format(dir_path, ftype), recursive=True) for ftype in file_types