Browse Source

Make gallery cover index variable

master
Marien Fressinaud 6 years ago
parent
commit
534866add5
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      boop.py

+ 2
- 1
boop.py View File

continue continue


photos.sort(key=itemgetter("name")) photos.sort(key=itemgetter("name"))
cover_index = (len(gallery_dir.name) + 42) % len(photos)
gallery = { gallery = {
"name": gallery_dir.name, "name": gallery_dir.name,
"path": gallery_dir.path, "path": gallery_dir.path,
"url": gallery_dir.name, "url": gallery_dir.name,
"num_photos": len(photos), "num_photos": len(photos),
"photos": photos, "photos": photos,
"cover_photo": photos[0],
"cover_photo": photos[cover_index],
} }
yield gallery yield gallery



Loading…
Cancel
Save