From db203b5f26166641f32a3b763b18e450c3e772f7 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Mon, 3 Nov 2025 15:27:17 -0500 Subject: [PATCH] update to movie db population --- VERSION | 2 +- api/web_routes.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 7f1019c..ebceeb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.9.4-skip-tracking +2.9.5-web-title-display diff --git a/api/web_routes.py b/api/web_routes.py index 82e4c9a..27c9f36 100644 --- a/api/web_routes.py +++ b/api/web_routes.py @@ -128,20 +128,21 @@ async def get_movies_list(dependencies: dict, # Get paginated results - PostgreSQL query = f""" - SELECT imdb_id, path, released, dateadded, source, has_video_file, last_updated - FROM movies + SELECT imdb_id, title, year, path, released, dateadded, source, has_video_file, last_updated + FROM movies WHERE {where_clause} ORDER BY last_updated DESC LIMIT %s OFFSET %s """ cursor.execute(query, params + [limit, skip]) - + movies = [] for row in cursor.fetchall(): movie = dict(row) - # Extract title from path for display - try: - movie['title'] = Path(movie['path']).name if movie['path'] else movie['imdb_id'] + # Use database title if available, otherwise extract from path + if not movie.get('title'): + try: + movie['title'] = Path(movie['path']).name if movie['path'] else movie['imdb_id'] except: movie['title'] = movie['imdb_id'] # Map source to user-friendly description