fix: unmonitored items incorrectly set to status=monitored; autofocus channel URL input
All checks were successful
CI / test (push) Successful in 19s
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:
parent
76e7611d8d
commit
3e21acfe2b
6 changed files with 1171 additions and 4 deletions
6
drizzle/0019_fix_unmonitored_status.sql
Normal file
6
drizzle/0019_fix_unmonitored_status.sql
Normal 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';
|
||||
1147
drizzle/meta/0019_snapshot.json
Normal file
1147
drizzle/meta/0019_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -134,6 +134,13 @@
|
|||
"when": 1775520100000,
|
||||
"tag": "0018_platform_settings_nfo_view",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 19,
|
||||
"version": "6",
|
||||
"when": 1775520200000,
|
||||
"tag": "0019_fix_unmonitored_status",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -28,9 +28,16 @@ export function Modal({ title, open, onClose, children, width = 480 }: ModalProp
|
|||
useEffect(() => {
|
||||
if (open) {
|
||||
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(() => {
|
||||
modalRef.current?.focus();
|
||||
const firstInput = modalRef.current?.querySelector<HTMLElement>(
|
||||
'input:not([type="hidden"]):not([disabled]), textarea:not([disabled])'
|
||||
);
|
||||
if (firstInput) {
|
||||
firstInput.focus();
|
||||
} else {
|
||||
modalRef.current?.focus();
|
||||
}
|
||||
});
|
||||
} else if (previousFocus.current) {
|
||||
previousFocus.current.focus();
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ export class BackCatalogImportService {
|
|||
duration: item.duration,
|
||||
thumbnailUrl: item.thumbnailUrl,
|
||||
publishedAt: item.publishedAt ?? null,
|
||||
status: 'monitored',
|
||||
status: monitored ? 'monitored' : 'ignored',
|
||||
monitored,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ export class SchedulerService {
|
|||
duration: item.duration,
|
||||
thumbnailUrl: item.thumbnailUrl,
|
||||
publishedAt: item.publishedAt ?? null,
|
||||
status: 'monitored',
|
||||
status: monitored ? 'monitored' : 'ignored',
|
||||
monitored,
|
||||
});
|
||||
if (created) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue