Release MyPicsDB: Pictures DB with EXIF, IPTC & XMP tags
(2013-12-18, 01:50)nemj Wrote:
Code:
elif self.args.method == "Random":
      picfanart = join(PIC_PATH,"fanart-date.png") #Just to have something, not needed?
      filelist = [row for row in MPDB.cur.request( """SELECT strPath,strFilename FROM Files WHERE RANDOM() %% 100 == 0 ORDER BY RANDOM() LIMIT 250 OFFSET %s"""%(offset) )]

This is obviously too hardcoded, but could be possible to make nice(?) I found the trick WHERE RANDOM() %% k somewhere on the web, works great for largeish tables. k should ideally be set by k = COUNT(*) / limit

Maybe something to add, also as option in main menu ("View x random pictures")?

Good idea, especially for using with ruuk's screensaver.

But I don't see a reason for the where condition because
Code:
ORDER BY RANDOM() LIMIT 250
already gives back a random list of 250 pictures.
No log no help.
Main page: https://github.com/Xycl
Repository: Xycl Repository Leia
Repository: Xycl Repository Matrix
Reply


Messages In This Thread
Beta Testers needed - by Xycl - 2012-11-06, 12:14
RE: [RELEASE] MyPicsDB: Pictures DB with EXIF, IPTC & XMP tags - by Xycl - 2013-12-18, 10:06
Filter / TAG Question ? - by knutklo - 2015-04-07, 16:38
Logout Mark Read Team Forum Stats Members Help
MyPicsDB: Pictures DB with EXIF, IPTC & XMP tags1