feat(web): every Collection queue can remove the file and keep the track
release / web (push) Failing after 1m28s
release / go (push) Successful in 1m53s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m16s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m13s
release / android (push) Canceled after 2m59s
release / web (push) Failing after 1m28s
release / go (push) Successful in 1m53s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m16s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m13s
release / android (push) Canceled after 2m59s
Reports offers "Remove the file" ahead of "Remove from library": the bad file goes and the track waits in Needs a file, with its likes and plays, for a good copy. Suspect sources gets "Remove this file", and the Duplicates wrong-slot action and its route are named for what they do (remove-files). Their toasts and copy name Needs a file. Missing files becomes Needs a file in the rail, the Collection header and the Overview counts. Each track says why it waits and who removed it, and can be forgotten one at a time or by folder; the list exports as a CSV or copies to the clipboard. The empty state says how a track gets there and how it leaves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,11 +5,12 @@ import type { AdminSuspectResponse, AdminSuspectTrack } from '#lib/api/types.js'
|
||||
|
||||
vi.mock('#lib/api/admin.js', () => ({
|
||||
createSuspectSourcesQuery: vi.fn(),
|
||||
setSuspectVerdict: vi.fn(async () => {})
|
||||
setSuspectVerdict: vi.fn(async () => {}),
|
||||
removeSuspectFile: vi.fn(async () => {})
|
||||
}));
|
||||
|
||||
import SuspectSourcesPage from './+page.svelte';
|
||||
import { createSuspectSourcesQuery, setSuspectVerdict } from '#lib/api/admin.js';
|
||||
import { createSuspectSourcesQuery, removeSuspectFile, setSuspectVerdict } from '#lib/api/admin.js';
|
||||
|
||||
const mocked = createSuspectSourcesQuery as ReturnType<typeof vi.fn>;
|
||||
|
||||
@@ -136,4 +137,25 @@ describe('Suspect sources page', () => {
|
||||
expect(await screen.findByText('Marked fine')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: 'Hold back again' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
// A rip that is not fine has its file removed, on a second click; the track
|
||||
// waits for a clean copy.
|
||||
test('Remove this file asks once more, then removes the rip', async () => {
|
||||
mocked.mockReturnValue(
|
||||
infinite([
|
||||
page(0, 1, [
|
||||
{
|
||||
directory: HUMANZ,
|
||||
tracks: [track('Strobelite', 'Gorillaz - Strobelite (Official Video).mp3', ['music video'])]
|
||||
}
|
||||
])
|
||||
])
|
||||
);
|
||||
render(SuspectSourcesPage);
|
||||
|
||||
await fireEvent.click(screen.getByRole('button', { name: 'Remove the file of Strobelite' }));
|
||||
expect(removeSuspectFile).not.toHaveBeenCalled();
|
||||
await fireEvent.click(screen.getByRole('button', { name: 'Confirm remove the file of Strobelite' }));
|
||||
expect(removeSuspectFile).toHaveBeenCalledWith('t-Strobelite');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user