-
-
Notifications
You must be signed in to change notification settings - Fork 297
Feat/video cache management #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xiangkehan
wants to merge
63
commits into
btjawa:dev
Choose a base branch
from
xiangkehan:feat/video-cache-management
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+35,978
−66
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add new cache_records module for managing imported local cache records - Create CacheRecords table with fields for video metadata, file info, and timestamps - Implement CRUD operations: insert, upsert, get_by_id, get_all, delete, and batch operations - Add cache records table initialization to storage module startup - Update .gitignore to exclude .kiro/ directory - Support tracking of download time and import time for cache records - Enable efficient querying and management of locally imported video caches
- Create cache module with import, parser, and validator submodules - Implement ImportService for concurrent cache directory importing with semaphore-based concurrency control (max 4 concurrent operations) - Add ImportResult, ImportDetail, ImportStatus, ImportProgress, and ImportError types for tracking import operations - Implement ParserService for parsing videoInfo.json and extracting cache metadata - Implement ValidatorService for validating cache directory integrity and required files - Add recursive directory scanning to identify valid cache directories containing videoInfo.json - Support detailed import progress tracking with per-directory status and error reporting - Enable bulk cache import operations with comprehensive success/failure/skip statistics
- Add cache import command handlers (import_cache_directory, get_import_progress, cancel_import) - Add cache management commands (get_cache_list, get_cache_list_by_status, delete_cache_item) - Add cache utility commands (open_cache_folder, get_cache_stats) - Implement global import state management using LazyLock and RwLock for concurrent access - Add CacheImportTaskType enum for queue system integration - Update import service to track and update progress during directory scanning, parsing, and validation - Register all new commands in Tauri command handler - Add CacheStats struct for cache statistics response - Enhance ImportService with progress state initialization and real-time updates
- Add CacheItem interface for imported cache file metadata including video info, file paths, and timestamps - Add ImportProgress interface for real-time import operation status tracking with error collection - Add ImportResult and ImportDetail interfaces for complete import operation results and per-directory details - Add ImportOptions interface for configurable import behavior (duplicates, integrity, deletion, etc.) - Add ScanResult and ScanDirectoryInfo interfaces for directory scanning operations - Add CachePreview interface for displaying cache content overview before import - Add VideoInfo interface for parsing B站 videoInfo.json metadata structure - Add CacheFilter and SortOption interfaces for cache list filtering and sorting functionality - Add CachePagination and CacheStatistics interfaces for UI list display and analytics - Add comprehensive enums for CacheStatus, ImportStatus, ImportErrorType, and CacheEventType - Include detailed JSDoc comments for all types and interfaces explaining purpose and usage - Organize types into logical sections (core models, import, configuration, video info, filtering, UI, events)
- Add CacheImportService class for handling cache directory selection and import operations - Implement selectCacheDirectory() to open system file dialog for cache root directory selection - Implement scanCacheDirectory() for scanning cache files (placeholder for backend implementation) - Implement startImport() and cancelImport() for managing import lifecycle - Implement listenImportProgress() using Tauri Channel for real-time progress tracking - Implement getImportResult() to retrieve completed import operation details - Add CacheManagementService class for managing imported cache files - Implement getCacheList() with filtering, sorting, and pagination support - Implement deleteCacheItem() and batchDeleteCacheItems() for cache removal operations - Implement playCacheItem() and openCacheFolder() for cache file operations - Add comprehensive error handling using AppError class - Include detailed JSDoc comments for all public methods - Provide type-safe integration with cache type definitions
- Create comprehensive cache store with state management for cache items, statistics, and pagination - Implement filtering system supporting keyword, status, uploader, file size, duration, and time range filters - Add sorting functionality for cache items by multiple fields (title, uploader, duration, file size, timestamps) - Implement pagination with computed properties for filtered, sorted, and paginated cache lists - Add computed properties for cache statistics (total count, available/unavailable/incomplete counts, file sizes, duration) - Implement cache import actions with progress tracking and history management - Add cache deletion, selection, and batch operations functionality - Integrate with cache import and management services for backend communication - Update store index to export new cache store module
- Add CacheItemCard component for displaying individual cache items with status, duration, and file size information - Add ImportProgressDialog component for showing cache import progress with visual feedback - Add CacheListPage view for browsing and managing imported cache items - Add CacheImportPage view for importing new cache files with progress tracking - Update SideBar component to include cache management navigation links - Update Empty component with cache-specific empty state handling - Update router configuration to include new cache management routes - Add Chinese localization strings for cache UI elements - Implement cache item selection, playback, folder navigation, and deletion functionality - Complete the cache management feature UI layer with comprehensive user interactions
- Add comprehensive cache import UI translations (en-US, ja-JP, zh-CN, zh-HK) * Import dialog labels and placeholders * Scan results and progress tracking terminology * Status messages and error type descriptions * Help steps and statistics labels - Add cache list management translations * Search, filter, and sorting options * Batch operations and selection controls * Statistics and pagination labels - Add cache card action translations (play, open folder, delete) - Add cache status translations (available, unavailable, incomplete) - Update backend service to support new cache import endpoints - Enable full internationalization support for cache management features across all supported languages
- Refactor CacheItemCard component with flexbox layout and Tailwind CSS styling - Add cover image display with gradient overlay and progress indicator - Implement inline play button with improved accessibility and visual hierarchy - Reorganize content layout with title, import time, and duration information - Update status badges positioning with absolute layout for better UX - Add hover-based action buttons for folder and delete operations - Improve formatImportTime function to display full timestamp format (YYYY-MM-DD HH:MM:SS) - Update Chinese translations for cache card UI elements - Enhance visual feedback with opacity changes for unavailable items - Simplify component structure by removing unnecessary wrapper divs and consolidating styles
- Add ImportOptions struct with configurable duplicate handling strategy - Implement DuplicateHandlingStrategy enum (Skip, Overwrite, Ask) - Add options for file integrity verification, post-import deletion, and playlist creation - Update import_cache_directory command to accept ImportOptions parameter - Implement duplicate detection logic with strategy-based handling - Add upsert operation for overwrite strategy to replace existing records - Update process_single_directory to handle duplicate handling based on selected strategy - Add Chinese translations for duplicate handling options - Update backend service and cache service to pass import options through the call chain - Enhance ImportDetail with reason field to explain skip/overwrite actions
…ress streaming - Add scan_cache_directory command to preview cache directories before import - Implement ScanResult and ScanDirectoryInfo types for directory scanning responses - Refactor import_cache_directory to return import ID for async tracking - Enhance get_import_progress with continuous event streaming using Channel - Add ImportProgressStatus enum for better progress state management - Implement automatic progress polling with 500ms intervals until completion - Update ImportService to support concurrent import tracking with HashMap - Add proper cleanup and error handling for import state management - Reorganize imports and improve code formatting for consistency - Update backend service layer to support new scanning and streaming APIs - Add i18n translations for cache scanning and import progress features - Improve CacheItemCard and ImportProgressDialog UI components - Separate scanning phase from import phase for better UX and performance
…ions - Add new error.rs module with CacheImportError enum covering all import failure scenarios - Implement thiserror derive for automatic error message generation and Display trait - Add ImportAction enum to support skip, retry, abort, and continue recovery strategies - Add ImportContext struct to track retry attempts and import progress - Implement error conversion methods from io::Error, sqlx::Error, serde_json::Error, and anyhow::Error - Add is_retryable() method to determine which errors can be automatically recovered - Add severity() method to classify errors as Info, Warning, Error, or Critical - Add user_friendly_message() for localized error descriptions - Add suggested_solution() for actionable error recovery guidance - Update Cargo.toml and Cargo.lock to add thiserror 1.0 dependency - Update .gitignore to exclude .claude/ directory - Integrate error handling into cache import service and backend API - Enables robust error recovery and improved user experience during cache import workflows
- Add check_local_cover command to detect and convert local cover files to base64 data URLs - Support multiple cover file formats (image.jpg, cover.jpg, cover.png, cover.webp, face.jpg) - Implement cover source priority: local files > network URLs > placeholder icon - Refactor CacheItemCard component with improved button layout and styling - Move action buttons from hover state to always-visible bottom-right section - Add open folder and delete buttons alongside play button with consistent styling - Add placeholder icon display when no cover source is available - Implement async cover loading with proper error handling and fallback logic - Add image prevention flag to prevent external image loading issues - Improve time formatting with validation for edge cases and invalid timestamps - Enhance visual hierarchy and user interaction patterns in cache item cards
…ntation - Add cache group service for organizing videos into groups and display items - Implement group detection logic that groups videos with 2+ items by group_id - Add cache group state storage for persisting group expansion state - Enhance cache records storage with comprehensive test coverage - Add cache import parser improvements for better metadata extraction - Update cache import service to utilize new grouping functionality - Add detailed cache management documentation covering videoInfo.json format - Implement group cover detection from local cache directories with fallback - Add automatic group title generation with common prefix detection - Improve storage layer with new cache_group_states module for state persistence
- Add get_cache_display_items command to retrieve mixed list of groups and videos - Add get_cache_display_items_paginated command with sorting, filtering, and search support - Add toggle_group_expansion and set_group_expansion commands for UI state management - Add get_group_statistics command to retrieve aggregated group metrics - Add get_videos_by_group_id command to fetch videos within a specific group - Add delete_group command to remove entire groups and their associated videos - Add cleanup_orphaned_group_states command for maintenance operations - Add batch_delete_cache_items command supporting both groups and individual videos - Add batch_export_cache_items command for bulk export operations - Add batch_move_cache_items command for bulk move operations - Implement PaginatedDisplayItems struct for paginated responses - Implement BatchOperationResult struct for operation tracking and error reporting - Update GroupService integration in backend service layer - Support filtering by status, searching by title and uploader, and sorting by time/size/title
- Reduce cover file detection to prioritize image.jpg and image.png formats - Remove obsolete cover formats (cover.jpg, cover.png, cover.webp, face.jpg) - Add support for multiple group cover file formats in group service - Implement fallback logic to check group.jpg, group.png, image.jpg, and image.png - Improve cover detection efficiency by focusing on most common Bilibili cache formats
- Add CacheGroupCard.vue component for displaying cache groups with expand/collapse functionality - Add CacheGroupCard.demo.vue with comprehensive demo scenarios including collapsed, expanded, and unavailable video states - Update cache component exports to include new CacheGroupCard component - Extend cache service with group selection and video selection management methods - Add group card related translations for all locales (en-US, ja-JP, zh-CN, zh-HK) - Update cache type definitions to support group card operations and state management - Provides interactive UI for managing cache groups with video selection, playback, and deletion capabilities
- Reorganize imports in commands.rs for better consistency - Fix whitespace and formatting issues across cache service modules - Reorder import statements in group service to follow alphabetical convention - Improve line wrapping for better readability in long function calls - Clean up unnecessary whitespace in conditional statements and loops - Standardize formatting in cache records and storage modules - Remove demo file for CacheGroupCard component - Update cache service client to align with backend changes - Enhance cache store and type definitions for consistency - Improve CacheListPage and CacheItemCard component formatting - Update i18n translations across all locales for cache management - Ensure consistent code style across Rust and Vue components
…play - Create CacheMixedList component to display both individual videos and video groups in a single unified list - Implement search filtering across video titles, UP names, and group content - Add empty state with conditional messaging based on active filters - Support batch selection for both videos and groups with visual feedback - Integrate CacheItemCard and CacheGroupCard components with full event delegation - Export new component from CachePage index for module accessibility - Provide responsive scrolling with custom scrollbar styling and smooth transitions - Enable seamless navigation between import workflow and cache browsing
- Simplify progress monitoring loop in import command using while-let pattern - Replace map_or with direct Option comparison for cleaner character matching logic - Use std::io::Error::other() instead of Error::new() for better API usage - Add explicit Retry action handling in import error recovery logic - Replace closure with function reference in unwrap_or_else for efficiency - Remove unnecessary return statement for implicit error propagation - Improve Vue component formatting with consistent line breaks and spacing - Enhance code readability and maintainability across Rust and Vue files
…dling - Add `get_group_states` command to retrieve all group expansion/collapse states from backend - Export `CacheGroupState` type with group_id, is_expanded, created_at, and updated_at fields - Update display items mapping to handle new backend data format with explicit type and data fields - Add null filtering for invalid display items with console warning for debugging - Implement fallback to default expansion state when group states fail to load - Fix group expansion state persistence by correcting invoke command name and parameter format - Add defensive null checks in `convertCacheRecordFromRaw` to prevent runtime errors - Add capitalized import status translations (Scanning, Parsing, Validating, Saving, Completed, Cancelled, Error) across all locales (en-US, ja-JP, zh-CN, zh-HK) - Improve error handling and data validation for cache display operations
- Fix timestamp conversion in parser to handle both second and millisecond formats - Remove redundant timestamp multiplication in store since backend now provides milliseconds - Improve date validation in CacheGroupCard and CacheItemCard components - Add DisplayTypeFilter type definition for better type safety - Add display type filter dropdown to show groups, singles, or all items - Add group ID filter dropdown for filtering by specific cache groups - Improve filter UI layout with flex-wrap and minimum widths for better responsiveness - Add filter status display showing selected groups and single videos count - Ensure consistent timestamp handling across parser, store, and UI components
…e handling - Add new `get_cache_statistics()` command for detailed cache analytics including group and video counts - Enhance `check_local_cover()` to support both file paths and directory paths for flexible cover detection - Add `CacheStatistics` type with total count, size, duration, status breakdown, and group metrics - Update cache records storage to include new statistics fields and improve data persistence - Add `get_group_cover()` command to retrieve group-specific cover images - Improve cache import service to handle group cover files during import process - Update cache parser to extract and store group metadata more accurately - Add i18n translations for new cache statistics labels across all supported languages (zh-CN, zh-HK, en-US, ja-JP) - Update CacheGroupCard and CacheItemCard components to display enhanced statistics - Enhance CacheListPage and CacheImportPage UI to show comprehensive cache information - Update backend service layer to expose new statistics endpoints - Add m4s-converter reference to README files for video format conversion support - Improve type definitions in cache.d.ts for better TypeScript support
- Add detailed cache video collection recognition logic section to guide - Document core grouping rules based on groupID as primary judgment criteria - Explain auxiliary rules for multi-P videos (p > 1) and independent videos - Add grouping key retrieval rules with priority levels (groupId > bvid) - Document group construction rules including minimum size and video sorting - Add group information generation table covering title, cover, uploader, and statistics - Document display item types (VideoGroup and SingleVideo) for frontend rendering - Add group state management section for persistence and lifecycle - Include implementation details for backend and frontend processing flows - Add practical usage scenario examples showing official collections, multi-P videos, mixed scenarios, and single videos - Update `is_collection_video()` to check for other videos sharing same group_id as core rule - Update `get_group_key()` to prioritize groupId when other videos share the same group_id - Refactor grouping logic to pass all records for proper collection detection - Change loop to iterate over references and clone records when adding to groups/singles
…rd shortcuts - Add batch delete functionality for cache items and groups with file system cleanup - Implement BatchActionBar, BatchDeleteDialog, BatchDeleteProgressDialog, and BatchDeleteResultDialog components - Add delete_group_with_files method to properly remove group files and database records - Enhance delete_cache_item command to remove both files and database records atomically - Add keyboard shortcuts service for improved user interaction - Update cache service and store to support batch operations - Add internationalization strings for batch delete UI in all supported languages - Improve group deletion logic to properly handle file cleanup before database deletion - Refactor batch_delete_cache_items command to use unified deletion logic for consistency - Update CacheGroupCard, CacheItemCard, and CacheMixedList components for batch selection support - Add database migration support for cache_records table schema updates
…king - Add comprehensive transfer service module with checkpoint-based resumable downloads - Implement transfer manager for handling multiple concurrent file transfers - Add protocol support for HTTP range requests and resume functionality - Create transfer validator for file integrity verification and checksum validation - Add local file management with atomic write operations and cleanup handlers - Implement error handling with detailed transfer-specific error types - Add transfer progress tracking with per-task and overall progress monitoring - Create UI components for transfer dialogs and real-time progress visualization - Add transfer state persistence to Pinia store for session recovery - Implement cache root migration dialog for moving cache directories - Add internationalization support for transfer-related messages (EN, JA, ZH) - Update dependencies: add async-trait, uuid, dirs, libc, windows-sys for cross-platform support - Refactor cache records storage integration with transfer system - Improve code formatting and organization across cache and transfer modules - Enable resumable downloads with automatic checkpoint management and recovery
…tocol initialization - Add select_folder command for native folder picker dialog integration - Implement init_transfer_manager function to ensure protocol registration on startup - Add protocol initialization check in start_transfer command - Improve code formatting and line length consistency across transfer module - Reorganize imports in commands.rs for better readability - Add comprehensive error handling for folder selection operations - Update transfer manager initialization to support local file protocol registration - Enhance device change listener with improved formatting and readability
…nvention - Add `rename_all = "camelCase"` to Tauri command macros for consistent API naming - Implement retry logic in progress listener with configurable max retries (20 attempts) - Reduce progress check interval from 500ms to 200ms for more responsive updates - Update task status before removal from active tasks to ensure final state is captured - Add 500ms delay after task completion to allow frontend to fetch final status - Fix task_id assignment in progress update channel to use correct task identifier - Add dynamic transfer dialog title based on task status (completed, failed, cancelled) - Add new i18n keys for transfer status labels (pending, running) across all locales - Improve transfer progress state management and error handling in manager
…ndling - Add automatic cache record validation in get_cache_list and get_cache_list_by_status commands - Implement cleanup_invalid_cache_records command to remove orphaned database entries - Add dialog:allow-confirm capability to default permissions - Refactor LocalFileProtocol to use ensure_task_registered for better task lifecycle management - Make unregister_task public and implement AsAny trait for protocol type casting - Update transfer_file signature to accept task_id parameter for improved task tracking - Enhance transfer protocol to support external task ID management - Add comprehensive cache file existence validation with videoInfo.json verification - Update backend service and store to support new cache cleanup operations - Add internationalization strings for cache cleanup operations in all locales - Add device discovery test file for protocol validation - Improve error handling and logging for invalid cache record cleanup
…king - Remove redundant register_task method in favor of ensure_task_registered - Treat entire directory as single transfer unit instead of counting individual files - Update progress tracking to count directory as one completed file rather than file count - Set current_file to directory path for clearer progress display - Add final progress update after directory transfer completion - Calculate total_files based on source paths count in transfer manager - Ensure completed_files reflects directory-level completion status - Improve progress reporting accuracy for batch video folder transfers
…tions - Extract file size and time formatting utilities into dedicated modules (format.ts) - Extract error handling logic into centralized error-handler.ts utility - Create new constants modules for cache, file-system, network, time, and UI configurations - Add common type definitions in common.d.ts for shared type interfaces - Refactor TransferProgressDialog into modular sub-components (TransferControls, TransferSummary, TransferTaskList) - Improve transfer task progress tracking by checking both active and completed tasks - Increase transfer result wait time from 500ms to 2000ms for better frontend state synchronization - Remove duplicate formatting functions from multiple components in favor of centralized utilities - Update BatchDeleteDialog, BatchDeleteProgressDialog, and BatchDeleteResultDialog to use shared utilities - Enhance CacheRootMigrationDialog with error handling and utility imports - Consolidate repeated utility functions across cache-related components for better maintainability
…chronization - Send final progress state through existing channel to ensure frontend receives completion status - Ensure progress displays 100% on task completion by setting completed_files and transferred_size to totals - Reset speed and remaining_time to 0 on task completion or failure - Reduce final state wait time from 2000ms to 1000ms for faster cleanup - Optimize polling mechanism to only check running/paused tasks, relying on push mechanism for completed tasks - Increase polling interval from 500ms to 2000ms to reduce unnecessary requests - Only update progress when task status changes to prevent redundant updates - Remove unnecessary migrateTransferProgress call and directly construct progress object - Update migration dialog and transfer dialog icons from fa-folder-arrow-right to fa-folder-arrow-up for consistency - Improve comments to clarify lightweight state checking as backup to push mechanism
…d type simplification - Extract transfer protocol constants into dedicated constants module for better maintainability - Simplify TransferTarget type by removing unused DeviceType and ConnectionStatus fields - Remove unused DeviceInfo type and device discovery/monitoring commands - Refactor transfer manager initialization and error handling - Update import service to use simplified transfer types - Improve code formatting and organization across transfer modules - Update frontend transfer services and store to work with simplified types - Add utility functions for transfer progress formatting - Consolidate transfer-related type definitions in common types file - Improve cache import dialog and progress tracking UI components
- Delete checkpoint.rs module and CheckpointManager implementation - Delete resumable.rs module and resumable transfer functionality - Remove RESUMABLE_BUFFER_SIZE constant from buffer_sizes module - Remove CHECKPOINT_SAVE_INTERVAL constant from progress_intervals module - Update mod.rs to remove checkpoint and resumable module declarations - Simplify transfer system by consolidating checkpoint logic into core transfer types - Reduce complexity and maintenance burden by removing unused resumable transfer abstraction
…d keys - Replace hardcoded Chinese text with i18n key reference in TransferDialog.vue - Add new "selectTargetFolder" translation key across all locales (en-US, ja-JP, zh-CN, zh-HK) - Add missing "page" translation key to all locale files - Remove unused transfer-related translation keys: discoveringDevices, removableDevice, deviceDisconnected, operation, noDevicesFound, checkingSpace, preparingTransfer, transferStarted, transferPaused, transferResumed, connectionLost, reconnecting, resumeTransfer, retryTransfer, deviceNotFound - Reorder spaceInfo and totalSize keys for consistency across all locales - Improve translation key organization and reduce redundant entries
- Replace native `<select>` elements with reusable Dropdown component in CacheImportPage - Replace native `<select>` elements with reusable Dropdown component in CacheListPage - Update Dropdown z-index from z-10 to z-50 for proper overlay stacking - Add watchers for selectedSort and selectedUploader to trigger applySort and applyFilters - Import Dropdown component in both CacheImportPage and CacheListPage - Standardize dropdown options format using id/name structure for consistency - Improve UI consistency and maintainability by using unified Dropdown component across cache management views
- Add pinyin crate dependency (v0.10) to Cargo.toml and Cargo.lock - Implement get_title_sort_key() function to convert Chinese characters to pinyin first letters for proper alphabetical sorting - Implement map_sort_field() function to normalize frontend sort field names to backend field names - Update sort logic in get_cache_display_items_paginated() to use pinyin-based comparison for title sorting - Rename sort parameters in cache store from snake_case to camelCase (sort_by → sortBy, sort_order → sortOrder) - Improves user experience by ensuring Chinese titles sort correctly alongside other content
- Add "collection" filter option to cache list status filters - Implement collection filtering logic to identify videos with shared group_id or multi-part videos (p > 1) - Add collection status translations across all supported locales (en-US, ja-JP, zh-CN, zh-HK) - Remove deprecated display type and group ID filter selectors from UI - Simplify status filter buttons to show only collection filter option - Clean up unused filter state variables (selectedDisplayType, selectedGroupId) - Optimize file size retrieval in transfer manager by removing unnecessary variable assignment - Update hasActiveFilters computed property to reflect removed filter options
…e display logic - Remove get_cache_list and get_cache_list_by_status commands from backend - Remove corresponding TypeScript service methods that duplicated functionality - Replace getCacheList calls with get_cache_display_items for unified data retrieval - Update refreshCacheItemStatus to use display items API instead of list refresh - Update exportCacheList to work with display items structure - Consolidate cache data retrieval to single source of truth (display items) - Simplify cache management service by removing redundant list fetching logic - Improve consistency across cache operations by using standardized display format
- Add `get_all_uploaders()` backend command to fetch distinct uploader names from database - Implement database query with alphabetical sorting for consistent uploader list - Add `getAllUploaders()` service method in backend.ts for frontend invocation - Convert `allUploaders` from computed property to reactive state in cache store - Add `loadAllUploaders()` function to load uploader list from full dataset on mount - Update CacheListPage to invoke uploader list loading during component initialization - Improves performance by fetching uploaders from database instead of computing from filtered display items
…gement - Add cache auto-refresh timer with configurable intervals in App.vue - Implement incremental cache scanning on app initialization and periodic intervals - Add CACHE_AUTO_REFRESH and TIME_CONVERSION constants for refresh configuration - Refactor cache, transfer, and settings store with improved type definitions - Update all cache-related components with enhanced UI and state management - Consolidate cache service utilities and error handling mechanisms - Add auto-refresh notification system with change detection - Update i18n translations for cache auto-refresh messages across all locales - Improve keyboard service and media extras handling - Refactor transfer service with better progress tracking and task management - Update storage and strategy settings components with new cache features - Enhance format and transform utilities for better data processing - Add comprehensive type definitions for cache, transfer, and common types
- Remove unused computed properties from cache store: availableCacheCount, unavailableCacheCount, incompleteCacheCount, groupCount, singleVideoCount, and averageVideosPerGroup - Update totalCacheCount to use cacheStatistics data when available for consistency - Remove statistics display UI from CacheListPage sidebar including status-based counts and group statistics - Remove unused i18n translation keys across all locales (en-US, ja-JP, zh-CN, zh-HK): available, unavailable, incomplete, groups, singleVideos, and averagePerGroup - Simplify statistics display to show only total count and total size, reducing UI clutter and maintenance burden
- Add success_count, failure_count, and skipped_count fields to ImportProgress struct - Implement real-time progress statistics updates during import operations - Move uploader filtering to post-processing stage to support collection filtering - Add serde rename_all attribute to ImportResult, ImportDetail, ImportProgress, and ImportError structs - Refactor collection filtering logic with improved code formatting and clarity - Update transfer module imports for better organization - Enhance cache display items pagination with proper filtering order - Improve code formatting and consistency across transfer and cache services
- Add new converter service module with m4s to mp4 conversion support - Implement ConvertService for creating, executing, and managing conversion tasks - Add task lifecycle management (pause, resume, cancel operations) - Implement disk space checking before conversion to prevent failures - Add ConvertProgress tracking with detailed stage information - Create error handling module for converter-specific exceptions - Add stream processing for efficient m4s file handling - Implement conversion configuration persistence (quality, bitrate, metadata) - Add 11 new Tauri commands for frontend integration: * convert_cache: create and execute conversion tasks * pause/resume/cancel_convert: task control operations * check_convert_space: validate available disk space * get/save_convert_config: configuration management * get_convert_task/get_all_convert_tasks: task status queries * listen_convert_progress: real-time progress streaming - Update backend service initialization to include converter module - Add conversion config to application settings storage - Enables users to convert cached m4s segments to standard video formats with flexible configuration options
- Add ConvertDialog component for selecting output directory and initiating conversions - Implement ConvertProgressDialog with real-time task progress tracking and statistics - Create converter service with task management and progress monitoring capabilities - Add convert action to BatchActionBar with batch conversion support - Add convert context menu option to CacheItemCard for individual item conversion - Emit convertVideo event through CacheMixedList component hierarchy - Add converter type definitions for task and progress data structures - Update i18n translations for convert dialog (en-US, ja-JP, zh-CN, zh-HK) - Integrate disk space validation and file size formatting utilities - Enable users to convert multiple cache items with progress visualization
- Reformat multi-line class attributes for improved readability in dialog headers - Simplify conditional expressions by removing unnecessary parentheses - Remove unused device_type and connection_status fields from TransferTarget initialization - Update import statements to use backend types directly for ImportProgress - Refactor cache service to use consistent naming (displayItems → rawItems) - Improve code consistency across CachePage components and services - Enhance maintainability by aligning with project formatting standards
- Add batch pause, resume, and cancel commands for multiple conversion tasks - Implement batch progress aggregation with overall statistics - Add task recovery mechanism to restore incomplete conversions on app startup - Implement abandon and cleanup operations for incomplete and completed tasks - Add BatchOperationIds and BatchConvertProgress types for batch operation results - Create convert_tasks.rs storage module for persistent task state management - Update backend service with new batch operation endpoints - Add i18n translations for batch operation messages in all locales - Update TypeScript converter service and type definitions for new batch APIs - Enhance ConvertProgressDialog to support batch task management - Enable graceful handling of interrupted conversions across app restarts
- Add image crate dependency with PNG and JPEG feature support for cover image conversion - Implement PNG to JPG conversion for cover images since FFmpeg lite doesn't support PNG pixel format - Add `open_path` command to open arbitrary files or folders from the application - Update `find_cover_file` to automatically convert PNG covers to JPG format in temp directory - Add temp directory parameter to metadata embedding function for storing converted covers - Update M4s header detection to use ASCII '0' (0x30) marker instead of null bytes for accuracy - Add "Open Folder" button to conversion progress dialog for quick access to output directory - Improve cover file handling to prioritize JPG and gracefully handle PNG conversion failures1
- Replace video file icon (fa-file-video) with conversion icon (fa-right-left) across all converter components for better semantic representation - Add batch conversion result summary formatting with i18n support for multiple languages - Implement time formatting for batch results with hours, minutes, and seconds localization - Add new i18n keys for batch result summary and time formatting in en-US, ja-JP, zh-CN, and zh-HK locales - Add "groups" collection label translation across all supported languages - Update BatchActionBar, CacheItemCard, ConvertDialog, ConvertProgressDialog, and SingleTaskProgress components with new icon - Enhance converter service with formatBatchResultSummary function for displaying batch operation statistics
… logic - Delete ImportProgressDialog.vue component and migrate functionality - Update cache service to handle import progress tracking internally - Refactor cache store to manage import state and progress updates - Simplify component exports in CachePage index - Update cache type definitions to support new import tracking structure - Consolidate progress monitoring into service layer for better separation of concerns
- Change dev server port from 1420 to 3000 in both Vite and Tauri configs - Update devUrl in tauri.conf.json to http://127.0.0.1:3000 - Set default host to 127.0.0.1 instead of false for consistency - Ensure fixed port availability and proper local development setup
…alculation - Add image preview functionality with base64 encoding support for JPG, PNG, and WebP formats - Implement estimated total size calculation during cache directory scanning - Add scan duration tracking to measure performance - Update Cargo.lock with new dependencies: async-trait, dirs, image, libc, pinyin, thiserror, uuid, windows-sys, zune-core, and zune-jpeg - Enhance cache group service with image preview generation and caching - Update TypeScript cache service types to support preview data - Optimize vite configuration for better build performance - Improve cache validator with enhanced error handling and validation logic
…acking - Add max_concurrency option to ImportOptions with configurable range (1-8) - Move semaphore creation from service initialization to import execution for dynamic concurrency control - Simplify progress calculation to use actual completion counts instead of directory index - Remove verify_integrity, delete_after_import, and create_playlist from user-configurable options (hardcoded to safe defaults) - Update ImportOptions type to only expose duplicateHandling and maxConcurrency - Remove unused UI checkboxes for integrity verification and playlist creation - Improve progress tracking accuracy by calculating completed items from success/failure/skipped counts - Refactor progress updates to remove processed_directories tracking in favor of result-based calculation
- Rename 'playVideo' event to 'convertVideo' in CacheGroupCard component - Rename 'play' event to 'convert' in CacheItemCard component - Update play button icon from fa-play to fa-right-left across cache components - Update button label from 'cache.card.play' to 'convert.title' for consistency - Remove unused 'play' emit from CacheItemCard interface - Update event handlers in CacheMixedList to use 'convertVideo' instead of 'playVideo' - Update CacheListPage to handle convert action from context menu - Align cache page UI with converter feature by repurposing play button for video conversion
…oading - Remove unused playItem function that was previously used for playing cache items - Add loadCurrentCacheRoot call in onMounted hook to load cache root directory state - This state is needed for refresh button logic determination - Simplifies cache list page by removing dead code and ensuring proper initialization
…nd similarity analysis - Add suggestion engine with feature extraction and clustering capabilities - Implement similarity calculator for detecting duplicate and similar cache items - Add sampling strategy for efficient processing of large cache datasets - Create SuggestionButton component with badge display and loading states - Add SuggestionGroup and SuggestionItem components for suggestion UI display - Create SuggestionPanel component for managing suggestion workflow - Add suggestion store module for state management - Implement keyboard shortcuts for suggestion interactions - Add suggestion type definitions and interfaces - Update i18n translations for suggestion UI (en-US, ja-JP, zh-CN, zh-HK) - Integrate suggestion button into BatchActionBar with click handlers - Add feature caching service for performance optimization - This enables users to identify and manage duplicate or similar cache items intelligently
- Remove unused PAGINATION import from main.ts - Remove unused NOTIFICATION import from services/utils.ts - Update suggestion group label to use i18n key reference (labelInfo) instead of hardcoded Chinese text - Remove unused index parameter from ids.map() callback in cache store batch operation - Improve code consistency and enable proper internationalization for suggestion groups
更新readme
- Update getCacheRecord to search for videos in both single_video and video_group items - Refactor getAllCacheItems to use flatMap for extracting videos from collections - Update handleTransferConfirm to include videos from collection groups - Update openSuggestionPanel to include videos from collection groups - Update refreshSuggestions to include videos from collection groups - Replace type guard filters with explicit conditional checks for better readability - Improve comments to clarify that videos are extracted from both single and grouped items
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在v1.4.7的基础上添加了管理离线缓存的功能
实现了一下内容
This pull request introduces comprehensive improvements and documentation for the Offline Cache Manager feature, expands the backend and frontend APIs to support advanced cache management, and updates project dependencies to enable new functionality. The changes include detailed documentation of cache file formats and grouping logic, new API endpoints for cache and group operations, and the addition of several new dependencies for media processing and system integration.
Major documentation and feature additions:
Offline Cache Manager Documentation & Features
docs/guide/cache.md) describing the structure ofvideoInfo.json, cache grouping logic, and display rules for offline video cache management. This covers how videos are grouped, displayed, and managed in the UI, as well as backend and frontend processing flows.README.md,README_EN.md, andREADME_JA.mdto document the Offline Cache Manager's features, including batch operations, M4S to MP4 conversion, smart suggestions, and collection recognition. [1] [2] [3]Reference and Attribution Updates
m4s-converterproject in all language README files, acknowledging its use for M4S to MP4 conversion. [1] [2] [3]Backend/API enhancements:
API Expansion for Cache, Group, and Conversion Management
src-tauri/src/lib.rs). This enables advanced cache and group operations, batch actions, and real-time event handling for conversion processes.src-tauri/src/services.rs).Dependency and capability updates:
New and Updated Dependencies
image), error handling (thiserror), file system and OS integration (dirs,windows-sys,libc), batch operations (async-trait), string handling (pinyin,uuid), and others insrc-tauri/Cargo.toml. [1] [2]dialog:allow-confirmcapability insrc-tauri/capabilities/default.jsonto support confirmation dialogs in the UI.These changes lay the groundwork for robust offline cache management, batch processing, and improved user experience around Bilibili video cache handling.
References: