Add source field, UI filter, and import mapping

Introduce a 'source' property across types and API models, include it in convertApiToMedia, and add a Source input to AddMediaView. Add source-based filtering in BrowseView (dropdown + tag icon) and ensure Clear Filters resets source. Update playnite, stashapp, and xbvr importers to set source conditionally using a new SOURCE_CATEGORY_MAPPING constant (added to types) so sources are only applied for appropriate media categories.
This commit is contained in:
Lars Behrends
2026-04-11 00:28:43 +02:00
parent f482807387
commit 53c6f5c555
7 changed files with 61 additions and 6 deletions

View File

@@ -1,5 +1,8 @@
const BASE_URL = import.meta.env.VITE_API_URL;
// Import the source mapping
import { SOURCE_CATEGORY_MAPPING } from '@/types';
export interface PlayniteConfig {
ip: string;
apiToken: string;
@@ -241,7 +244,7 @@ export async function importFromPlaynite(
series: game.series ? [game.series] : [],
ageRatings: game.ageRatings || [],
regions: game.regions || [],
source: game.source || null,
source: SOURCE_CATEGORY_MAPPING['playnite']?.includes('Games') ? (game.source || 'playnite') : null,
gameId: game.id,
pluginId: null,
completionStatus: game.completionStatus || 'Not Played',