mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
actor sync
This commit is contained in:
@@ -63,9 +63,9 @@
|
||||
<h5 class="mt-3" id="syncStatus">Idle</h5>
|
||||
<p class="text-muted mb-0">Last sync: <span id="lastSyncTime">Never</span></p>
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<span>Movies</span>
|
||||
@@ -75,7 +75,7 @@
|
||||
<div id="movieProgress" class="progress-bar bg-success" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<span>TV Shows</span>
|
||||
@@ -85,7 +85,7 @@
|
||||
<div id="tvShowProgress" class="progress-bar bg-info" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<span>Music</span>
|
||||
@@ -95,6 +95,16 @@
|
||||
<div id="musicProgress" class="progress-bar bg-warning" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<span>Adult Videos</span>
|
||||
<span id="adultVideoCount">0</span>
|
||||
</div>
|
||||
<div class="progress" style="height: 5px;">
|
||||
<div id="adultVideoProgress" class="progress-bar bg-danger" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -107,6 +117,9 @@
|
||||
<span><i class="bi bi-search me-2"></i> Scan Libraries</span>
|
||||
<span class="badge bg-primary rounded-pill" id="pendingScans">0</span>
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" id="syncStashPerformers">
|
||||
<i class="bi bi-person-lines-fill me-2"></i> Sync Stash Performers
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action">
|
||||
<i class="bi bi-arrow-clockwise me-2"></i> Update Metadata
|
||||
</button>
|
||||
@@ -248,6 +261,13 @@
|
||||
$('#scanLibraries').click(function() {
|
||||
startSync('scan');
|
||||
});
|
||||
|
||||
// Handle sync Stash performers
|
||||
$('#syncStashPerformers').click(function() {
|
||||
if (confirm('Are you sure you want to sync existing performers with Stash? This will update your local performer data with information from Stash.')) {
|
||||
syncStashPerformers();
|
||||
}
|
||||
});
|
||||
|
||||
// Handle cancel sync
|
||||
$('#cancelSync').click(function() {
|
||||
@@ -294,6 +314,35 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Function to sync Stash performers
|
||||
function syncStashPerformers() {
|
||||
// Show loading state
|
||||
$('#syncStashPerformers').prop('disabled', true).html('<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>Syncing...');
|
||||
|
||||
// Make AJAX request to sync performers
|
||||
$.post('/api/actors/sync-existing-stash', function(response) {
|
||||
if (response.success) {
|
||||
addLog('Stash performer sync completed successfully', 'success');
|
||||
addLog('Processed: ' + response.results.processed + ', Updated: ' + response.results.updated + ', Skipped: ' + response.results.skipped, 'info');
|
||||
|
||||
if (response.results.not_found_in_stash && response.results.not_found_in_stash.length > 0) {
|
||||
addLog('Found ' + response.results.not_found_in_stash.length + ' performers not in Stash - check reports', 'warning');
|
||||
}
|
||||
|
||||
if (response.results.errors && response.results.errors.length > 0) {
|
||||
addLog('Encountered ' + response.results.errors.length + ' errors during sync', 'error');
|
||||
}
|
||||
} else {
|
||||
addLog('Error syncing performers: ' + (response.error || 'Unknown error'), 'error');
|
||||
}
|
||||
|
||||
$('#syncStashPerformers').prop('disabled', false).html('<i class="bi bi-person-lines-fill me-2"></i> Sync Stash Performers');
|
||||
}).fail(function(xhr, status, error) {
|
||||
addLog('Failed to sync performers: ' + error, 'error');
|
||||
$('#syncStashPerformers').prop('disabled', false).html('<i class="bi bi-person-lines-fill me-2"></i> Sync Stash Performers');
|
||||
});
|
||||
}
|
||||
|
||||
// Function to cancel sync
|
||||
function cancelSync() {
|
||||
$.post('{{ path_for("admin.sync.cancel") }}', function(response) {
|
||||
|
||||
Reference in New Issue
Block a user