update to skipped files
Local Docker Build (Dev) / build-dev (push) Successful in 6s

This commit is contained in:
2025-11-03 16:04:42 -05:00
parent 3e3957234d
commit d83ba054b3
4 changed files with 59 additions and 14 deletions
+1 -1
View File
@@ -1 +1 @@
2.9.8-bulk-date-update 2.9.9-results-fix-skip-tracking
+36 -1
View File
@@ -215,7 +215,8 @@ class DatabasePopulator:
'updated': 0, 'updated': 0,
'skipped': 0, 'skipped': 0,
'errors': 0, 'errors': 0,
'duration': 0.0 'duration': 0.0,
'skipped_items': [] # Track what was skipped and why
} }
try: try:
@@ -267,6 +268,7 @@ class DatabasePopulator:
try: try:
season_num = episode.get('seasonNumber', 0) season_num = episode.get('seasonNumber', 0)
episode_num = episode.get('episodeNumber', 0) episode_num = episode.get('episodeNumber', 0)
episode_title = episode.get('title', 'Unknown')
if season_num < 0 or episode_num <= 0: if season_num < 0 or episode_num <= 0:
continue continue
@@ -276,12 +278,28 @@ class DatabasePopulator:
# Check if episode already exists # Check if episode already exists
existing = self.db.get_episode_date(imdb_id, season_num, episode_num) existing = self.db.get_episode_date(imdb_id, season_num, episode_num)
if existing and existing.get('dateadded'): if existing and existing.get('dateadded'):
skip_info = {
'title': series_title,
'episode_title': episode_title,
'season': season_num,
'episode': episode_num,
'reason': 'Already in database'
}
stats['skipped_items'].append(skip_info)
stats['skipped'] += 1 stats['skipped'] += 1
continue continue
# Only process episodes that have video files # Only process episodes that have video files
has_file = episode.get('hasFile', False) has_file = episode.get('hasFile', False)
if not has_file: if not has_file:
skip_info = {
'title': series_title,
'episode_title': episode_title,
'season': season_num,
'episode': episode_num,
'reason': 'No video file'
}
stats['skipped_items'].append(skip_info)
stats['skipped'] += 1 stats['skipped'] += 1
continue continue
@@ -310,6 +328,14 @@ class DatabasePopulator:
source = 'sonarr:aired_fallback' source = 'sonarr:aired_fallback'
elif not dateadded: elif not dateadded:
# No date available # No date available
skip_info = {
'title': series_title,
'episode_title': episode_title,
'season': season_num,
'episode': episode_num,
'reason': 'No import date from Sonarr history and no air date available'
}
stats['skipped_items'].append(skip_info)
stats['skipped'] += 1 stats['skipped'] += 1
continue continue
@@ -333,6 +359,15 @@ class DatabasePopulator:
stats['duration'] = time.time() - start_time stats['duration'] = time.time() - start_time
_log("INFO", f"TV episode population complete: {stats['added']} added, {stats['skipped']} skipped, {stats['errors']} errors in {stats['duration']:.2f}s") _log("INFO", f"TV episode population complete: {stats['added']} added, {stats['skipped']} skipped, {stats['errors']} errors in {stats['duration']:.2f}s")
# Log details of skipped items
if stats['skipped_items']:
_log("INFO", f"Skipped episodes details ({len(stats['skipped_items'])} total):")
for item in stats['skipped_items'][:20]: # Only log first 20 to avoid spam
_log("INFO", f" - {item['title']} S{str(item['season']).zfill(2)}E{str(item['episode']).zfill(2)} ({item.get('episode_title', 'Unknown')}): {item['reason']}")
if len(stats['skipped_items']) > 20:
_log("INFO", f" ... and {len(stats['skipped_items']) - 20} more (see web interface for full list)")
return stats return stats
def populate_all(self) -> Dict[str, any]: def populate_all(self) -> Dict[str, any]:
+1 -1
View File
@@ -711,6 +711,6 @@
<!-- Toast Notifications --> <!-- Toast Notifications -->
<div class="toast-container" id="toast-container"></div> <div class="toast-container" id="toast-container"></div>
<script src="/static/js/app.js?v=2.9.8-bulk-date-update"></script> <script src="/static/js/app.js?v=2.9.9-results-fix-skip-tracking"></script>
</body> </body>
</html> </html>
+21 -11
View File
@@ -2063,14 +2063,13 @@ function updatePopulateProgress(status) {
progressText.textContent = 'Complete!'; progressText.textContent = 'Complete!';
} }
// Show results (API returns movies/tv directly, not nested in result) // Show results (API returns movies/tv with nested stats)
if (resultsDiv && (status.movies || status.tv)) { if (resultsDiv && (status.movies || status.tv)) {
const result = status; // Use status directly, not status.result
let html = '<h4>Population Results</h4>'; let html = '<h4>Population Results</h4>';
// Movies // Movies
if (result.movies) { if (status.movies && status.movies.stats) {
const m = result.movies; const m = status.movies.stats;
html += '<div class="populate-section">'; html += '<div class="populate-section">';
html += '<h5><i class="fas fa-film"></i> Movies</h5>'; html += '<h5><i class="fas fa-film"></i> Movies</h5>';
html += '<ul>'; html += '<ul>';
@@ -2080,12 +2079,20 @@ function updatePopulateProgress(status) {
html += `<li>Errors: ${m.errors || 0}</li>`; html += `<li>Errors: ${m.errors || 0}</li>`;
html += `<li>Duration: ${(m.duration || 0).toFixed(2)}s</li>`; html += `<li>Duration: ${(m.duration || 0).toFixed(2)}s</li>`;
html += '</ul>'; html += '</ul>';
// Show skipped items if any
if (m.skipped_items && m.skipped_items.length > 0) {
html += '<details style="margin-top: 10px;"><summary>Skipped Movies (' + m.skipped_items.length + ')</summary><ul>';
m.skipped_items.forEach(item => {
html += `<li><strong>${item.title || 'Unknown'}</strong> (${item.year || 'N/A'}) [${item.imdb_id || 'No IMDb'}] - ${item.reason}</li>`;
});
html += '</ul></details>';
}
html += '</div>'; html += '</div>';
} }
// TV Episodes // TV Episodes
if (result.tv) { if (status.tv && status.tv.stats) {
const tv = result.tv; const tv = status.tv.stats;
html += '<div class="populate-section">'; html += '<div class="populate-section">';
html += '<h5><i class="fas fa-tv"></i> TV Shows</h5>'; html += '<h5><i class="fas fa-tv"></i> TV Shows</h5>';
html += '<ul>'; html += '<ul>';
@@ -2096,12 +2103,15 @@ function updatePopulateProgress(status) {
html += `<li>Errors: ${tv.errors || 0}</li>`; html += `<li>Errors: ${tv.errors || 0}</li>`;
html += `<li>Duration: ${(tv.duration || 0).toFixed(2)}s</li>`; html += `<li>Duration: ${(tv.duration || 0).toFixed(2)}s</li>`;
html += '</ul>'; html += '</ul>';
html += '</div>'; // Show skipped items if any
if (tv.skipped_items && tv.skipped_items.length > 0) {
html += '<details style="margin-top: 10px;"><summary>Skipped Episodes (' + tv.skipped_items.length + ')</summary><ul>';
tv.skipped_items.forEach(item => {
html += `<li><strong>${item.title || 'Unknown'}</strong> S${String(item.season).padStart(2,'0')}E${String(item.episode).padStart(2,'0')} - ${item.reason}</li>`;
});
html += '</ul></details>';
} }
html += '</div>';
// Total duration
if (result.total_duration) {
html += `<p><strong>Total Duration:</strong> ${result.total_duration.toFixed(2)}s</p>`;
} }
resultsDiv.innerHTML = html; resultsDiv.innerHTML = html;