fix: unmonitored items incorrectly set to status=monitored; autofocus channel URL input
All checks were successful
CI / test (push) Successful in 19s

- scheduler.ts and back-catalog-import.ts now set status='ignored' when
  monitored=false (channel monitoring mode excludes the item)
- Migration 0019 fixes existing data: UPDATE status='ignored' WHERE monitored=0
- Modal.tsx focuses first [autofocus] element instead of the container div
This commit is contained in:
jlightner 2026-04-04 16:36:26 +00:00
parent 76e7611d8d
commit 3e21acfe2b
6 changed files with 1171 additions and 4 deletions

View file

@ -0,0 +1,6 @@
-- Fix content items where monitored=false but status is still 'monitored'
-- These were incorrectly set to status='monitored' during scan/import
-- when the channel's monitoring mode didn't include them.
UPDATE content_items
SET status = 'ignored', updated_at = datetime('now')
WHERE monitored = 0 AND status = 'monitored';

File diff suppressed because it is too large Load diff

View file

@ -134,6 +134,13 @@
"when": 1775520100000, "when": 1775520100000,
"tag": "0018_platform_settings_nfo_view", "tag": "0018_platform_settings_nfo_view",
"breakpoints": true "breakpoints": true
},
{
"idx": 19,
"version": "6",
"when": 1775520200000,
"tag": "0019_fix_unmonitored_status",
"breakpoints": true
} }
] ]
} }

View file

@ -28,9 +28,16 @@ export function Modal({ title, open, onClose, children, width = 480 }: ModalProp
useEffect(() => { useEffect(() => {
if (open) { if (open) {
previousFocus.current = document.activeElement as HTMLElement | null; previousFocus.current = document.activeElement as HTMLElement | null;
// Focus the modal container after render // Focus first input/textarea inside the modal, or fall back to the modal container
requestAnimationFrame(() => { requestAnimationFrame(() => {
const firstInput = modalRef.current?.querySelector<HTMLElement>(
'input:not([type="hidden"]):not([disabled]), textarea:not([disabled])'
);
if (firstInput) {
firstInput.focus();
} else {
modalRef.current?.focus(); modalRef.current?.focus();
}
}); });
} else if (previousFocus.current) { } else if (previousFocus.current) {
previousFocus.current.focus(); previousFocus.current.focus();

View file

@ -110,7 +110,7 @@ export class BackCatalogImportService {
duration: item.duration, duration: item.duration,
thumbnailUrl: item.thumbnailUrl, thumbnailUrl: item.thumbnailUrl,
publishedAt: item.publishedAt ?? null, publishedAt: item.publishedAt ?? null,
status: 'monitored', status: monitored ? 'monitored' : 'ignored',
monitored, monitored,
}); });

View file

@ -281,7 +281,7 @@ export class SchedulerService {
duration: item.duration, duration: item.duration,
thumbnailUrl: item.thumbnailUrl, thumbnailUrl: item.thumbnailUrl,
publishedAt: item.publishedAt ?? null, publishedAt: item.publishedAt ?? null,
status: 'monitored', status: monitored ? 'monitored' : 'ignored',
monitored, monitored,
}); });
if (created) { if (created) {