This commit is contained in:
@@ -5,6 +5,7 @@ Bulk populates the NFOGuard database from Radarr/Sonarr
|
||||
Phase 4: Replace NFO-based initial population with direct DB/API queries
|
||||
"""
|
||||
import time
|
||||
import hashlib
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
@@ -82,16 +83,28 @@ class DatabasePopulator:
|
||||
_log("DEBUG", f"Extracted IMDb ID {imdb_id} from path for: {movie.get('title')}")
|
||||
|
||||
if not imdb_id:
|
||||
# Generate placeholder IMDb ID using hash of path
|
||||
path_hash = hashlib.md5(path.encode()).hexdigest()[:12]
|
||||
imdb_id = f"missing-{path_hash}"
|
||||
skip_reason = 'No IMDb ID found'
|
||||
skip_info = {
|
||||
'title': movie.get('title', 'Unknown'),
|
||||
'year': movie.get('year'),
|
||||
'imdb_id': imdb_id,
|
||||
'path': path,
|
||||
'reason': skip_reason
|
||||
}
|
||||
stats['skipped_items'].append(skip_info)
|
||||
_log("DEBUG", f"Skipping movie without IMDb ID: {movie.get('title')} (path: {path})")
|
||||
# Note: Cannot mark in DB because no IMDb ID (primary key)
|
||||
_log("DEBUG", f"Movie without IMDb ID: {movie.get('title')} (path: {path}), using placeholder {imdb_id}")
|
||||
|
||||
# Mark as skipped in database with placeholder IMDb ID
|
||||
self.db.mark_movie_skipped(
|
||||
imdb_id=imdb_id,
|
||||
title=movie.get('title', 'Unknown'),
|
||||
year=movie.get('year', 0),
|
||||
path=path,
|
||||
reason=skip_reason
|
||||
)
|
||||
stats['skipped'] += 1
|
||||
continue
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>NFOGuard - Database Management</title>
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=2.10.0-skipped-tracking-fix2">
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=2.10.0-skipped-tracking-fix3">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- Header -->
|
||||
<header class="app-header">
|
||||
<div class="header-content">
|
||||
<h1><i class="fas fa-shield-alt"></i> NFOGuard <span style="font-size: 0.5em; color: #888;">v2.10.0-skipped-tracking-fix2</span></h1>
|
||||
<h1><i class="fas fa-shield-alt"></i> NFOGuard <span style="font-size: 0.5em; color: #888;">v2.10.0-skipped-tracking-fix3</span></h1>
|
||||
<p>Database Management & Reporting</p>
|
||||
</div>
|
||||
<div class="auth-status" id="auth-status" style="display: none;">
|
||||
@@ -723,6 +723,6 @@
|
||||
<!-- Toast Notifications -->
|
||||
<div class="toast-container" id="toast-container"></div>
|
||||
|
||||
<script src="/static/js/app.js?v=2.10.0-skipped-tracking-fix2"></script>
|
||||
<script src="/static/js/app.js?v=2.10.0-skipped-tracking-fix3"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user