This commit is contained in:
+7
-6
@@ -128,20 +128,21 @@ async def get_movies_list(dependencies: dict,
|
|||||||
|
|
||||||
# Get paginated results - PostgreSQL
|
# Get paginated results - PostgreSQL
|
||||||
query = f"""
|
query = f"""
|
||||||
SELECT imdb_id, path, released, dateadded, source, has_video_file, last_updated
|
SELECT imdb_id, title, year, path, released, dateadded, source, has_video_file, last_updated
|
||||||
FROM movies
|
FROM movies
|
||||||
WHERE {where_clause}
|
WHERE {where_clause}
|
||||||
ORDER BY last_updated DESC
|
ORDER BY last_updated DESC
|
||||||
LIMIT %s OFFSET %s
|
LIMIT %s OFFSET %s
|
||||||
"""
|
"""
|
||||||
cursor.execute(query, params + [limit, skip])
|
cursor.execute(query, params + [limit, skip])
|
||||||
|
|
||||||
movies = []
|
movies = []
|
||||||
for row in cursor.fetchall():
|
for row in cursor.fetchall():
|
||||||
movie = dict(row)
|
movie = dict(row)
|
||||||
# Extract title from path for display
|
# Use database title if available, otherwise extract from path
|
||||||
try:
|
if not movie.get('title'):
|
||||||
movie['title'] = Path(movie['path']).name if movie['path'] else movie['imdb_id']
|
try:
|
||||||
|
movie['title'] = Path(movie['path']).name if movie['path'] else movie['imdb_id']
|
||||||
except:
|
except:
|
||||||
movie['title'] = movie['imdb_id']
|
movie['title'] = movie['imdb_id']
|
||||||
# Map source to user-friendly description
|
# Map source to user-friendly description
|
||||||
|
|||||||
Reference in New Issue
Block a user