Commit Graph

32 Commits

Author SHA1 Message Date
tigeren 4940cb4542 feat(streaming): disable transcoding and add local player guidance
- Disable video transcoding endpoints with HTTP 410 Gone responses
- Add detailed messages recommending local media players for unsupported formats
- Modify direct stream API to return 415 status with local player usage instructions
- Implement enhanced external streaming API with CORS, range requests, and metadata headers
- Add universal media access API providing multiple streaming URLs and playback recommendations
- Improve MIME type detection and headers for better compatibility with external players
- Remove all transcoding logic and related process management code while preserving references
- Ensure fallback to direct streaming and local player usage instructions on unsupported formats
2025-09-29 17:07:05 +00:00
tigeren b8b46fcf0e feat(stars): add DELETE endpoint and support rating removal
- Implement DELETE /api/stars to remove star ratings by mediaId
- Update media's star count and average rating on deletion
- Modify frontend rating handlers to support unstarring by sending DELETE requests
- Update multiple pages to handle rating removal when rating is zero
- Adjust photo viewer to toggle rating off if same rating clicked
- Improve error handling and success responses for star rating API interactions
2025-09-21 15:06:52 +00:00
tigeren 5fac68e809 feat(api): add GET endpoints for bookmarks and stars by media ID
- Implement GET /api/bookmarks/[id] to check bookmark existence and return bookmark ID
- Implement GET /api/stars/[id] to check star rating existence and return rating value
- Validate media ID as integer and handle invalid ID with 400 status
- Handle server errors with 500 status and error messages

refactor(api): change rating POST request to include mediaId in body

- Update /api/stars POST request to send mediaId and rating in JSON body
- Adjust client fetch call accordingly from /api/stars/[id] to /api/stars

feat(player): integrate bookmark and rating status checks in video player

- Add state and loading indicators for bookmark and rating status in UnifiedVideoPlayer
- Fetch current bookmark and rating status on video open using new GET API endpoints
- Update local bookmark and rating state on user actions for bookmark add/remove and rating update
- Show loading state until both bookmark and rating statuses are fetched

fix(ui): improve bookmark button tooltip and state handling in ArtPlayerWrapper

- Change bookmark button title dynamically based on bookmark state ('Add bookmark' or 'Remove bookmark')
- Remove redundant bookmark count element in button for cleaner UI
2025-09-21 12:25:48 +00:00
tigeren 74980b5059 feat(media): add bookmark feature and rating improvements
- Extend media database query to include bookmark count with LEFT JOINs
- Add bookmark_count property to media file types and UI components
- Implement bookmark add and remove handlers with API calls
- Enhance video player overlay to show bookmark button and rating stars
- Update ArtPlayerWrapper for interactive 5-star rating and bookmark toggling
- Modify folder viewer and virtualized media grid to display bookmark counts
- Simplify video player debug to always use ArtPlayer and show static support info
2025-09-21 07:47:59 +00:00
tigeren 5e45db122e refactor(player): switch to ArtPlayer-only architecture
- Remove fallback to other players in UnifiedVideoPlayer component
- Eliminate legacy InlineVideoPlayer and VideoViewer components
- Update API to always use ArtPlayer as player type and remove alternatives
- Simplify feature detection flags to assume full ArtPlayer support
- Remove ArtPlayer error fallback chain; log errors without switching player
- Rename and adjust styles in ArtPlayerWrapper for consistency
- Refactor VideoPlayerDebug to always report ArtPlayer active
- Adjust diagnostics and logging to indicate ArtPlayer-only mode
- Clean up unused imports and feature flags related to multiple players
2025-09-20 17:57:44 +00:00
tigeren d94fed7e01 feat(player): add autoplay support and prioritize H.264 direct streaming
- Add autoplay prop to ArtPlayerWrapper, UnifiedVideoPlayer, and related components
- Implement autoplay logic with graceful handling of browser restrictions in ArtPlayerWrapper
- Set default autoplay to true in artplayer configuration and expose helper functions to create configs
- Enhance video and stream API to parse codec info with codec and container details
- Implement H.264 codec detection to prioritize direct streaming over transcoding
- Update video-viewer and stream route to override transcoding flag for H.264 codec videos
- Add MIME type to ArtPlayer to select appropriate player type (mpegts, webm, ogg, mp4)
- Extend video format detector to serve MPEG Transport Stream (.ts) files directly without transcoding
- Improve logging with detailed codec, container, and transcoding decision information
2025-09-20 17:00:49 +00:00
tigeren 4e25da484a feat(streaming): integrate hls.js with ArtPlayer and implement fallback chain
- Add hls.js plugin to ArtPlayer wrapper for HLS streaming support
- Implement adaptive bitrate streaming and quality level switching
- Create comprehensive HLS error handling with recovery and fallback
- Detect and handle HLS-compatible formats (.ts, MP4, M4V, TS, M2TS, MTS)
- Support native HLS playback fallback for Safari browsers
- Enhance fallback chain: Native → HLS → Direct → Transcoding streaming
- Update unified video player to handle ArtPlayer errors with fallback logic
- Provide user-friendly error messages and retry options on HLS failure
- Add cleanup for HLS error handlers on component unmount
- Complete Phase 2 of gradual migration tracker with HLS integration and tests
2025-09-18 15:52:39 +00:00
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 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 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 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 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 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 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 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 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 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 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 6c58219ea0 fix: improve delete library response message and add media deletion step 2025-08-26 02:36:36 +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 e248613abb feat: add media library management features, including scanning and displaying photos and videos; implement database integration for media files 2025-08-25 08:11:03 +00:00
tigeren 8676a7d05a refactor: Update DELETE function to use NextRequest and Promise for params; enhance CSS with HSL colors; adjust Tailwind config for dark mode 2025-08-25 06:47:10 +00:00
tigeren 83dea7c651 feat: Implement file system API and folder viewer
- Added API endpoint to retrieve files from a specified directory.
- Created API for managing media libraries (GET, POST, DELETE).
- Implemented scanning functionality for media libraries.
- Developed video listing page with API integration.
- Introduced folder viewer component to navigate file system.
- Enhanced settings page for managing libraries and initiating scans.
- Built sidebar component for navigation with dynamic library links.
- Established UI components for buttons, cards, and inputs.
- Set up SQLite database schema for libraries and media.
- Integrated thumbnail generation for video files during scanning.
- Configured Tailwind CSS for styling and responsive design.
2025-08-25 06:15:49 +00:00