diff --git a/VERSION b/VERSION index 35cee72..79a6144 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4.3 +2.4.4 diff --git a/api/routes.py b/api/routes.py index 8c9b738..4e2e12b 100644 --- a/api/routes.py +++ b/api/routes.py @@ -541,6 +541,10 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N raise HTTPException(status_code=400, detail="scan_type must be 'both', 'tv', or 'movies'") async def run_scan(): + from datetime import datetime + start_time = datetime.now() + print(f"🚀 MANUAL SCAN STARTED: {scan_type} scan initiated at {start_time.strftime('%Y-%m-%d %H:%M:%S')}") + paths_to_scan = [] if path: paths_to_scan = [Path(path)] @@ -620,6 +624,13 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N print(f"INFO: Processed {movie_count} movies, yielding to other requests...") print(f"INFO: Completed movie scan: {movie_count} movies processed in {scan_path}") + + # Log scan completion with duration + end_time = datetime.now() + duration = end_time - start_time + duration_str = str(duration).split('.')[0] # Remove microseconds + print(f"✅ MANUAL SCAN COMPLETED: {scan_type} scan finished at {end_time.strftime('%Y-%m-%d %H:%M:%S')}") + print(f"⏱️ MANUAL SCAN DURATION: {duration_str} (total time: {duration.total_seconds():.1f} seconds)") background_tasks.add_task(run_scan) return {"status": "started", "message": f"Manual {scan_type} scan started"} diff --git a/api/web_routes.py b/api/web_routes.py index d4fb73e..1df7d10 100644 --- a/api/web_routes.py +++ b/api/web_routes.py @@ -427,6 +427,8 @@ async def get_missing_dates_report(dependencies: dict): 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 + movie['source_description'] = map_source_to_description(movie.get('source')) movies_missing.append(movie) # Episodes without dates - PostgreSQL compatible @@ -453,6 +455,8 @@ async def get_missing_dates_report(dependencies: dict): episode['series_title'] = Path(episode['path']).name if episode['path'] else episode['imdb_id'] except: episode['series_title'] = episode['imdb_id'] + # Map source to user-friendly description + episode['source_description'] = map_source_to_description(episode.get('source')) episodes_missing.append(episode) # Summary statistics - PostgreSQL compatible @@ -556,9 +560,9 @@ async def get_dashboard_stats(dependencies: dict): ORDER BY count DESC """) if db.db_type == "postgresql": - movie_sources = [{"source": list(row.values())[0], "count": list(row.values())[1]} for row in cursor.fetchall()] + movie_sources = [{"source": list(row.values())[0], "source_description": map_source_to_description(list(row.values())[0]), "count": list(row.values())[1]} for row in cursor.fetchall()] else: - movie_sources = [{"source": row[0], "count": row[1]} for row in cursor.fetchall()] + movie_sources = [{"source": row[0], "source_description": map_source_to_description(row[0]), "count": row[1]} for row in cursor.fetchall()] # Source distribution for episodes cursor.execute(""" @@ -569,9 +573,9 @@ async def get_dashboard_stats(dependencies: dict): ORDER BY count DESC """) if db.db_type == "postgresql": - episode_sources = [{"source": list(row.values())[0], "count": list(row.values())[1]} for row in cursor.fetchall()] + episode_sources = [{"source": list(row.values())[0], "source_description": map_source_to_description(list(row.values())[0]), "count": list(row.values())[1]} for row in cursor.fetchall()] else: - episode_sources = [{"source": row[0], "count": row[1]} for row in cursor.fetchall()] + episode_sources = [{"source": row[0], "source_description": map_source_to_description(row[0]), "count": row[1]} for row in cursor.fetchall()] # Calculate total missing dates (movies + episodes) total_missing_dates = movies_without_dates + episodes_without_dates diff --git a/static/js/app.js b/static/js/app.js index d1822a6..49f082f 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -253,7 +253,7 @@ function updateMoviesTable(data) { ${movie.imdb_id} ${movie.released || '-'} ${dateadded || '-'} - ${movie.source || 'Unknown'} + ${movie.source_description || movie.source || 'Unknown'} ${dateType} ${hasVideoBadge} @@ -495,7 +495,7 @@ function showEpisodesModal(data) { S${episode.season.toString().padStart(2, '0')}E${episode.episode.toString().padStart(2, '0')} ${episode.aired || '-'} ${dateCell} - ${episode.source || 'Unknown'} + ${episode.source_description || episode.source || 'Unknown'} ${hasVideoBadge}