Reply To: Limit smart playlists ?

#7916
rpedde
Participant

@riro wrote:

Well.. another script that I cron every night works…

SQLITE="sqlite3"
DATABASE="/opt/var/mt-daapd/songs3.db"
PLSLIMIT=$1
PLSNAME=$2

echo "# --- Auto generated" >$PLSNAME
echo "# Generated `date` " >>$PLSNAME
$SQLITE $DATABASE 'SELECT path FROM songs ORDER BY time_added DESC LIMIT '$PLSLIMIT';'>>$PLSNAME

Oh, yeah… like that it’s doable. In fact, there’s no reason you could dummy up static playlists right in the database itself using sql queries (those are playlist type 0).

But yeah. There’s another example of why sqlite is a nicer backend than gdbm, just because you can get stuff from it.

Nice example, btw.

– Ron