Add updateExisting option to importers & UI

Introduce an updateExisting flag across importers and the Importer UI to control whether existing items should be updated or only new items imported. Changes: added updateExisting to XBVR, StashAPP, Playnite, and Jellyfin config types; added checkboxes in ImporterView (enabled by default) to toggle the behavior; import logic now skips existing items when updateExisting is false and logs/skips appropriately (XBVR, StashAPP, Playnite, Jellyfin). Also: minor Playnite env parsing tweak for port (undefined when not provided) and small logging/cleanup in the Jellyfin album handling.
This commit is contained in:
Lars Behrends
2026-04-12 02:57:34 +02:00
parent 9c7e5a2b19
commit 6250164656
5 changed files with 101 additions and 25 deletions

View File

@@ -7,6 +7,7 @@ export interface PlayniteConfig {
ip: string;
apiToken: string;
port?: number;
updateExisting?: boolean;
}
export interface ImportProgress {
@@ -194,6 +195,15 @@ export async function importFromPlaynite(
const existingGame = existingMedia.get(game.name);
const isUpdate = existingGame !== undefined;
// Skip if updateExisting is false and item already exists
if (!config.updateExisting && isUpdate) {
logCallback(`⊘ Skipped game: ${game.name} (already exists, updateExisting is false)`);
progressCallback({
current: i + 1
});
continue;
}
try {
// Parse release date
let year = new Date().getFullYear();