feat: plex watchlist sync integration (#2885)

This commit is contained in:
Ryan Cohen
2022-08-21 16:33:49 +09:00
committed by GitHub
parent 7943e0c339
commit 301f2bf7ab
35 changed files with 1325 additions and 320 deletions

View File

@@ -5,6 +5,7 @@ import { radarrScanner } from '../lib/scanners/radarr';
import { sonarrScanner } from '../lib/scanners/sonarr';
import type { JobId } from '../lib/settings';
import { getSettings } from '../lib/settings';
import watchlistSync from '../lib/watchlistsync';
import logger from '../logger';
interface ScheduledJob {
@@ -54,6 +55,20 @@ export const startJobs = (): void => {
cancelFn: () => plexFullScanner.cancel(),
});
// Run watchlist sync every 5 minutes
scheduledJobs.push({
id: 'plex-watchlist-sync',
name: 'Plex Watchlist Sync',
type: 'process',
interval: 'long',
job: schedule.scheduleJob(jobs['plex-watchlist-sync'].schedule, () => {
logger.info('Starting scheduled job: Plex Watchlist Sync', {
label: 'Jobs',
});
watchlistSync.syncWatchlist();
}),
});
// Run full radarr scan every 24 hours
scheduledJobs.push({
id: 'radarr-scan',