PlexPlaylist_UI subtree merge
feat: Introduce path mapping for sync Merge commit 'f791798206d87c694c14d7bffb52645706af4964'
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
|
||||
import { Playlist, ServerType, ApiResponse, PlexServerConnection, PlexConnectionSettings, PlexLibrary, SyncStrategy, RegexReplacement, ScheduleSettings, ScheduleMode } from '../types';
|
||||
|
||||
|
||||
import { Playlist, ServerType, ApiResponse, PlexServerConnection, PlexConnectionSettings, PlexLibrary, SyncStrategy, PathMappingConfig, ScheduleSettings, ScheduleMode } from '../types';
|
||||
import { MOCK_LOCAL_PLAYLISTS, MOCK_CLOUD_PLAYLISTS } from './mockData';
|
||||
|
||||
const SIMULATE_DELAY_MS = 800;
|
||||
@@ -127,9 +129,10 @@ const authenticatePlex = async (settings: PlexConnectionSettings, signal?: Abort
|
||||
});
|
||||
}
|
||||
|
||||
const triggerSync = async (strategy: SyncStrategy, regexRules: RegexReplacement[]): Promise<void> => {
|
||||
const triggerSync = async (strategy: SyncStrategy, pathMapping: PathMappingConfig): Promise<void> => {
|
||||
return new Promise((resolve) => {
|
||||
// Simulate a sync process taking 3 seconds
|
||||
// In a real app, pathMapping would be sent to backend
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 3000);
|
||||
@@ -193,9 +196,9 @@ export const apiService = {
|
||||
}
|
||||
},
|
||||
|
||||
syncPlaylists: async (strategy: SyncStrategy, regexRules: RegexReplacement[]): Promise<ApiResponse<null>> => {
|
||||
syncPlaylists: async (strategy: SyncStrategy, pathMapping: PathMappingConfig): Promise<ApiResponse<null>> => {
|
||||
try {
|
||||
await triggerSync(strategy, regexRules);
|
||||
await triggerSync(strategy, pathMapping);
|
||||
return { data: null, status: 'success', message: 'Sync complete' };
|
||||
} catch (error) {
|
||||
return { data: null, status: 'error', message: 'Sync failed' };
|
||||
|
||||
Reference in New Issue
Block a user