Commit Graph

34 Commits

Author SHA1 Message Date
Koha9 df4f5dde17 Fix: Resolved an issue where Cron scheduled tasks failed to auto-sync due to an overly short trigger grace period.
Set `misfire_grace_time=60, coalesce=True`
2025-12-05 08:07:51 +09:00
copilot-swe-agent[bot] 304e973db1 Fix Simple Mapping Windows path handling with double backslashes
- Normalize Windows paths by replacing \\\\ with \\ before pattern matching
- Escape backslashes in replacement strings for post-processing
- Add debug logging to help diagnose path matching issues

Root cause: UI stored escaped paths (\\\\Koha9-Main\\\\Music) but playlist
content uses single backslashes (\\Koha9-Main\\Music). Now normalizes paths
before compiling regex patterns.

Co-authored-by: Koha9 <36852125+Koha9@users.noreply.github.com>
2025-12-03 22:14:03 +00:00
copilot-swe-agent[bot] fbafe75fae Implement Simple Mapping backend functionality
- Add _compile_simple_mapping_rules() that generates four rule sets from mapping pairs
- Each mapping uses UUID as unique mapping_id with special markers (__MAPPING__uuid__)
- local_pre: local_path → mapping_id
- remote_pre: cloud_path → mapping_id
- local_post: mapping_id → local_path
- remote_post: mapping_id → cloud_path
- Add UUID validation to prevent injection attacks
- Update sync_all_playlists() to detect and use SIMPLE mode

Co-authored-by: Koha9 <36852125+Koha9@users.noreply.github.com>
2025-12-02 21:15:14 +00:00
copilot-swe-agent[bot] fbb5bb55c7 Implement Regex Rules backend functionality for path mapping
- Add CompiledRegexRules dataclass for all four processing stages
- Update _compile_regex_rules to support both legacy (pattern/replacement)
  and new (search/replace) field names with proper empty string handling
- Add _compile_path_mapping_rules helper function
- Update _write_results to apply post-processing rules:
  - local_result.m3u8 with local_post rules
  - remote_result.m3u8 with remote_post rules
  - base_next.m3u8 unprocessed (normalized sync result)
- Update merge_playlists and _sync_single_playlist to pass compiled_rules
- Update sync_all_playlists to implement full processing flow:
  1. Detect REGEX mode from path_mapping config
  2. Apply local_pre rules to local playlists before sync
  3. Apply remote_pre rules to remote playlists before sync
  4. Perform sync/merge
  5. Apply post rules to results for respective outputs

Co-authored-by: Koha9 <36852125+Koha9@users.noreply.github.com>
2025-12-02 20:08:06 +00:00
Koha9 f9dbe733c3 Merge commit '3f43662c1f19056e81f107357b661b435ee3a876' into copilot/update-regex-replacement-strategy 2025-12-02 10:16:44 +09:00
Koha9 3f43662c1f feat: Enhance logging configuration and add dynamic log level support 2025-12-02 10:15:44 +09:00
Koha9 aa4517aaf5 Fix: Fixed an issue where the Sync Now button became unresponsive due to duplicate API calls. 2025-12-02 09:55:57 +09:00
copilot-swe-agent[bot] 350f1d97e6 Add Path Mapping UI with Simple Mapping and Regex Rules modes
- Updated frontend/types.ts with new types: ReplacementRule, PathMappingRules, PathMappingMode, PathMappingConfig
- Replaced StrategySelector.tsx with new UI featuring:
  - Simple Mapping tab for local/cloud path pairs
  - Regex Rules tab with 4 rule groups (localPre, localPost, remotePre, remotePost)
  - MappingGroupEditor sub-component for editing rule lists
- Updated App.tsx to use PathMappingConfig state instead of RegexReplacement[]
- Updated api.ts to handle new PathMappingConfig structure
- Updated backend config.py with path_mapping field support
- Added /api/settings/path-mapping endpoint in main.py

Co-authored-by: Koha9 <36852125+Koha9@users.noreply.github.com>
2025-11-30 22:11:29 +00:00
Koha9 559342fae7 feat: Enhance scheduler and watcher with improved logging and cron trigger helpers 2025-11-29 12:56:18 +09:00
Koha9 fe4061d1a1 feat: Implement sync manager and file watcher for automated playlist synchronization 2025-11-29 12:26:59 +09:00
Koha9 7dae8647e6 feat: Implement scheduling functionality for playlist synchronization
- Added a new scheduler module using APScheduler to manage scheduled sync jobs.
- Introduced cron expression validation and job scheduling based on user-defined settings.
- Enhanced frontend to support schedule settings, including cron, daily, and weekly modes.
- Updated API service to handle fetching and saving schedule settings.
- Modified StrategySelector component to include schedule management UI.
- Added new types for schedule settings and modes in the frontend.
- Updated requirements to include APScheduler for scheduling capabilities.
2025-11-29 10:49:35 +09:00
Koha9 0ede137170 Support backend connection timeout configuration 2025-11-29 08:18:32 +09:00
Koha9 832dbc11d5 Fix frontend entrypoint for Vite build 2025-11-29 00:25:45 +09:00
Koha9 1b6dddacc8 Add a dropdown menu that allows users to select a library. 2025-11-27 21:48:48 +09:00
Koha9 355886e797 Modify get_libs_name_list to filter out non-music libraries during output. 2025-11-27 08:11:27 +09:00
Koha9 0ad64216f5 Add regex-based path preprocessing for playlist sync 2025-11-25 21:33:04 +09:00
Koha9 5a52831ae8 Fix remote-priority merge postprocessing. 2025-11-25 10:50:37 +09:00
Koha9 0bb624f3c9 Adjust local-priority merge postprocessing 2025-11-25 10:08:49 +09:00
Koha9 97aa598775 Fix local-priority merge to avoid remote reorders in conflicts 2025-11-25 10:08:42 +09:00
Koha9 a912213e2e Load remote playlists from Plex during sync 2025-11-25 04:39:30 +09:00
Koha9 08eed569a9 Sync all playlists and track deletions 2025-11-24 22:21:01 +09:00
Koha9 61794b8db9 Add playlist overview homepage 2025-11-24 17:35:42 +09:00
Koha9 93cc72d612 load local playlist.
cache plex tracks.
2025-07-23 22:38:51 +09:00
Koha9 1eb067bab7 logger fix 2025-07-19 18:37:23 +09:00
Koha9 c3d1662465 logger added.
plex_client method naming fix.
2025-07-19 18:00:48 +09:00
Koha9 65bd99d3f2 Fix config not save&load 2025-07-19 10:35:14 +09:00
Koha9 992161f9a9 refactor plex_client,config 2025-07-12 19:00:35 +09:00
Koha9 a8863f911b 支持手动token认证 2025-07-08 19:17:18 +09:00
Koha9 d4ed9d22f5 Add scheme dropdown and load defaults from config 2025-06-21 19:34:07 +09:00
Koha9 7ab55e3ae4 Add HTTPS support for server URL 2025-06-21 19:20:48 +09:00
Koha9 83c5780c57 Remove library selection and default theme 2025-06-20 22:32:05 +09:00
Koha9 75a413667d Set default Plex port 2025-06-20 22:27:01 +09:00
Koha9 aa4223b413 Refactor Plex interaction into separate module 2025-06-20 21:54:55 +09:00
Koha9 e9fcaf508e Complete bootstrap base frontend prototype.
- login page and playlist setting page frontend templates.
- fast API route.
- reading and saving config files
- mock login logic for UI interaction demo
2025-04-04 20:16:09 +09:00