From dd5f2f07e981bb572b275ffb8213c9fc653f2a3f Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:43:24 -0800 Subject: [PATCH] detail modal for each action and trgiger --- core/database_update_worker.py | 4 + webui/static/script.js | 574 +++++++++++++++++++++++++++++++++ webui/static/style.css | 13 + 3 files changed, 591 insertions(+) diff --git a/core/database_update_worker.py b/core/database_update_worker.py index 9fbe0341..dcee4cca 100644 --- a/core/database_update_worker.py +++ b/core/database_update_worker.py @@ -874,7 +874,9 @@ class DatabaseUpdateWorker(QThread): # Fetch current IDs from media server (lightweight calls) logger.info(f"πŸ” Removal detection: fetching current IDs from {self.server_type}...") + self._emit_signal('phase_changed', f"Fetching artist catalog from {self.server_type}...") server_artist_ids = self.media_client.get_all_artist_ids() + self._emit_signal('phase_changed', f"Fetching album catalog from {self.server_type}...") server_album_ids = self.media_client.get_all_album_ids() # Safety: if both come back empty, the server is unreachable @@ -918,6 +920,7 @@ class DatabaseUpdateWorker(QThread): return None # Get stored IDs from database + self._emit_signal('phase_changed', f"Comparing local database with {self.server_type}...") db_artist_ids = self.database.get_all_artist_ids_for_server(self.server_type) if check_artists else set() db_album_ids = self.database.get_all_album_ids_for_server(self.server_type) if check_albums else set() @@ -947,6 +950,7 @@ class DatabaseUpdateWorker(QThread): if not removed_artist_ids and not removed_album_ids: logger.info("πŸ” Removal detection: no stale content found") + self._emit_signal('phase_changed', "No removed content detected") return {'artists_removed': 0, 'albums_removed': 0, 'tracks_removed': 0} logger.info(f"πŸ—‘οΈ Removal detection: found {len(removed_artist_ids)} removed artists, " diff --git a/webui/static/script.js b/webui/static/script.js index 0c9a69e7..14c9b25b 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -15616,6 +15616,577 @@ const TOOL_HELP_CONTENT = {
  • Add more artists to your watchlist to expand your discovery pool with their MusicMap similar artists
  • ` + }, + + // ==================== Automation Trigger Help ==================== + + 'auto-schedule': { + title: 'Schedule Timer', + content: ` +

    What is this trigger?

    +

    Runs your automation on a repeating interval β€” every X minutes, hours, or days.

    + +

    Configuration

    + + +

    When does it first run?

    +

    The timer starts when SoulSync boots. If the automation was previously scheduled, it resumes from where it left off.

    + +

    Good for

    + + ` + }, + 'auto-daily_time': { + title: 'Daily Time', + content: ` +

    What is this trigger?

    +

    Runs your automation once per day at a specific time.

    + +

    Configuration

    + + +

    Good for

    + + ` + }, + 'auto-weekly_time': { + title: 'Weekly Schedule', + content: ` +

    What is this trigger?

    +

    Runs your automation on specific days of the week at a set time.

    + +

    Configuration

    + + +

    Good for

    + + ` + }, + 'auto-app_started': { + title: 'App Started', + content: ` +

    What is this trigger?

    +

    Fires once when SoulSync starts up. Useful for tasks you want to run on every boot.

    + +

    Good for

    + + +

    Note

    +

    This trigger fires only once per startup β€” it will not fire again until SoulSync is restarted.

    + ` + }, + 'auto-track_downloaded': { + title: 'Track Downloaded', + content: ` +

    What is this trigger?

    +

    Fires every time a single track finishes downloading and post-processing (tagging, moving to library).

    + +

    Conditions

    +

    You can filter which downloads trigger this automation:

    + + +

    Available variables for notifications

    +

    {artist}, {title}, {album}, {quality}

    + +

    Note

    +

    This fires per-track, not per-album. For an album with 12 tracks, it fires 12 times. Use Batch Complete if you want one event per album.

    + ` + }, + 'auto-batch_complete': { + title: 'Batch Complete', + content: ` +

    What is this trigger?

    +

    Fires when an entire album or playlist download batch finishes β€” all tracks in the batch are done (whether successful or failed).

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {playlist_name}, {total_tracks}, {completed_tracks}, {failed_tracks}

    + +

    Good for

    + + ` + }, + 'auto-watchlist_new_release': { + title: 'New Release Found', + content: ` +

    What is this trigger?

    +

    Fires when the watchlist scanner detects new music from an artist you're watching. This means a new album, EP, or single has been released that you don't already have.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {artist}, {new_tracks}, {added_to_wishlist}

    + +

    Good for

    + + ` + }, + 'auto-playlist_synced': { + title: 'Playlist Synced', + content: ` +

    What is this trigger?

    +

    Fires after a mirrored playlist is synced to your media server (Plex, Jellyfin, or Navidrome). This means the playlist has been matched and created/updated on your server.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {playlist_name}, {total_tracks}, {matched_tracks}, {synced_tracks}, {failed_tracks}

    + ` + }, + 'auto-playlist_changed': { + title: 'Playlist Changed', + content: ` +

    What is this trigger?

    +

    Fires when a mirrored playlist detects that the source playlist (on Spotify, Tidal, YouTube, etc.) has changed β€” tracks were added or removed.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {playlist_name}, {old_count}, {new_count}, {added}, {removed}

    + +

    Good for

    + + ` + }, + 'auto-discovery_completed': { + title: 'Discovery Complete', + content: ` +

    What is this trigger?

    +

    Fires when Spotify/iTunes metadata discovery finishes for a mirrored playlist. Discovery is the process of matching playlist tracks to official Spotify or iTunes metadata.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {playlist_name}, {total_tracks}, {discovered_count}, {failed_count}, {skipped_count}

    + +

    Good for

    + + ` + }, + 'auto-wishlist_processing_completed': { + title: 'Wishlist Processed', + content: ` +

    What is this trigger?

    +

    Fires when the auto-wishlist processing batch finishes. This is the automated download cycle that searches Soulseek for wishlist tracks.

    + +

    Available variables for notifications

    +

    {tracks_processed}, {tracks_found}, {tracks_failed}

    + ` + }, + 'auto-watchlist_scan_completed': { + title: 'Watchlist Scan Done', + content: ` +

    What is this trigger?

    +

    Fires when the watchlist artist scan completes. The scan checks all watched artists for new releases and adds new tracks to your wishlist.

    + +

    Available variables for notifications

    +

    {artists_scanned}, {new_tracks_found}, {tracks_added}

    + ` + }, + 'auto-database_update_completed': { + title: 'Database Updated', + content: ` +

    What is this trigger?

    +

    Fires when the library database refresh finishes β€” either incremental or full. This means SoulSync's internal database has been synced with your media server.

    + +

    Available variables for notifications

    +

    {total_artists}, {total_albums}, {total_tracks}

    + +

    Good for

    + + ` + }, + 'auto-download_failed': { + title: 'Download Failed', + content: ` +

    What is this trigger?

    +

    Fires when a track permanently fails to download. This means all retry attempts and sources have been exhausted.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {artist}, {title}, {reason}

    + ` + }, + 'auto-download_quarantined': { + title: 'File Quarantined', + content: ` +

    What is this trigger?

    +

    Fires when a downloaded file fails AcoustID verification and is moved to the quarantine folder. This means the audio fingerprint didn't match what was expected β€” the file might be the wrong song.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {artist}, {title}, {reason}

    + +

    What is quarantine?

    +

    Files that fail audio fingerprint verification are moved to a quarantine folder instead of your library. This prevents wrong songs from polluting your collection. You can review quarantined files manually.

    + ` + }, + 'auto-wishlist_item_added': { + title: 'Wishlist Item Added', + content: ` +

    What is this trigger?

    +

    Fires when a track is added to your wishlist β€” whether manually, by the quality scanner, or by the watchlist scan.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {artist}, {title}, {reason}

    + ` + }, + 'auto-watchlist_artist_added': { + title: 'Artist Watched', + content: ` +

    What is this trigger?

    +

    Fires when an artist is added to your watchlist. Watched artists are periodically scanned for new releases.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {artist}, {artist_id}

    + ` + }, + 'auto-watchlist_artist_removed': { + title: 'Artist Unwatched', + content: ` +

    What is this trigger?

    +

    Fires when an artist is removed from your watchlist.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {artist}, {artist_id}

    + ` + }, + 'auto-import_completed': { + title: 'Import Complete', + content: ` +

    What is this trigger?

    +

    Fires when an album or track import operation finishes. Imports bring music from external sources into your library.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {track_count}, {album_name}, {artist}

    + ` + }, + 'auto-mirrored_playlist_created': { + title: 'Playlist Mirrored', + content: ` +

    What is this trigger?

    +

    Fires when a new playlist mirror is created β€” a playlist from Spotify, Tidal, YouTube, ListenBrainz, or Beatport is set up for mirroring.

    + +

    Conditions

    + + +

    Available variables for notifications

    +

    {playlist_name}, {source}, {track_count}

    + +

    Good for

    + + ` + }, + 'auto-quality_scan_completed': { + title: 'Quality Scan Done', + content: ` +

    What is this trigger?

    +

    Fires when the quality scanner finishes. The scanner identifies tracks below your quality preferences and adds them to your wishlist for re-downloading.

    + +

    Available variables for notifications

    +

    {quality_met}, {low_quality}, {total_scanned}

    + ` + }, + 'auto-duplicate_scan_completed': { + title: 'Duplicate Scan Done', + content: ` +

    What is this trigger?

    +

    Fires when the duplicate cleaner finishes scanning your transfer folder for duplicate audio files.

    + +

    Available variables for notifications

    +

    {files_scanned}, {duplicates_found}, {space_freed}

    + ` + }, + + // ==================== Automation Action Help ==================== + + 'auto-process_wishlist': { + title: 'Process Wishlist', + content: ` +

    What does this action do?

    +

    Searches Soulseek for tracks in your wishlist and downloads them. This is the same process that runs automatically on a timer β€” this action lets you trigger it manually or chain it to events.

    + +

    Configuration

    + + +

    How it works

    +
      +
    1. Picks tracks from the wishlist (alternating Albums and Singles cycles)
    2. +
    3. Searches Soulseek for each track
    4. +
    5. Downloads the best quality match found
    6. +
    7. Tags and moves files to your library
    8. +
    + ` + }, + 'auto-scan_watchlist': { + title: 'Scan Watchlist', + content: ` +

    What does this action do?

    +

    Checks all watched artists for new releases you don't already have. New tracks are automatically added to your wishlist for downloading.

    + +

    How it works

    +
      +
    1. Goes through each artist in your watchlist
    2. +
    3. Fetches their discography from Spotify
    4. +
    5. Compares against your library to find missing releases
    6. +
    7. Adds new tracks to your wishlist
    8. +
    + ` + }, + 'auto-scan_library': { + title: 'Scan Library', + content: ` +

    What does this action do?

    +

    Triggers your media server (Plex) to scan its music library folder for new or changed files. This makes newly downloaded music appear in your media server.

    + +

    Note

    +

    Jellyfin and Navidrome detect new files automatically in real-time, so this action is primarily useful for Plex.

    + ` + }, + 'auto-refresh_mirrored': { + title: 'Refresh Mirrored Playlist', + content: ` +

    What does this action do?

    +

    Re-fetches a mirrored playlist from its source platform (Spotify, Tidal, YouTube, etc.) and updates the local mirror with any track changes.

    + +

    Configuration

    + + +

    Good for

    + + ` + }, + 'auto-sync_playlist': { + title: 'Sync Playlist', + content: ` +

    What does this action do?

    +

    Syncs a mirrored playlist to your media server. It matches discovered tracks against your library and creates or updates the playlist on Plex, Jellyfin, or Navidrome.

    + +

    Configuration

    + + +

    Prerequisites

    +

    Tracks should be discovered first (matched to Spotify/iTunes metadata) before syncing. Undiscovered tracks will be skipped.

    + ` + }, + 'auto-discover_playlist': { + title: 'Discover Playlist', + content: ` +

    What does this action do?

    +

    Finds official Spotify or iTunes metadata for tracks in a mirrored playlist. This is required before syncing β€” it matches each track to a known release so it can be found in your library.

    + +

    Configuration

    + + +

    How it works

    +
      +
    1. Takes each track name and artist from the mirror
    2. +
    3. Searches Spotify (or iTunes as fallback) for a match
    4. +
    5. Stores the best match with confidence score in the discovery cache
    6. +
    7. Already-discovered tracks are skipped for efficiency
    8. +
    + ` + }, + 'auto-notify_only': { + title: 'Notify Only', + content: ` +

    What does this action do?

    +

    Nothing β€” it performs no action. It just passes the event data through to the notification step.

    + +

    Good for

    + + ` + }, + 'auto-start_database_update': { + title: 'Update Database', + content: ` +

    What does this action do?

    +

    Refreshes SoulSync's internal library database by syncing with your media server (Plex, Jellyfin, or Navidrome).

    + +

    Configuration

    + + ` + }, + 'auto-run_duplicate_cleaner': { + title: 'Run Duplicate Cleaner', + content: ` +

    What does this action do?

    +

    Scans your transfer folder for duplicate audio files (same filename, different format) and removes the lower-quality version. For example, if you have both Song.flac and Song.mp3, the MP3 is removed.

    + +

    Safety

    +

    Removed files are moved to a deleted/ subfolder, not permanently deleted. You can recover them if needed.

    + ` + }, + 'auto-clear_quarantine': { + title: 'Clear Quarantine', + content: ` +

    What does this action do?

    +

    Permanently deletes all files in the quarantine folder. Quarantined files are downloads that failed AcoustID audio fingerprint verification β€” they might be the wrong song.

    + +

    Warning

    +

    This permanently deletes files. Make sure you've reviewed quarantined files before setting up an automation for this.

    + ` + }, + 'auto-cleanup_wishlist': { + title: 'Clean Up Wishlist', + content: ` +

    What does this action do?

    +

    Removes duplicate entries and tracks you already own from your wishlist. Keeps the wishlist lean by removing items that no longer need downloading.

    + ` + }, + 'auto-update_discovery_pool': { + title: 'Update Discovery Pool', + content: ` +

    What does this action do?

    +

    Refreshes the discovery pool with new tracks from your mirrored playlists. The discovery pool tracks which playlist tracks have been successfully matched and which ones failed.

    + ` + }, + 'auto-start_quality_scan': { + title: 'Run Quality Scan', + content: ` +

    What does this action do?

    +

    Scans your library for tracks that don't meet your quality preferences (e.g., MP3 when you prefer FLAC). Low-quality tracks are matched to Spotify and added to your wishlist for re-downloading in better quality.

    + +

    Configuration

    + + ` + }, + 'auto-backup_database': { + title: 'Backup Database', + content: ` +

    What does this action do?

    +

    Creates a timestamped backup of SoulSync's SQLite database. Uses the SQLite backup API for a safe hot-copy while the app is running.

    + +

    Retention

    +

    Keeps the last 3 backups automatically. Older backups are cleaned up to save disk space.

    + +

    Good for

    + + ` } }; @@ -42997,6 +43568,8 @@ function _renderBuilderSidebar() { (_autoBlocks[sec.key] || []).forEach(block => { const icon = _autoIcons[block.type] || '\u2699\uFE0F'; const disabled = !block.available; + const helpKey = 'auto-' + block.type; + const hasHelp = !!TOOL_HELP_CONTENT[helpKey]; html += `
    ${icon}
    @@ -43004,6 +43577,7 @@ function _renderBuilderSidebar() {
    ${_esc(block.description)}
    ${disabled ? 'Soon' : ''} + ${hasHelp ? `` : ''}
    `; }); html += ''; diff --git a/webui/static/style.css b/webui/static/style.css index 1980ea1a..f34ed2eb 100644 --- a/webui/static/style.css +++ b/webui/static/style.css @@ -29058,6 +29058,19 @@ body { padding: 2px 6px; border-radius: 6px; white-space: nowrap; } +.block-help-btn { + width: 20px; + height: 20px; + font-size: 11px; + flex-shrink: 0; + opacity: 0; + transition: opacity 0.2s ease; +} + +.block-item:hover .block-help-btn { + opacity: 1; +} + /* --- Builder Canvas --- */ .builder-canvas { flex: 1; overflow-y: auto; display: flex; flex-direction: column;