Commit Graph

107 Commits

Author SHA1 Message Date
tigeren f9d30fa9b4 feat: native用artplayer取代 2025-09-16 15:03:56 +00:00
tigeren a22e4a95c5 feat(transcode): improve transcoding logic with request deduplication and stable FFmpeg processes
- Add HEAD request handler to serve video metadata without body
- Replace fluent-ffmpeg with direct spawn for FFmpeg process execution
- Implement active request tracking to prevent duplicate transcoding streams
- Enhance process management by avoiding killing similar seek processes (within 2s)
- Preserve original metadata and apply duration overrides for accurate streaming
- Return full duration metadata and seek time in custom response headers
- Add DELETE endpoint to clean up all transcoding processes for a video
- Update client video player to detect transcoding need and switch source accordingly
- Implement retry logic with capped attempts for both direct and transcoding streams
- Add user-visible transcoding error display with retry button in video viewer
- Optimize transcoding seek requests to avoid duplicate or unnecessary restarts
- Enhance useStableProgress hook to support seek offset from streaming URL
- Adjust progress updates to consider seek time offset for smooth playback progress
- Initialize progress state at seek offset instead of zero on reset to prevent jitter
2025-09-06 18:26:31 +00:00
tigeren 13d6874c00 feat(api): add FFmpeg process status and management API endpoints
- Implement GET /api/ffmpeg/status to return current FFmpeg process status
- Support filtering by videoId and response formatting (JSON or text table)
- Include optional statistics in status response
- Implement DELETE /api/ffmpeg/status for process cleanup operations
- Allow killing processes by videoId, stale status, or all at once
- Add cache-control and CORS headers for API responses
- Add error handling with 500 response on failure
2025-09-06 16:39:00 +00:00
tigeren b93bd26825 fix: ensure proper encoding of folder paths in navigation links
- Updated folder path handling in the FolderViewerPage, SidebarContent, and VirtualizedFolderGrid components to use encodeURIComponent for URL encoding.
- This change improves the handling of special characters in folder paths, ensuring correct navigation and link generation.
2025-09-02 17:49:35 +00:00
tigeren fbeed219fc fix: improve file path handling in API routes
- Updated file reading and database querying logic to decode URL-encoded paths, ensuring proper handling of special characters.
- Refactored path usage in the GET requests for both media file listing and content retrieval, enhancing compatibility with various file names.
2025-09-02 17:14:32 +00:00
tigeren 89930b833c refactor: update Dockerfile and docker-compose.yml for improved media handling
- Removed the USER directive from the Dockerfile to simplify the build process.
- Added new volume mounts in docker-compose.yml for additional media directories, enhancing media accessibility.
- Updated the media database file, reflecting changes in media management.
- Deleted obsolete thumbnail files to clean up the project structure and reduce clutter.
2025-09-01 18:08:17 +00:00
tigeren 1b78492a92 chore: update Docker image reference in docker-compose.yml
- Changed the image reference for the NextAV service to use the latest version from the private registry.
- Ensured the container name and restart policy remain unchanged for consistent deployment behavior.
2025-08-31 16:41:20 +00:00
tigeren 30cebc453a fix: improve transcoding progress bar and duration handling
- Enhanced video player components to correctly read and display duration for transcoded streams, addressing issues with incorrect progress bar behavior.
- Updated FFmpeg configuration to ensure proper preservation of duration metadata during transcoding.
- Implemented better validation for progress bar calculations to prevent invalid values.
- Added dynamic duration change event handling to improve user experience during transcoding.
- Updated documentation to reflect changes and added testing instructions for progress bar functionality.
2025-08-31 16:36:54 +00:00
tigeren 25f230e598 feat: implement transcoding fixes and heartbeat management
- Added documentation for transcoding fixes addressing FFmpeg process management and progress bar accuracy.
- Introduced a heartbeat mechanism to track active video players and ensure proper cleanup of FFmpeg processes.
- Created a global ProcessManager class for managing FFmpeg processes and automatic cleanup of stale processes.
- Enhanced video player components to support heartbeat notifications and display transcoding status.
- Updated API routes for managing heartbeats and processes, improving resource efficiency and user experience.
2025-08-31 15:58:45 +00:00
tigeren 280a718a63 feat: enhance video streaming and transcoding capabilities
- Added support for video codec analysis and transcoding based on codec information.
- Implemented new API routes for transcoding videos, allowing for dynamic quality adjustments.
- Updated video player components to handle errors and fallback to transcoded versions if direct streaming fails.
- Enhanced database schema to store codec information for media files.
- Introduced a VideoAnalyzer utility for extracting codec details from video files during scanning.
- Improved CORS handling in API responses for better compatibility with various clients.
2025-08-31 14:56:23 +00:00
tigeren f6a02d9328 refactor: remove thumbnail API and update thumbnail management
- Deleted the thumbnail API route to streamline the application structure.
- Integrated ThumbnailManager for improved thumbnail path generation and directory management.
- Updated media scanning logic to utilize hashed thumbnail paths and ensure directory existence.
- Enhanced error handling for thumbnail generation with fallback options based on media type.
2025-08-31 09:23:05 +00:00
tigeren 407c702e88 feat: add text file support and viewer enhancements
- Introduced a text viewer for displaying various text file formats, including .txt, .md, and more.
- Implemented API routes for fetching text file content with encoding options and error handling.
- Enhanced folder viewer to support text file selection and integrated the new text viewer component.
- Updated global styles to include custom scrollbar styles for the text viewer.
- Added support for hashed folder structure to store thumbnails for better organization.
- Included new dependencies for text encoding handling and updated package configurations.
2025-08-31 08:42:30 +00:00
tigeren 0c8cb78ad2 [!!]refactor: optimize Docker configuration and update .dockerignore
- Changed base image in Dockerfile to a smaller Alpine version for reduced size.
- Updated package installation commands to use Alpine's package manager.
- Enhanced .dockerignore to exclude additional files and directories, improving build efficiency.
- Added new entries for media, database, and test files to .dockerignore.
- Adjusted docker-compose.yml to use a simplified image name for clarity.
2025-08-30 20:12:15 +00:00
tigeren 9ca11a8c6d feat: add thumbnail API and update Docker configuration
- Implemented a new API route for serving thumbnails, allowing dynamic retrieval of image files.
- Updated Dockerfile to install FFmpeg for media processing.
- Enhanced docker-compose.yml to mount the thumbnails directory for easier access.
- Added public/thumbnails to .dockerignore and .gitignore to prevent unnecessary file inclusion.
- Created a new media database file for managing media assets.
2025-08-30 19:39:51 +00:00
tigeren dfef34576a refactor: update Dockerfile and deployment documentation
- Modified Dockerfile to rebuild better-sqlite3 using npm as a fallback and ensure native bindings are compiled correctly.
- Updated build command to 'buildprod' for production optimization.
- Removed unnecessary package installations for the production image.
- Enhanced permissions setup for media directories and ensured the database file is created at runtime.
- Revised deployment guide to clarify environment configuration and directory setup for Docker.
2025-08-30 19:00:46 +00:00
tigeren 0c1119be46 feat: add Docker configuration and database initialization
- Introduced a .dockerignore file to exclude unnecessary files from Docker builds.
- Created a Dockerfile for building the Next.js application with optimized production settings.
- Added a docker-compose.yml file for orchestrating services, including NextAV, FFmpeg, and Nginx.
- Refactored database access to use a singleton pattern for better management and initialization of the SQLite database.
- Updated API routes to utilize the new database access method, enhancing consistency across the application.
2025-08-30 17:42:26 +00:00
tigeren 158f9f7a23 feat: add deployment documentation and Docker configuration
- Introduced a comprehensive deployment guide for NextAV, detailing steps for building and pushing Docker images to a private registry.
- Added a new docker-compose.yml file for service orchestration, including configurations for NextAV and Nginx.
- Updated CLAUDE.md with guidelines for creating documentation and managing Docker images.
- Created a PRIVATE_DOCKER_REPO.md file outlining tagging and pushing images to the private Docker repository.
2025-08-30 11:59:56 +00:00
tigeren 854afd4c41 feat: enhance photo viewer navigation and state management
- Implemented next and previous photo navigation in the photo viewer, allowing users to cycle through images while skipping videos.
- Introduced state management for current items in the folder viewer to support navigation functionality.
- Updated the InfiniteVirtualGrid and VirtualizedFolderGrid components to handle item clicks with index support for better user experience.
2025-08-29 17:26:51 +00:00
tigeren fdf8ab2a39 feat: add keyboard shortcuts for video controls and enhance deployment instructions
- Implemented keyboard shortcuts for video playback, including controls for play/pause, seek, fullscreen, and mute.
- Added deployment instructions for using Docker, including the definition of Dockerfile and docker-compose.yml.
2025-08-29 16:43:59 +00:00
tigeren 848578c136 feat: integrate virtualized folder grid for enhanced media browsing experience
- Replaced the existing folder viewer layout with a new VirtualizedFolderGrid component to improve performance and responsiveness.
- Streamlined item fetching logic to eliminate unnecessary state management and enhance loading efficiency.
- Updated UI elements for better navigation, including breadcrumb support and back button functionality.
- Enhanced error handling and loading states to provide clearer feedback during directory access.
2025-08-29 16:08:53 +00:00
tigeren a56492f36a feat: refine path display and layout adjustments for folder and media grids
- Enhanced path display logic to accommodate longer directory names and improved truncation for better clarity.
- Adjusted grid item dimensions and padding for a more consistent and responsive layout across components.
- Updated title formatting and line clamping to enhance readability and prevent overflow in media item displays.
2025-08-29 15:45:44 +00:00
tigeren efd5e70e1f feat: enhance folder viewer and grid layout for improved usability
- Updated path display logic to show full paths or truncated versions based on length, enhancing clarity for users navigating directories.
- Adjusted grid layout and item dimensions for better responsiveness and visual consistency across different screen sizes.
- Improved title formatting and added line clamping to prevent overflow, ensuring a cleaner presentation of media item names.
- Refined star rating component to support additional size options, allowing for better integration with various UI elements.
2025-08-29 15:37:31 +00:00
tigeren 6c289e591d feat: update video viewer layout and enhance video info display
- Simplified the title overlay in the video viewer by removing unnecessary elements for a cleaner look.
- Introduced a new video info bar that displays the video title and size, improving user accessibility to video details.
- Maintained existing bookmark and rating functionalities while enhancing their layout for better usability.
2025-08-29 02:55:10 +00:00
tigeren 44aedcbee6 feat: implement infinite scrolling and replace virtualized media grid
- Replaced the existing VirtualizedMediaGrid component with a new InfiniteVirtualGrid component to support infinite scrolling for bookmarks, photos, and videos.
- Enhanced media item fetching with batch loading and search functionality, improving user experience and performance.
- Removed unused state variables and functions related to photo indexing and file size formatting, streamlining the codebase.
2025-08-28 18:56:59 +00:00
tigeren 6ce4e5a877 feat: enhance scrollbar customization and layout adjustments for media grid
- Updated global CSS to implement custom scrollbar styles, including hover effects and animations.
- Adjusted layout in the media grid component to improve responsiveness and user experience, including dynamic height calculations and loading states.
- Disabled automatic loading of more items, allowing users to manually trigger loading for better control.
2025-08-28 15:52:55 +00:00
tigeren c264fd551d feat: enhance responsive layout for media grid component
- Introduced dynamic column count and width calculations based on container size to improve responsiveness.
- Added container width state management and resize event handling for better adaptability to different screen sizes.
- Updated rendering logic to ensure proper display of media items based on calculated dimensions.
2025-08-28 15:30:57 +00:00
tigeren 6aef5daa74 feat: implement performance optimization plan and pagination for media APIs
- Added a comprehensive performance optimization plan detailing phases for API pagination, frontend memory optimization, file system scanning, database performance, and caching strategies.
- Implemented pagination for bookmarks, photos, and videos APIs, including limit/offset parameters and server-side filtering and sorting.
- Enhanced database queries with indexes for improved performance and added total count for pagination responses.
- Updated frontend components to utilize virtualized lists for better memory management and user experience.
2025-08-28 09:10:38 +00:00
tigeren 2442d0dde7 fix: update media viewer layout and maintain aspect ratio for video thumbnails
- Adjusted the layout of media items in the folder viewer to ensure proper aspect ratio handling for video files.
- Modified thumbnail size settings in the video thumbnail generation function to maintain aspect ratio while specifying a fixed width.
- Updated the media database file to reflect recent changes.
2025-08-27 17:49:02 +00:00
tigeren caa0d1eab9 refactor: improve path handling in folder viewer
- Updated path splitting logic to retain leading slashes for absolute paths while filtering out empty segments.
- Enhanced parent path reconstruction to ensure correct navigation within the folder structure.
- Improved readability and maintainability of the path management code.
2025-08-27 17:16:45 +00:00
tigeren fcf2b19c80 refactor: streamline media scanning process for videos and photos
- Simplified the scanning logic to handle all file types in a single glob pattern, improving efficiency.
- Implemented case-insensitive filtering for video and photo files based on their extensions, enhancing media detection accuracy.
- Refactored code for better readability and maintainability.
2025-08-27 17:12:32 +00:00
tigeren 22e94264ee feat: improve media type detection and scanning functionality
- Enhanced media type detection by normalizing file extensions to handle case variations for videos and photos.
- Updated the scanning process to accommodate different case formats for video and photo file extensions, improving accuracy in file recognition.
- Refactored related code for better readability and maintainability.
2025-08-27 17:03:55 +00:00
tigeren 90fe3c8fb9 feat: enhance folder viewer with library fetching and error handling
- Added functionality to fetch libraries from the API and manage library paths within the folder viewer.
- Implemented error handling for directory loading, displaying user-friendly messages when errors occur.
- Updated breadcrumb navigation to reflect the current library context and improved path management.
- Enhanced UI to show error states and provide a retry option for loading directory contents.
2025-08-27 16:16:28 +00:00
tigeren dab3ec5f84 feat: enhance scanning functionality with library selection
- Updated the scan API to allow scanning of specific libraries or all libraries based on user input.
- Enhanced the SettingsPage component to support selection of multiple libraries for scanning.
- Added visual feedback for scanning progress and status updates for individual libraries.
- Introduced new functions for scanning selected libraries and specific libraries, improving user experience and control over the scanning process.
2025-08-27 15:39:31 +00:00
tigeren 6fe6a43cf0 feat: add average rating and star count to media retrieval and display
- Updated media retrieval query to include average ratings and star counts for media files.
- Enhanced FolderViewer and VideosPage components to display star ratings, improving user feedback on media quality.
- Integrated StarRating component for visual representation of ratings in the UI.
2025-08-27 14:53:30 +00:00
tigeren 6744a2736b feat: enhance folder viewer with breadcrumb navigation and back button
- Implemented breadcrumb navigation for easier path tracking within the folder viewer.
- Added a back button to navigate to the parent directory, improving user experience.
- Introduced a utility function to format file paths for better readability.
- Updated the UI to display formatted file paths and current directory titles.
2025-08-26 19:12:08 +00:00
tigeren 224b898bcd feat: implement bookmarking and unbookmarking functionality for videos
- Added POST and DELETE endpoints for managing bookmarks in the video API.
- Enhanced the VideosPage component to handle bookmarking and unbookmarking actions.
- Updated the InlineVideoPlayer and VideoViewer components to reflect bookmark state and count.
- Improved error handling for invalid media IDs and existing bookmarks.
2025-08-26 18:42:09 +00:00
tigeren 933d12dd14 feat: enhance PhotoViewer with keyboard navigation and ID retrieval
- Implemented keyboard navigation for the PhotoViewer, allowing users to close the viewer with 'Escape' and navigate through photos using 'ArrowLeft' and 'ArrowRight' keys.
- Added a utility function to safely retrieve the photo ID, ensuring it is defined before use in various functionalities like bookmarking and rating.
2025-08-26 18:17:36 +00:00
tigeren 2ac68f9a69 feat: refactor media viewers for improved functionality and UI
- Replaced inline video player with a dedicated VideoViewer component for enhanced video playback experience.
- Updated the PhotosPage and FolderViewerPage to utilize the new PhotoViewer and VideoViewer components, streamlining the media viewing process.
- Removed unnecessary loading states and modal implementations, simplifying the code structure and improving performance.
- Enhanced the PhotoViewer and VideoViewer with bookmarking and rating features for better user interaction.
2025-08-26 18:03:43 +00:00
tigeren 444f6288fe feat: implement photo viewer and enhance media handling
- Added a new SVG placeholder for photos and updated the photos page to utilize it.
- Implemented a photo viewer modal with navigation capabilities, allowing users to view photos in a dedicated interface.
- Enhanced folder viewer to support photo selection and viewing, including loading indicators and improved UI for photo items.
- Updated error handling and content type determination for photo retrieval in the API.
2025-08-26 17:42:52 +00:00
tigeren 0ae51402f6 feat: enhance media retrieval and bookmarks functionality
- Updated the media retrieval query to include bookmark counts and average ratings for photos.
- Refactored the bookmarks page to support both videos and photos, improving state management and UI consistency.
- Added search functionality to the photos page, allowing users to filter photos by title or path.
- Implemented a photo viewer modal for enhanced viewing experience, including navigation and bookmarking features.
2025-08-26 16:18:01 +00:00
tigeren 89bb05d3fc feat: add bookmarks link to sidebar navigation
- Introduced a new "Bookmarks" link in the sidebar for easy access to bookmarked content.
- Integrated the Bookmark icon from lucide-react for visual consistency.
2025-08-26 08:27:05 +00:00
tigeren 2864e30542 feat: add bookmarking and star rating features to video player
- Implemented bookmark functionality allowing users to bookmark/unbookmark videos.
- Added star rating feature enabling users to rate videos from one to five stars.
- Updated database schema to include bookmarks and stars tables, along with necessary indexes for performance.
- Enhanced inline video player UI to display bookmark status and average star rating, improving user interaction and feedback.
2025-08-26 06:56:40 +00:00
tigeren 95a49380da feat: enhance folder viewer with video playback functionality
- Updated the folder viewer to support inline video playback, allowing users to click on video items to open a video player.
- Added state management for video selection and loading indicators.
- Improved UI elements for video items, including hover effects and play icons.
- Enhanced video information display in the inline video player with file size details.
2025-08-26 04:12:59 +00:00
tigeren 6892bfaeae refactor: enhance inline video player layout and styling
- Updated the structure of the inline video player component for improved responsiveness and visual consistency.
- Adjusted CSS classes to better manage layout, including flex properties and spacing.
- Enhanced video info display with improved styling for title and path, ensuring better readability.
2025-08-26 03:47:53 +00:00
tigeren 6c58219ea0 fix: improve delete library response message and add media deletion step 2025-08-26 02:36:36 +00:00
tigeren 6f938243ad feat: add auto-play functionality to inline video player on load 2025-08-26 02:18:18 +00:00
tigeren a752ce964a feat: implement inline video player component for enhanced video playback experience
- Replaced modal video player with an inline video player that renders as a portal.
- Added state management for video playback, volume control, and fullscreen functionality.
- Introduced new component for inline video playback with customizable controls and metadata display.
2025-08-25 17:38:02 +00:00
tigeren 5014434717 feat: enhance thumbnail generation in media scanning process
- Added error handling for thumbnail generation, providing fallback thumbnails for videos and photos if generation fails.
- Updated database insertion logic to reflect the final thumbnail URL used, improving media management reliability.
2025-08-25 16:55:22 +00:00
tigeren 50deee7f2a fix: update Tailwind CSS version to v3 in project documentation and ensure compliance with v3 standards 2025-08-25 16:54:17 +00:00
tigeren 555a71ffc6 feat: enhance UI and functionality for media library management
- Updated video and photo sections in the UI to include detailed card layouts with thumbnails and file information.
- Added interactive features to video cards, allowing users to click and play videos in a pop-up player.
- Improved sidebar navigation and settings page for better user experience.
- Refined global styles and color themes for a cohesive design across the application.
2025-08-25 16:04:03 +00:00