From e60d27b77eb7afbc4d2d7e69d252a762d66bc20f Mon Sep 17 00:00:00 2001 From: Peter Wood Date: Sat, 14 Jun 2025 09:17:02 -0400 Subject: [PATCH] feat: Update Plex Recent Additions script to use custom SQLite binary and improve query output --- plex/plex-recent-additions.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plex/plex-recent-additions.sh b/plex/plex-recent-additions.sh index 0b4567e..b735db0 100755 --- a/plex/plex-recent-additions.sh +++ b/plex/plex-recent-additions.sh @@ -42,6 +42,10 @@ # Handle command line arguments DAYS=${1:-7} +# Plex SQLite path (custom Plex SQLite binary) +PLEX_SQLITE="/usr/lib/plexmediaserver/Plex SQLite" + + # Show help if requested if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then echo "Usage: $0 [DAYS]" @@ -69,20 +73,18 @@ if [ ! -f "$PLEX_DB" ]; then fi # Query the database for items added in the specified number of days -sqlite3 "$PLEX_DB" <= strftime('%s', 'now', '-$DAYS days') - and meta.title is null -ORDER BY meta.added_at DESC; +ORDER BY lib.name, meta.added_at DESC; EOF