added lidarr to seeker settings

This commit is contained in:
Flaminel committed 2026-10-26 20:34:44 +02:00
1 parent 3cc7b0bbe8
commit dc7dd67097
9 files changed
+31 -2

No files matched your search

@@ -68,4 +68,5 @@ export const NEW_FEATURES: NewFeature[] = [
{ id: 'seeker-quiet-hours' },
{ id: 'seeker-radarr-release-gate' },
{ id: 'seeker-whisparr' },
{ id: 'seeker-lidarr' },
];
@@ -162,6 +162,7 @@ describe('funnelStages', () => {
expect(funnelStages(funnel, 'Radarr').narrowing[0]).toEqual({ label: 'movies', value: 10 });
expect(funnelStages(funnel, 'Sonarr').narrowing[0]).toEqual({ label: 'series', value: 10 });
expect(funnelStages(funnel, 'Whisparr').narrowing[0]).toEqual({ label: 'movies', value: 10 });
expect(funnelStages(funnel, 'Lidarr').narrowing[0]).toEqual({ label: 'artists', value: 10 });
});
it('splits the units needing a search by state', () => {
@@ -79,6 +79,17 @@ export interface FunnelStage {
value: number;
}
function libraryLabel(instanceType: string): string {
switch (instanceType) {
case 'Sonarr':
return 'series';
case 'Lidarr':
return 'artists';
default:
return 'movies';
}
}
/**
* Splits the funnel into the stages that narrow the library down to units needing a search,
* and the split of those units by state.
@@ -87,7 +98,7 @@ export function funnelStages(funnel: InstanceFunnel, instanceType: string): { na
const resting: FunnelStage[] = funnel.restingUnits > 0 ? [{ label: 'resting', value: funnel.restingUnits }] : [];
return {
narrowing: [
{ label: instanceType === 'Sonarr' ? 'series' : 'movies', value: funnel.libraryItems },
{ label: libraryLabel(instanceType), value: funnel.libraryItems },
{ label: 'released', value: funnel.releasedItems },
{ label: 'monitored', value: funnel.monitoredItems },
{ label: 'tag filtered', value: funnel.tagFilteredItems },
@@ -54,7 +54,7 @@
<div class="instance-card__progress">
<div class="instance-card__progress-row">
<app-tooltip text="Items searched in the current cycle out of total eligible. For Sonarr, each season counts as one item.">
<app-tooltip text="Items searched in the current cycle out of total eligible. For Sonarr, each season counts as one item. For Lidarr, each album counts as one item.">
<span class="instance-card__progress-label">Cycle Progress</span>
</app-tooltip>
<span class="instance-card__progress-count">
@@ -234,6 +234,7 @@ describe('UpgradesTabComponent', () => {
expect(component.itemTypeSeverity('Sonarr')).toBe('info');
expect(component.itemTypeSeverity('Radarr')).toBe('info');
expect(component.itemTypeSeverity('Whisparr')).toBe('info');
expect(component.itemTypeSeverity('Lidarr')).toBe('info');
});
it('toasts the error message when loading upgrades fails', () => {
@@ -96,6 +96,9 @@
@if (instance.instanceType === 'Whisparr') {
<app-new-badge variant="inline" featureId="seeker-whisparr" />
}
@if (instance.instanceType === 'Lidarr') {
<app-new-badge variant="inline" featureId="seeker-lidarr" />
}
</div>
<app-toggle [checked]="instance.enabled" [disabled]="!instance.arrInstanceEnabled" (checkedChange)="toggleInstance($index)" helpKey="seeker:enabled" />
</div>
@@ -545,6 +545,16 @@ describe('SeekerComponent', () => {
expect(fixture.nativeElement.textContent).not.toContain('Search Mode');
});
it('marks a Lidarr row as new and shows no release gate or search mode', () => {
const lidarr: SeekerInstanceConfig = { ...RADARR, instanceName: 'Lidarr', instanceType: 'Lidarr', enabled: true };
const { fixture } = setup({ config: { ...CONFIG, instances: [lidarr] } });
const badge = fixture.nativeElement.querySelector('.instance-row__info app-new-badge') as HTMLElement;
expect(badge.getAttribute('featureId')).toBe('seeker-lidarr');
expect(releaseGateSelect(fixture, 0)).toBeUndefined();
expect(fixture.nativeElement.textContent).not.toContain('Search Mode');
});
it('sends the picked release gate for the Radarr row only', () => {
const { fixture, updateConfig } = setup();
@@ -21,6 +21,7 @@ describe('instanceTypeHighlight', () => {
[InstanceType.Radarr, 'info'],
[InstanceType.Sonarr, 'info'],
[InstanceType.Whisparr, 'info'],
[InstanceType.Lidarr, 'info'],
])('maps %s to %s', (type, expected) => {
expect(instanceTypeHighlight(type)).toBe(expected);
});
@@ -18,6 +18,7 @@ export function instanceTypeHighlight(type: string): BadgeSeverity {
case InstanceType.Radarr:
case InstanceType.Sonarr:
case InstanceType.Whisparr:
case InstanceType.Lidarr:
return 'info';
default:
return 'default';