Commit Graph

11 Commits

Author SHA1 Message Date
tigeren d54af0289f feat(streaming): add .ts file HLS streaming and container conversion support
- Implement virtual HLS playlist generation for .ts files as multi-segment streams
- Serve .ts files in virtual 2MB segments with proper byte-range handling
- Enhance existing HLS playlist route to support .ts files as single or multi-segment streams
- Improve segment route to serve .ts segments using stream slicing and abort handling
- Add comprehensive API endpoint for converting .ts files to .mp4 containers
- Implement fast container remuxing using FFmpeg without re-encoding
- Provide analysis of .ts files for conversion suitability based on codec compatibility
- Return detailed error messages and alternatives when HLS streaming unsupported for non-.ts formats
- Update HLS playlist URLs to absolute paths with protocol and host for external access
- Add caching and CORS headers for HLS segments and playlists
- Include thorough logging for debugging HLS segment requests and conversion processes
2025-09-29 19:21:46 +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 8f652fdf08 fix(artplayer-wrapper): allow toggling rating by clicking the same star
- Modify handleStarClick to cancel rating when clicking the current rating again
- Update local average rating based on toggle logic
- Add localAvgRating as dependency to useCallback hook to keep updated state
2025-09-21 11:48:22 +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 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 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