diff --git a/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.spec.ts b/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.spec.ts index 50a613c1e..1a53c3e28 100644 --- a/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.spec.ts +++ b/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.spec.ts @@ -369,6 +369,15 @@ describe('PlaylistRefreshActionService', () => { service.refresh(playlist); expect(service.isSourceBusy('busy')).toBe(true); expect(service.isSourceBusy('other')).toBe(false); + // One refresh at a time: no other source is offered meanwhile. + const other = createPlaylistMeta({ + _id: 'other', + serverUrl: undefined, + username: undefined, + password: undefined, + url: 'https://source.test/other', + }); + expect(service.canRefresh(other)).toBe(false); // The Sources page and the removal guard see it too. expect(activity.isBusy('busy')).toBe(true); resolve({ _id: 'busy', playlist: { items: [] } } as Playlist); @@ -376,6 +385,7 @@ describe('PlaylistRefreshActionService', () => { await Promise.resolve(); expect(service.isSourceBusy('busy')).toBe(false); expect(activity.isBusy('busy')).toBe(false); + expect(service.canRefresh(other)).toBe(true); }); it('passes trusted TLS hosts to URL-backed M3U refreshes', async () => { diff --git a/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.ts b/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.ts index afbe89387..3e47735fa 100644 --- a/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.ts +++ b/libs/playlist/shared/ui/src/lib/playlist-refresh-action.service.ts @@ -64,7 +64,13 @@ export class PlaylistRefreshActionService { readonly refreshPreparation = this.refreshPreparationState.asReadonly(); canRefresh(playlist: PlaylistMeta | null): boolean { - if (!playlist || this.activity.isBusy(playlist._id)) { + // The same guards as refresh(): one refresh runs at a time, so an + // offer made meanwhile would be a silent no-op. + if ( + !playlist || + this.isRefreshing() || + this.activity.isBusy(playlist._id) + ) { return false; } diff --git a/libs/playlist/shared/ui/src/lib/source-row/source-row.component.html b/libs/playlist/shared/ui/src/lib/source-row/source-row.component.html index 949fd88a9..9a64a43fa 100644 --- a/libs/playlist/shared/ui/src/lib/source-row/source-row.component.html +++ b/libs/playlist/shared/ui/src/lib/source-row/source-row.component.html @@ -13,7 +13,12 @@ (keydown)="onRowKeydown($event)" > @if (draggable()) { -