zsarnett / slideshow-card

Slide Show Card for Home Assistant's UI LoveLace
28 stars 17 forks source link

Sort folder list per filename #3

Closed mawi13 closed 5 years ago

mawi13 commented 5 years ago

Could it be possible to sort the pictures with the filename? I'm using the slideshow card to show the snapshots from my Motioneye Cam and would like to have it in a sorted way.

mawi13 commented 5 years ago

Oh that was easy: def get_files_list(folder_path, filter_term): """Return the list of files, applying filter.""" query = folder_path + filter_term files_list = glob.glob(query) files_list.sort(key=os.path.getmtime) return files_list

sorry for that