PiInk icon indicating copy to clipboard operation
PiInk copied to clipboard

Album rotation - multiple images

Open NullVsNone opened this issue 1 year ago • 1 comments

Could this be enhanced to support uploading multiple images, with a set timer to rotate between the "album" of images?

Not very experienced in python (nor Pi(s)), but something along the lines of:

  • No longer calling delete image

https://github.com/tlstommy/PiInk/blob/511791410bd8a3af3004ea20ad743f785f81900f/src/webserver.py#L89

  • [Optional] Use a UUID for filename for multiple uploads

https://github.com/tlstommy/PiInk/blob/511791410bd8a3af3004ea20ad743f785f81900f/src/webserver.py#L90

  • Introducing an updater
import sched, time, random

def cycle_album(scheduler): 
    scheduler.enter(3600, 1, cycle_album, (scheduler,))
    updateEink(random.choice(UPLOAD_FOLDER, ORIENTATION,ADJUST_AR)

album_schedule = sched.scheduler(time.time, time.sleep)
album_schedule.enter(3600, 1, cycle_album, (album_schedule,))
album_schedule.run()

NullVsNone avatar Nov 30 '23 01:11 NullVsNone