image: Fixed bug causing shuffle to use duplicate images

This commit is contained in:
Dylan Araps 2017-07-24 22:35:41 +10:00
parent 5ffcaafe82
commit 24ae58d942

View File

@ -13,7 +13,7 @@ from . import wallpaper
def get_random_image(img_dir):
"""Pick a random image file from a directory."""
current_wall = wallpaper.get()
current_wall = os.path.basename(current_wall[0])
current_wall = os.path.basename(current_wall)
file_types = (".png", ".jpg", ".jpeg", ".jpe", ".gif")
images = [img for img in os.scandir(img_dir)