automatic plex scan triggers automatic soulsync db update
This commit is contained in:
parent
5151c53fac
commit
31a8b01cdb
6 changed files with 16 additions and 9 deletions
5
main.py
5
main.py
|
|
@ -192,6 +192,11 @@ class MainWindow(QMainWindow):
|
|||
self.dashboard_page.add_activity_item
|
||||
)
|
||||
|
||||
# --- ADD THESE TWO LINES TO FIX THE UI UPDATE ---
|
||||
self.sync_page.database_updated_externally.connect(self.dashboard_page.database_updated_externally)
|
||||
self.artists_page.database_updated_externally.connect(self.dashboard_page.database_updated_externally)
|
||||
# ------------------------------------------------
|
||||
|
||||
self.stacked_widget.addWidget(self.dashboard_page)
|
||||
self.stacked_widget.addWidget(self.sync_page)
|
||||
self.stacked_widget.addWidget(self.downloads_page)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -2950,6 +2950,7 @@ class DownloadMissingAlbumTracksModal(QDialog):
|
|||
self.update_failed_matches_button()
|
||||
|
||||
class ArtistsPage(QWidget):
|
||||
database_updated_externally = pyqtSignal()
|
||||
def __init__(self, downloads_page=None, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
|
|
@ -3069,10 +3070,9 @@ class ArtistsPage(QWidget):
|
|||
else:
|
||||
logger.info("💡 Automatic database update completed - no new content found")
|
||||
|
||||
# Refresh database statistics in the dashboard to update live display
|
||||
if hasattr(self, 'main_window') and hasattr(self.main_window, 'dashboard_page'):
|
||||
self.main_window.dashboard_page.refresh_database_statistics()
|
||||
logger.info("📊 Refreshed dashboard database statistics after auto update")
|
||||
# Emit the signal to notify the dashboard to refresh its statistics
|
||||
self.database_updated_externally.emit()
|
||||
logger.info("📊 Emitted signal to refresh dashboard database statistics after auto update")
|
||||
|
||||
# Clean up the worker
|
||||
if hasattr(self, '_auto_database_worker'):
|
||||
|
|
|
|||
|
|
@ -2294,6 +2294,7 @@ class ActivityItem(QWidget):
|
|||
layout.addWidget(time_label)
|
||||
|
||||
class DashboardPage(QWidget):
|
||||
database_updated_externally = pyqtSignal()
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
|
|
@ -2319,7 +2320,8 @@ class DashboardPage(QWidget):
|
|||
self.stats_cards = {}
|
||||
|
||||
self.setup_ui()
|
||||
|
||||
self.database_updated_externally.connect(self.refresh_database_statistics)
|
||||
|
||||
# Initialize list to track active stats workers
|
||||
self._active_stats_workers = []
|
||||
|
||||
|
|
|
|||
|
|
@ -1963,6 +1963,7 @@ class SyncOptionsPanel(QFrame):
|
|||
class SyncPage(QWidget):
|
||||
# Signals for dashboard activity tracking
|
||||
sync_activity = pyqtSignal(str, str, str, str) # icon, title, subtitle, time
|
||||
database_updated_externally = pyqtSignal()
|
||||
|
||||
def __init__(self, spotify_client=None, plex_client=None, soulseek_client=None, downloads_page=None, parent=None):
|
||||
super().__init__(parent)
|
||||
|
|
@ -2080,10 +2081,9 @@ class SyncPage(QWidget):
|
|||
else:
|
||||
logger.info("💡 Automatic database update completed - no new content found")
|
||||
|
||||
# Refresh database statistics in the dashboard to update live display
|
||||
if hasattr(self, 'main_window') and hasattr(self.main_window, 'dashboard_page'):
|
||||
self.main_window.dashboard_page.refresh_database_statistics()
|
||||
logger.info("📊 Refreshed dashboard database statistics after auto update")
|
||||
# Emit the signal to notify the dashboard to refresh its statistics
|
||||
self.database_updated_externally.emit()
|
||||
logger.info("📊 Emitted signal to refresh dashboard database statistics after auto update")
|
||||
|
||||
# Clean up the worker
|
||||
if hasattr(self, '_auto_database_worker'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue