BackOffice + MusicMaster

BackOffice integration for music library sync and program log updates

Technical note summarizing the two BackOffice integration tracks now in place: direct music library synchronization with the MusicMaster Nexus Server and automatic program log refresh driven by schedule updates already processed by the MusicMaster integrator.

Branch: feature/backoffice-bugfix
Commits: 200980a and b8b7b4b
Status: implemented and validated in code

Overview

Both features reuse the existing MusicMaster integration stack instead of rebuilding transport and synchronization logic inside BackOffice. That keeps BackOffice focused on operator workflow, orchestration, and user feedback.

Feature Commit Approach
Music library: sync with Nexus Server 200980a Direct Nexus connection through SincronizacaoService
Program log: auto-sync b8b7b4b Lightweight polling against the local database via NOVOVerificarAtualizacoes

Feature 1: Music library sync directly from Nexus Server

BackOffice now allows operators and administrators to configure the Nexus connection, validate required mappings, and run music library synchronization with real-time progress feedback, while preserving the existing workflow when the integration is not enabled.

BackOffice (Music Library)
  | "Sync Nexus" action
  v
NexusSyncService
  | SincronizacaoService.SincronizarApenasCatalogo()
  | LogService.MensagemLogada -> UI
  v
NexusCommunicator
  | HTTP/XML
  v
MusicMaster Nexus Server

Files added

  • Informa.BackOffice/ViewModels/Catalog/NexusSyncService.cs
  • Informa.BackOffice/Views/Catalog/NexusConfigDialog.xaml
  • Informa.BackOffice/Views/Catalog/NexusConfigDialog.xaml.cs

Files updated

  • CatalogViewModel.cs: commands, summary handling, and mapping pre-check
  • CatalogView.xaml: configuration controls, sync controls, and live log panel
  • Informa.BackOffice.csproj: project references and file registration

Data authority rules

Mapping rule Fields
MusicMasterSempreSobrescreve Description, Artist, Composer, Album, Label, Theme, Release Date, Library Name, Album Art
InfoAudioSempreSobrescreve Id, File Type, Event Code, Audio File Name, Library Path
ManterMaisRecente Total Duration, cue and segue points, validity window, and notes
The integration is optional. Without Nexus configuration, the music library workflow continues normally. When enabled, MusicMaster becomes the primary metadata authority for synchronized songs.

Feature 2: Program log auto-sync through local database polling

The daypart or daily program log shown in BackOffice detects schedule updates coming from the MusicMaster integrator within 15 seconds and refreshes automatically whenever there are no pending local edits.

MusicMaster Server
  | HTTP POST
  v
IntegradorMMService
  | PublishSchedule()
  | ImportarProgramacao()
  | SalvarBlocos()
  v
Local database
  ^
  | Poll every 15s
  |
ScheduleSyncMonitorService
  | NOVOVerificarAtualizacoes(observedDate, lastCheckTimestamp)
  v
ScheduleViewModel.OnScheduleChanged()

Change detection

  • Uses NOVOVerificarAtualizacoes against the local scheduling tables
  • Detects new blocks, removed blocks, and updated blocks
  • Avoids direct polling against Nexus on every cycle

Edit protection

  • With HasUnsavedChanges == false: automatic refresh
  • With local edits in progress: warning banner plus explicit operator action
  • Dismiss uses an acknowledged fingerprint so the same alert is not repeated

Correct baseline

  • After LoadBlocks() and Save(), the baseline is taken from the database
  • Uses max(DataUltimaAlteracao)
  • Prevents false positives caused by the operator's own local save

End-to-end workflow

  • MusicMaster publishes a schedule change and the integrator writes it into the local database.
  • The monitor detects the change from the block update timestamp.
  • With no local edits in progress, BackOffice refreshes the program log automatically.
  • With local edits pending, the UI shows a conflict banner with Update Now and Dismiss.
  • The Refresh button allows a manual reload at any time.

Failure handling

Scenario Behavior
Polling failure Silent retry on the next polling cycle
Local save fails HasUnsavedChanges stays active and the baseline is not reset
Operator changes the date The monitor resets its baseline and observed block set
No MusicMaster configuration Polling still works because it depends only on the local database

Reused dependencies

Both features build on existing components from the InfoAudio and MusicMaster integration stack.

Dependency Primary use
Informa.MusicMaster.Plugin.Business SincronizacaoService, ConfiguracoesService, LogService
Informa.MusicMaster.Plugin.Model Configuration models, stations, sync results, and mapping enums
Informa.Business BlocoBusiness, CatalogoBusiness, ProgramacaoBusiness
Informa.Model BlocoModel, AtualizacaoBlocosModel, EventoModel

File summary

Music library

  • NexusSyncService.cs
  • NexusConfigDialog.xaml
  • NexusConfigDialog.xaml.cs
  • CatalogViewModel.cs
  • CatalogView.xaml

Program log

  • ScheduleSyncMonitorService.cs
  • ScheduleViewModel.cs
  • ScheduleView.xaml
  • Informa.BackOffice.csproj