cleanup library
This commit is contained in:
parent
55c477afc2
commit
5a43b4ba99
650
README.md
650
README.md
|
|
@ -1,4 +1,4 @@
|
|||
# 🎮 Gooner Training Academy# 🎮 Gooner Training Academy# 🎮 Gooner Training Academy# Gooner Training Academy
|
||||
# 🎮 Gooner Training Academy
|
||||
|
||||
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
|
||||
|
||||
A comprehensive adult edging training application featuring three specialized game modes, an advanced XP progression system, and professional media library management.*Master Your Dedication Through Advanced Training Systems*
|
||||
A comprehensive adult edging training application featuring three specialized game modes, an advanced XP progression system, and professional media library management.
|
||||
|
||||
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ A comprehensive adult edging training application featuring three specialized ga
|
|||
|
||||
|
||||
|
||||
## 🚀 Quick StartA comprehensive adult edging training application featuring three specialized game modes, an advanced XP progression system, and professional media library management.*Master Your Dedication Through Advanced Training Systems**How long can you last?*
|
||||
## 🚀 Quick Start
|
||||
|
||||
|
||||
|
||||
|
|
@ -70,21 +70,6 @@ The Training Academy offers structured training programs through branching narra
|
|||
|
||||
**Fast-start training with customizable sessions**
|
||||
|
||||
### 🎬 Training Academy
|
||||
|
||||
Quick Play provides immediate access to task-based gameplay with streamlined setup and maximum customization control.
|
||||
|
||||
**Immersive scenario-based training with progressive storylines**
|
||||
|
||||
**Session Setup:**
|
||||
|
||||
**Fast-start training with customizable sessions**
|
||||
|
||||
### 🎬 Training Academy
|
||||
|
||||
Quick Play provides immediate access to task-based gameplay with streamlined setup and maximum customization control.
|
||||
|
||||
**Immersive scenario-based training with progressive storylines**
|
||||
|
||||
**Session Setup:**
|
||||
|
||||
|
|
@ -207,7 +192,7 @@ The Library system provides centralized management for all your media content ac
|
|||
|
||||
|
||||
|
||||
### 📁 Library Organization###
|
||||
### 📁 Library Organization
|
||||
|
||||
- **Video Directories**- Real-time task filtering with persistent settings
|
||||
|
||||
|
|
@ -219,18 +204,14 @@ The Library system provides centralized management for all your media content ac
|
|||
|
||||
- **Cross-Mode Access**: Available in all game modes- Session cleanup and statistics tracking
|
||||
|
||||
|
||||
|
||||
- **Photo Collections**: Webcam integration for photo capture Content Management
|
||||
|
||||
- **Upload System**: High-quality image upload (1600x1200 resolution)
|
||||
|
||||
- **Smart Categorization**: Tasks vs Consequences automatic sorting- Punishment system with consequence images
|
||||
|
||||
- **Gallery Management**: Pinterest-style layout with aspect ratio optimization
|
||||
|
||||
|
||||
Dedicated video player system designed for focused media consumption with comprehensive viewing analytics.**Session Setup:**- **Custom Images**: Upload and categorize adult content (tasks vs consequences)
|
||||
|
||||
|
||||
#### **Advanced Management**
|
||||
|
||||
|
|
@ -238,15 +219,20 @@ Dedicated video player system designed for focused media consumption with compre
|
|||
|
||||
- **Dynamic Themes**: Library theme adapts to your uploaded content
|
||||
|
||||
- **Smart Compression**: Optimized storage without quality loss**Player Features:**- ⏰ Flexible Duration: 15 minutes to 4+ hours- **Video Integration**: Link external video directories for seamless playback
|
||||
- **Smart Compression**: Optimized storage without quality loss
|
||||
|
||||
- **Video Integration**: Link external video directories for seamless playback
|
||||
|
||||
- **Usage Analytics**: Track which content is most accessed
|
||||
|
||||
- 🎬 Professional Video Interface: Full-screen theater mode
|
||||
|
||||
#### **Integration Across Modes**
|
||||
|
||||
- **Quick Play**: Background video selection and task images- 📋 Playlist Management: Organize viewing sessions- 🎬 Background Video Integration: 40+ videos available- **High-Quality Processing**: 1600x1200 resolution with smart compression
|
||||
- **Quick Play**:
|
||||
- Background video selection and task images
|
||||
- 📋 Playlist Management: Organize viewing sessions
|
||||
- 🎬 Background Video Integration: 40+ videos available
|
||||
- **High-Quality Processing**: 1600x1200 resolution with smart compression
|
||||
|
||||
- **Training Academy**: Scenario content and photo sessions
|
||||
|
||||
|
|
@ -254,7 +240,8 @@ Dedicated video player system designed for focused media consumption with compre
|
|||
|
||||
- **Punishment System**: Consequence image selection
|
||||
|
||||
- 🔄 Multi-Screen Mode: 4-video grid for intensive sessions- 🎛️ Individual Task Controls: Enable/disable specific tasks- **Storage Management**: 50 image limit with usage monitoring
|
||||
- 🔄 Multi-Screen Mode: 4-video grid for intensive sessions- 🎛️ Individual Task Controls: Enable/disable specific tasks
|
||||
|
||||
|
||||
### 📊 Library Analytics
|
||||
|
||||
|
|
@ -262,23 +249,14 @@ Dedicated video player system designed for focused media consumption with compre
|
|||
|
||||
- **💾 Storage Monitoring**: Space usage and optimization suggestions
|
||||
|
||||
- **🔄 Sync Status**: Real-time directory scanning results- 🎯 Custom Task Creation: Add personalized challenges- **Bulk Operations**: Select, enable/disable, and delete multiple images
|
||||
- **🔄 Sync Status**: Real-time directory scanning results
|
||||
|
||||
- **📋 Content Health**: Missing files and broken links detection
|
||||
|
||||
**XP Rewards:**
|
||||
|
||||
---
|
||||
|
||||
- ⏱️ Viewing Time: **1 XP per 5 minutes** of active viewing
|
||||
|
||||
## 🎛️ Key Features
|
||||
|
||||
- ✅ Video Completion: **Bonus XP** for 90%+ completion
|
||||
|
||||
### 🔒 Data Protection
|
||||
|
||||
- **Automatic Backups**: Every 30 minutes during active sessions- 📊 Binge Sessions: **Additional rewards** for extended viewing**XP Rewards:**## <20> Quick Start
|
||||
- **Automatic Backups**: Every 30 minutes during active sessions
|
||||
|
||||
- **Manual Backup/Restore**: Full control over your data
|
||||
|
||||
|
|
@ -310,39 +288,32 @@ Dedicated video player system designed for focused media consumption with compre
|
|||
|
||||
- **Professional UI**: Responsive, modern design
|
||||
|
||||
npm install
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Controls & Navigation
|
||||
|
||||
**Features:**npm start
|
||||
|
||||
| Control | Action | Mode Availability |
|
||||
|
||||
|---------|--------|-------------------|## ⭐ XP System Explained
|
||||
|---------|--------|-------------------|
|
||||
|
||||
| **Enter** | Complete current task | All modes |
|
||||
|
||||
| **Ctrl** | Skip task (triggers punishment) | Training, Quick Play |- Real-time task filtering with persistent settings```
|
||||
| **Ctrl** | Skip task (triggers punishment) | Training, Quick Play |
|
||||
|
||||
| **Space/P** | Pause/Resume session | All modes |
|
||||
|
||||
| **M** | Toggle background music | All modes |### 📈 Experience Points (XP) Overview
|
||||
| **M** | Toggle background music | All modes |
|
||||
|
||||
| **H** | Show help menu | All modes |
|
||||
|
||||
| **Escape** | Close dialogs/return to menu | All modes |The XP system tracks your dedication and progress across all training modes, providing a unified progression metric.- Background video with floating opacity controls
|
||||
|
||||
| **Escape** | Close dialogs/return to menu | All modes |
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## 🛠️ Technical Architecture### 🎯 XP Sources by Mode- Session cleanup and statistics tracking### Web Browser
|
||||
## 🛠️ Technical Architecture
|
||||
|
||||
|
||||
|
||||
|
|
@ -390,39 +361,37 @@ webGame/| Mode | Activity | XP Reward | Notes |- Webcam integration for photo ca
|
|||
|
||||
└── videos/ # Linked video directories
|
||||
|
||||
```### 🎭 Porn Cinema## 🎯 Key Controls
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 🔧 Development Requirements### 📊 Progression Levels
|
||||
### 📊 Progression Levels
|
||||
|
||||
- **Node.js 16+**: For Electron desktop application
|
||||
|
||||
- **Modern Browser**: Chrome 90+, Firefox 88+, Safari 14+- **🌱 Beginner (0-100 XP)**: Learning the basics**Professional video viewing experience**
|
||||
- **Modern Browser**: Chrome 90+, Firefox 88+, Safari 14+
|
||||
|
||||
- **Desktop Features**: File system access for media linking
|
||||
|
||||
- **Storage**: Minimum 100MB for application and user content- **📈 Intermediate (100-500 XP)**: Building consistency
|
||||
- **Storage**: Minimum 100MB for application and user content
|
||||
|
||||
|
||||
|
||||
---- **🎯 Advanced (500-1500 XP)**: Mastering techniques- **Enter** - Complete task
|
||||
|
||||
|
||||
|
||||
## 📋 Recent Major Updates- **🏆 Expert (1500+ XP)**: Peak dedication
|
||||
## 📋 Recent Major Updates
|
||||
|
||||
|
||||
|
||||
### v4.0 - Comprehensive Backup System (November 12, 2025)Dedicated video player system designed for focused media consumption with comprehensive viewing analytics.- **Ctrl** - Skip task (triggers punishment)
|
||||
### v4.0 - Comprehensive Backup System (November 12, 2025)
|
||||
|
||||
- ✅ **Automatic Data Protection**: 30-minute backup intervals
|
||||
|
||||
- ✅ **Manual Backup Controls**: User-initiated backup/restore### 🔍 XP Tracking
|
||||
- ✅ **Manual Backup Controls**: User-initiated backup/restore
|
||||
|
||||
- ✅ **Export/Import System**: Portable data management
|
||||
|
||||
- ✅ **Emergency Backup Hooks**: Before reset operations- **Real-time Display**: Live XP counter in all game modes- **Space/P** - Pause/resume
|
||||
- ✅ **Emergency Backup Hooks**: Before reset operations
|
||||
|
||||
- ✅ **Data Loss Recovery**: Complete incident prevention system
|
||||
|
||||
|
|
@ -467,562 +436,3 @@ The Library system provides centralized management for all your media content ac
|
|||
---
|
||||
|
||||
|
||||
|
||||
## 🎓 Getting Started Guide
|
||||
|
||||
### 📁 Library Organization- 🎛️ Advanced Controls: Speed, volume, seeking, and more
|
||||
|
||||
### 1. **First Launch**
|
||||
|
||||
- Run the application via desktop app or open `index.html`
|
||||
|
||||
- Complete the initial setup and library configuration
|
||||
|
||||
- Link your video directories for enhanced experience#### **Video Directories**### Requirements
|
||||
|
||||
|
||||
|
||||
### 2. **Library Setup**- **Automatic Discovery**: Scans linked directories for video files
|
||||
|
||||
- Upload task and consequence images via Image Management
|
||||
|
||||
- Link video directories for background content- **Format Support**: MP4, WebM, MOV, AVI, and more**XP Rewards:**- Modern web browser with webcam support
|
||||
|
||||
- Organize content for optimal gameplay experience
|
||||
|
||||
- **Smart Indexing**: Automatic categorization and metadata
|
||||
|
||||
### 3. **Choose Your Path**
|
||||
|
||||
- **New to Training**: Start with **Quick Play** for immediate access- **Cross-Mode Access**: Available in all game modes- ⏱️ Viewing Time: **1 XP per 5 minutes** of active viewing- Local storage for saves and images
|
||||
|
||||
- **Structured Learning**: Begin with **Training Academy** scenarios
|
||||
|
||||
- **Media Focus**: Explore **Porn Cinema** for dedicated viewing
|
||||
|
||||
|
||||
|
||||
### 4. **Progress Tracking**#### **Photo Collections**- ✅ Video Completion: **Bonus XP** for 90%+ completion- 50MB+ available storage for custom content
|
||||
|
||||
- Monitor XP growth across all modes
|
||||
|
||||
- Check statistics dashboard for detailed analytics- **Upload System**: High-quality image upload (1600x1200 resolution)
|
||||
|
||||
- Use player profile to track achievements and milestones
|
||||
|
||||
- **Smart Categorization**: Tasks vs Consequences automatic sorting- 📊 Binge Sessions: **Additional rewards** for extended viewing
|
||||
|
||||
---
|
||||
|
||||
- **Gallery Management**: Pinterest-style layout with aspect ratio optimization
|
||||
|
||||
## 📄 License
|
||||
|
||||
- **Storage Limits**: 50 image maximum with usage monitoring### File Structure
|
||||
|
||||
This project is licensed under the MIT License - see the LICENSE file for details.
|
||||
|
||||
|
||||
|
||||
**Note**: This is adult content software intended for personal use by consenting adults. Please use responsibly and in accordance with local laws and regulations.
|
||||
### 🔧 Library Features**Features:**```
|
||||
|
||||
|
||||
|
||||
#### **Media Linking**- Seamless integration with linked video directorieswebGame/
|
||||
|
||||
```
|
||||
|
||||
📁 Linked Directories:- Watch time and completion analytics├── index.html # Main interface
|
||||
|
||||
├── /videos/mainstream/ # General video content
|
||||
|
||||
├── /videos/specialized/ # Category-specific content - Favorite video tracking├── porn-cinema.html # Professional video player
|
||||
|
||||
├── /images/tasks/ # Task-related images
|
||||
|
||||
└── /images/consequences/ # Punishment images- Theater mode for distraction-free viewing├── player-stats.html # Statistics dashboard
|
||||
|
||||
```
|
||||
|
||||
- Multi-format video support├── user-profile.html # User profile and achievements
|
||||
|
||||
#### **Advanced Management**
|
||||
|
||||
- **Bulk Operations**: Select, enable/disable, delete multiple files├── src/
|
||||
|
||||
- **Dynamic Themes**: Library theme adapts to your uploaded content
|
||||
|
||||
- **Smart Compression**: Optimized storage without quality loss---│ ├── core/ # Game engine and mode management
|
||||
|
||||
- **Usage Analytics**: Track which content is most accessed
|
||||
|
||||
│ ├── data/modes/ # Game mode data files
|
||||
|
||||
#### **Integration Across Modes**
|
||||
|
||||
- **Quick Play**: Background video selection and task images## ⭐ XP System Explained│ ├── features/
|
||||
|
||||
- **Training Academy**: Scenario content and photo sessions
|
||||
|
||||
- **Porn Cinema**: Full video library access with playlists│ │ ├── media/ # Video players and cinema system
|
||||
|
||||
- **Punishment System**: Consequence image selection
|
||||
|
||||
### 📈 Experience Points (XP) Overview│ │ ├── stats/ # Player statistics tracking
|
||||
|
||||
### 📊 Library Analytics
|
||||
|
||||
- **📈 Content Usage**: Most viewed/used media trackingThe XP system tracks your dedication and progress across all training modes, providing a unified progression metric.│ │ ├── tasks/ # Interactive task management
|
||||
|
||||
- **💾 Storage Monitoring**: Space usage and optimization suggestions
|
||||
|
||||
- **🔄 Sync Status**: Real-time directory scanning results│ │ └── ... # Audio, webcam, UI features
|
||||
|
||||
- **📋 Content Health**: Missing files and broken links detection
|
||||
|
||||
### 🎯 XP Sources by Mode│ └── styles/ # CSS and themes
|
||||
|
||||
---
|
||||
|
||||
├── images/ # Image storage
|
||||
|
||||
## 🎛️ Key Features
|
||||
|
||||
| Mode | Activity | XP Reward | Notes |├── audio/ # Background music
|
||||
|
||||
### 🔒 Data Protection
|
||||
|
||||
- **Automatic Backups**: Every 30 minutes during active sessions|------|----------|-----------|-------|├── videos/ # Video file organization
|
||||
|
||||
- **Manual Backup/Restore**: Full control over your data
|
||||
|
||||
- **Export/Import**: Portable data management| **Training Academy** | Time Training | 1 XP / 2 minutes | Passive time-based reward |└── package.json # Electron app config
|
||||
|
||||
- **Emergency Backups**: Before any reset operations
|
||||
|
||||
| | Webcam Activity | 1 XP / minute | Active engagement bonus |```
|
||||
|
||||
### 🎨 Customization
|
||||
|
||||
- **6 Visual Themes**: Including dynamic Library theme| | Photo Session | 2 XP / photo | Achievement-based reward |
|
||||
|
||||
- **Task Disable Toggles**: Individual control in Quick Play
|
||||
|
||||
- **Adaptive Difficulty**: Progressive timer scaling| **Quick Play** | Task Completion | 1-3 XP | Speed-based scaling |### Features
|
||||
|
||||
- **Personal Content**: Upload and organize your media
|
||||
|
||||
| | Session Bonus | 2 XP / 15 min | Consistency reward |- **Cross-Platform**: Windows, Mac, Linux via Electron
|
||||
|
||||
### 🖥️ Technical Excellence
|
||||
|
||||
- **Cross-Platform**: Windows, Mac, Linux support| | Recording Bonus | +1 XP | Additional engagement |- **Responsive Design**: Works on desktop and mobile
|
||||
|
||||
- **Electron Desktop App**: Native OS integration
|
||||
|
||||
- **Web Browser Compatible**: No installation required| **Porn Cinema** | Video Viewing | 1 XP / 5 minutes | Engagement tracking |- **Local Storage**: All data stays on your device
|
||||
|
||||
- **Professional UI**: Responsive, modern design
|
||||
|
||||
| | Video Completion | Bonus XP | 90%+ completion required |- **Privacy-First**: No data sent to servers
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## 🎯 Controls & Navigation
|
||||
|
||||
### 📊 Progression Levels## 📋 Recent Updates
|
||||
|
||||
| Control | Action | Mode Availability |
|
||||
|
||||
|---------|--------|-------------------|- **🌱 Beginner (0-100 XP)**: Learning the basics
|
||||
|
||||
| **Enter** | Complete current task | All modes |
|
||||
|
||||
| **Ctrl** | Skip task (triggers punishment) | Training, Quick Play |- **📈 Intermediate (100-500 XP)**: Building consistency ### v3.3 - Media Library Consolidation & Theme System (November 11, 2025)
|
||||
|
||||
| **Space/P** | Pause/Resume session | All modes |
|
||||
|
||||
| **M** | Toggle background music | All modes |- **🎯 Advanced (500-1500 XP)**: Mastering techniques- ✅ **Complete Media Library Cleanup**: 3-phase consolidation removing 500+ lines of duplicate code
|
||||
|
||||
| **H** | Show help menu | All modes |
|
||||
|
||||
| **Escape** | Close dialogs/return to menu | All modes |- **🏆 Expert (1500+ XP)**: Peak dedication - Phase 1: Unified video gallery system (lib-video-gallery)
|
||||
|
||||
|
||||
|
||||
--- - Phase 2: Consolidated image management (lib-image-gallery)
|
||||
|
||||
|
||||
|
||||
## 🛠️ Technical Architecture### 🔍 XP Tracking - Phase 3: Streamlined audio system (lib-audio-gallery)
|
||||
|
||||
|
||||
|
||||
### 📂 Core Structure- **Real-time Display**: Live XP counter in all game modes- ✅ **Advanced Theme System**: 6 visual themes (hentai, pornstars, BBC, feet, library, none)
|
||||
|
||||
```
|
||||
|
||||
webGame/- **Session Summaries**: XP earned per session with breakdowns- ✅ **Dynamic Library Theme**: Pinterest-style layout using user's personal image collection
|
||||
|
||||
├── index.html # Main hub and library management
|
||||
|
||||
├── quick-play.html # Quick Play game mode- **Statistics Dashboard**: Comprehensive XP analytics- ✅ **Smart Image Layout**: Dynamic container sizing based on aspect ratios with gap-free stacking
|
||||
|
||||
├── training-academy.html # Training Academy mode
|
||||
|
||||
├── porn-cinema.html # Video player system- **Progress Visualization**: Charts and progression metrics- ✅ **Enhanced File Handling**: Proper URI encoding for special characters in file paths
|
||||
|
||||
├── player-stats.html # Statistics dashboard
|
||||
|
||||
├── user-profile.html # Profile and achievements
|
||||
|
||||
├── src/
|
||||
|
||||
│ ├── core/ # Game engine and state management---### v3.2 - Task Management & Session Cleanup (November 6, 2025)
|
||||
|
||||
│ ├── data/modes/ # Game mode configurations
|
||||
|
||||
│ ├── features/ # Modular feature systems- ✅ **Task Disable Toggles**: Individual task control with persistent localStorage settings
|
||||
|
||||
│ │ ├── media/ # Video players and media management
|
||||
|
||||
│ │ ├── stats/ # XP and statistics tracking## 📚 Library System Explained- ✅ **Consequence System Integration**: Disabled tasks filtered from consequence selection
|
||||
|
||||
│ │ ├── tasks/ # Interactive task system
|
||||
|
||||
│ │ └── ui/ # User interface components- ✅ **ID Consistency**: Fixed task ID generation to handle both numeric and generated IDs
|
||||
|
||||
│ ├── styles/ # CSS themes and styling
|
||||
|
||||
│ └── utils/ # Utility functions and helpers### 🎬 Video Library Management- ✅ **Session Cleanup**: Comprehensive endGame cleanup stopping videos and periodic popups
|
||||
|
||||
├── images/ # User-uploaded image library
|
||||
|
||||
├── audio/ # Background music collectionThe Library system provides centralized management for all your media content across game modes.- ✅ **Debug System**: Extensive console logging for task state tracking and troubleshooting
|
||||
|
||||
└── videos/ # Linked video directories
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 🔧 Development Requirements### 📁 Library Organization### v3.1 - Quick Play Background Video System (November 3, 2025)
|
||||
|
||||
- **Node.js 16+**: For Electron desktop application
|
||||
|
||||
- **Modern Browser**: Chrome 90+, Firefox 88+, Safari 14+- ✅ **Quick Play Mode**: New fast-start game mode with streamlined interface
|
||||
|
||||
- **Desktop Features**: File system access for media linking
|
||||
|
||||
- **Storage**: Minimum 100MB for application and user content#### **Video Directories**- ✅ **Background Video Integration**: Independent video system with 46+ videos detected
|
||||
|
||||
|
||||
|
||||
---- **Automatic Discovery**: Scans linked directories for video files- ✅ **Compact Video Controls**: Floating controls with opacity cycling (hidden/dim/normal/bright)
|
||||
|
||||
|
||||
|
||||
## 📋 Recent Major Updates- **Format Support**: MP4, WebM, MOV, AVI, and more- ✅ **Video Visibility Toggle**: Quick on/off button with eye icon for instant control
|
||||
|
||||
|
||||
|
||||
### v4.0 - Comprehensive Backup System (November 12, 2025)- **Smart Indexing**: Automatic categorization and metadata- ✅ **Independent Game Logic**: Isolated Quick Play mode preventing main game interference
|
||||
|
||||
- ✅ **Automatic Data Protection**: 30-minute backup intervals
|
||||
|
||||
- ✅ **Manual Backup Controls**: User-initiated backup/restore- **Cross-Mode Access**: Available in all game modes- ✅ **Real Task Integration**: Full integration with 17 mainGameData tasks and 60 task images
|
||||
|
||||
- ✅ **Export/Import System**: Portable data management
|
||||
|
||||
- ✅ **Emergency Backup Hooks**: Before reset operations- ✅ **VideoLibrary Scanning**: Custom video detection system using existing linked directories
|
||||
|
||||
- ✅ **Data Loss Recovery**: Complete incident prevention system
|
||||
|
||||
#### **Photo Collections**- ✅ **Enhanced Timer System**: Fixed countdown functionality with proper Quick Play isolation
|
||||
|
||||
### v3.3 - Media Library Consolidation (November 11, 2025)
|
||||
|
||||
- ✅ **Unified Gallery System**: Single media management interface- **Upload System**: High-quality image upload (1600x1200 resolution)
|
||||
|
||||
- ✅ **Dynamic Library Theme**: User content-based theming
|
||||
|
||||
- ✅ **Pinterest Layout**: Aspect ratio-optimized image display- **Smart Categorization**: Tasks vs Consequences automatic sorting### v3.0 - Professional Media System (October 31, 2025)
|
||||
|
||||
- ✅ **Advanced Organization**: Smart categorization and bulk operations
|
||||
|
||||
- **Gallery Management**: Pinterest-style layout with aspect ratio optimization- ✅ **Complete Porn Cinema**: Professional video player with playlists, progress bars, and theater mode
|
||||
|
||||
### v3.2 - Quick Play Enhancement (November 6, 2025)
|
||||
|
||||
- ✅ **Task Disable Toggles**: Individual task control system- **Storage Limits**: 50 image maximum with usage monitoring- ✅ **Multi-Screen Quad Player**: 4-video grid layout for intensive training with minimize/restore functionality
|
||||
|
||||
- ✅ **Persistent Settings**: Configuration memory across sessions
|
||||
|
||||
- ✅ **Real-time Filtering**: Dynamic task exclusion- ✅ **BaseVideoPlayer Architecture**: Reusable video components across all game modes
|
||||
|
||||
- ✅ **Enhanced Debugging**: Comprehensive logging system
|
||||
|
||||
### 🔧 Library Features- ✅ **Video Library Integration**: Seamless access to external video directories
|
||||
|
||||
### v3.1 - Background Video Integration (November 3, 2025)
|
||||
|
||||
- ✅ **Seamless Video Playback**: Background videos during gameplay- ✅ **Player Statistics & Profiles**: Watch time tracking, achievements, and user progression
|
||||
|
||||
- ✅ **Opacity Controls**: Floating video control system
|
||||
|
||||
- ✅ **40+ Video Integration**: Comprehensive video library access#### **Media Linking**- ✅ **Focus Video Interruptions**: Video overlays during training scenarios
|
||||
|
||||
- ✅ **Multi-Mode Support**: Video features across all game modes
|
||||
|
||||
```- ✅ **Enhanced Training Integration**: Multi-screen mode button in interactive tasks
|
||||
|
||||
---
|
||||
|
||||
📁 Linked Directories:
|
||||
|
||||
## 🎓 Getting Started Guide
|
||||
|
||||
├── /videos/mainstream/ # General video content### v2.0 - Major Content Update
|
||||
|
||||
### 1. **First Launch**
|
||||
|
||||
- Run the application via desktop app or open `index.html`├── /videos/specialized/ # Category-specific content - ✅ Added 7 specialized game modes with rich content
|
||||
|
||||
- Complete the initial setup and library configuration
|
||||
|
||||
- Link your video directories for enhanced experience├── /images/tasks/ # Task-related images- ✅ Implemented progressive endurance training system
|
||||
|
||||
|
||||
|
||||
### 2. **Library Setup**└── /images/consequences/ # Punishment images- ✅ Enhanced interactive task management
|
||||
|
||||
- Upload task and consequence images via Image Management
|
||||
|
||||
- Link video directories for background content```- ✅ Webcam integration for mirror and photography tasks
|
||||
|
||||
- Organize content for optimal gameplay experience
|
||||
|
||||
- ✅ Modular data system for better organization
|
||||
|
||||
### 3. **Choose Your Path**
|
||||
|
||||
- **New to Training**: Start with **Quick Play** for immediate access#### **Advanced Management**- ✅ Removed deprecated scenario mode
|
||||
|
||||
- **Structured Learning**: Begin with **Training Academy** scenarios
|
||||
|
||||
- **Media Focus**: Explore **Porn Cinema** for dedicated viewing- **Bulk Operations**: Select, enable/disable, delete multiple files
|
||||
|
||||
|
||||
|
||||
### 4. **Progress Tracking**- **Dynamic Themes**: Library theme adapts to your uploaded content### v1.4 - Enhanced Image System
|
||||
|
||||
- Monitor XP growth across all modes
|
||||
|
||||
- Check statistics dashboard for detailed analytics- **Smart Compression**: Optimized storage without quality loss- ✅ Categorized image management (tasks vs consequences)
|
||||
|
||||
- Use player profile to track achievements and milestones
|
||||
|
||||
- **Usage Analytics**: Track which content is most accessed- ✅ High-quality compression and processing
|
||||
|
||||
---
|
||||
|
||||
- ✅ Storage quota management
|
||||
|
||||
## 📄 License
|
||||
|
||||
#### **Integration Across Modes**- ✅ Bulk operations and selection
|
||||
|
||||
This project is licensed under the MIT License - see the LICENSE file for details.
|
||||
|
||||
- **Quick Play**: Background video selection and task images
|
||||
|
||||
**Note**: This is adult content software intended for personal use by consenting adults. Please use responsibly and in accordance with local laws and regulations.
|
||||
- **Training Academy**: Scenario content and photo sessions## License
|
||||
|
||||
- **Porn Cinema**: Full video library access with playlists
|
||||
|
||||
- **Punishment System**: Consequence image selection[Add your preferred license here]
|
||||
|
||||
### 📊 Library Analytics
|
||||
- **📈 Content Usage**: Most viewed/used media tracking
|
||||
- **💾 Storage Monitoring**: Space usage and optimization suggestions
|
||||
- **🔄 Sync Status**: Real-time directory scanning results
|
||||
- **📋 Content Health**: Missing files and broken links detection
|
||||
|
||||
---
|
||||
|
||||
## 🎛️ Key Features
|
||||
|
||||
### 🔒 Data Protection
|
||||
- **Automatic Backups**: Every 30 minutes during active sessions
|
||||
- **Manual Backup/Restore**: Full control over your data
|
||||
- **Export/Import**: Portable data management
|
||||
- **Emergency Backups**: Before any reset operations
|
||||
|
||||
### 🎨 Customization
|
||||
- **6 Visual Themes**: Including dynamic Library theme
|
||||
- **Task Disable Toggles**: Individual control in Quick Play
|
||||
- **Adaptive Difficulty**: Progressive timer scaling
|
||||
- **Personal Content**: Upload and organize your media
|
||||
|
||||
### 🖥️ Technical Excellence
|
||||
- **Cross-Platform**: Windows, Mac, Linux support
|
||||
- **Electron Desktop App**: Native OS integration
|
||||
- **Web Browser Compatible**: No installation required
|
||||
- **Professional UI**: Responsive, modern design
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Controls & Navigation
|
||||
|
||||
| Control | Action | Mode Availability |
|
||||
|---------|--------|-------------------|
|
||||
| **Enter** | Complete current task | All modes |
|
||||
| **Ctrl** | Skip task (triggers punishment) | Training, Quick Play |
|
||||
| **Space/P** | Pause/Resume session | All modes |
|
||||
| **M** | Toggle background music | All modes |
|
||||
| **H** | Show help menu | All modes |
|
||||
| **Escape** | Close dialogs/return to menu | All modes |
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Technical Architecture
|
||||
|
||||
### 📂 Core Structure
|
||||
```
|
||||
webGame/
|
||||
├── index.html # Main hub and library management
|
||||
├── quick-play.html # Quick Play game mode
|
||||
├── training-academy.html # Training Academy mode
|
||||
├── porn-cinema.html # Video player system
|
||||
├── hypno-gallery.html # Immersive slideshow system
|
||||
├── player-stats.html # Statistics dashboard
|
||||
├── user-profile.html # Profile and achievements
|
||||
├── scripts/ # Installation and launch scripts
|
||||
│ ├── setup.bat # Windows installer
|
||||
│ ├── setup.sh # Mac/Linux installer
|
||||
│ ├── Start-webgame.bat # Windows launcher
|
||||
│ └── create-distribution.* # Distribution builders
|
||||
├── docs/ # Documentation and guides
|
||||
│ ├── HYPNO-GALLERY-README.md # Hypno Gallery documentation
|
||||
│ ├── INSTALLATION_GUIDE.md # Setup instructions
|
||||
│ ├── TESTER_GUIDE.md # Testing instructions
|
||||
│ ├── ROADMAP.md # Development roadmap
|
||||
│ └── archive/ # Archived documentation
|
||||
├── src/
|
||||
│ ├── core/ # Game engine and state management
|
||||
│ ├── data/modes/ # Game mode configurations
|
||||
│ ├── features/ # Modular feature systems
|
||||
│ │ ├── media/ # Video players and media management
|
||||
│ │ ├── stats/ # XP and statistics tracking
|
||||
│ │ ├── tasks/ # Interactive task system
|
||||
│ │ └── ui/ # User interface components
|
||||
│ ├── styles/ # CSS themes and styling
|
||||
│ └── utils/ # Utility functions and helpers
|
||||
├── images/ # User-uploaded image library
|
||||
├── audio/ # Background music collection
|
||||
└── videos/ # Linked video directories
|
||||
```
|
||||
|
||||
### 🔧 Development Requirements
|
||||
- **Node.js 16+**: For Electron desktop application
|
||||
- **Modern Browser**: Chrome 90+, Firefox 88+, Safari 14+
|
||||
- **Desktop Features**: File system access for media linking
|
||||
- **Storage**: Minimum 100MB for application and user content
|
||||
|
||||
---
|
||||
|
||||
## 📋 Recent Major Updates
|
||||
|
||||
### v4.1 - Critical Stability & Performance Update (November 26, 2025)
|
||||
- ✅ **Quick Play Session Cleanup**: Complete timer and video cleanup on end session
|
||||
- Fixed timers continuing after end session (taskTimer, gameTimerInterval, xpDisplayInterval, recordingTimerInterval)
|
||||
- Enhanced video stopping with comprehensive cleanup (pause, mute, reset, clear source)
|
||||
- Added debug logging to track timer IDs and video element cleanup
|
||||
- ✅ **Function Spam Prevention**: Added game state guards to prevent functions running after session ends
|
||||
- Guards in syncTaskWithOverlay(), updateRecordingOverlay(), updateTimerDisplay()
|
||||
- Checks `!isGameRunning || window.isEndingGame` before execution
|
||||
- Eliminated console spam and unnecessary processing
|
||||
- ✅ **Porn Cinema Memory Leak Fix**: CRITICAL fix preventing crashes from event listener accumulation
|
||||
- Changed from individual button listeners to event delegation pattern
|
||||
- Single parent listener handles all playlist button clicks via event bubbling
|
||||
- Prevents exponential memory growth during extended sessions
|
||||
- ✅ **Porn Cinema Error Handling**: User-friendly error recovery system
|
||||
- Try-catch wrapper for initialization with styled error overlay
|
||||
- Retry and home buttons for crash recovery
|
||||
- Null checks for missing DOM elements (theater mode buttons)
|
||||
- ✅ **Porn Cinema Cleanup System**: Comprehensive destroy() method for proper resource cleanup
|
||||
- Removes event listeners, stops and unloads videos, clears playlist data
|
||||
- Window close handlers (beforeunload, pagehide) trigger automatic cleanup
|
||||
- Prevents memory leaks when closing porn cinema window
|
||||
- ✅ **Enhanced Theme System**: 6 visual themes with dynamic Library theme option
|
||||
- Static themes: Hentai, Pornstars, BBC, Feet
|
||||
- Dynamic Library theme: Pinterest-style layout using user's personal image collection
|
||||
- Theme customization via dropdown in Options menu
|
||||
- None option to disable all background images
|
||||
- ✅ **Desktop Photo Storage**: Webcam photos now saved to file system in desktop app
|
||||
- Photos saved to `photos/captured/` directory
|
||||
- Organized by session type (training-academy, dress-up, etc.)
|
||||
- File-based storage instead of localStorage for better performance
|
||||
- Automatic fallback to data URLs in browser mode
|
||||
- Photo gallery access with download and management options
|
||||
|
||||
### v4.0 - Comprehensive Backup System (November 12, 2025)
|
||||
- ✅ **Automatic Data Protection**: 30-minute backup intervals
|
||||
- ✅ **Manual Backup Controls**: User-initiated backup/restore
|
||||
- ✅ **Export/Import System**: Portable data management
|
||||
- ✅ **Emergency Backup Hooks**: Before reset operations
|
||||
- ✅ **Data Loss Recovery**: Complete incident prevention system
|
||||
|
||||
### v3.3 - Media Library Consolidation (November 11, 2025)
|
||||
- ✅ **Unified Gallery System**: Single media management interface
|
||||
- ✅ **Dynamic Library Theme**: User content-based theming
|
||||
- ✅ **Pinterest Layout**: Aspect ratio-optimized image display
|
||||
- ✅ **Advanced Organization**: Smart categorization and bulk operations
|
||||
|
||||
### v3.2 - Quick Play Enhancement (November 6, 2025)
|
||||
- ✅ **Task Disable Toggles**: Individual task control system
|
||||
- ✅ **Persistent Settings**: Configuration memory across sessions
|
||||
- ✅ **Real-time Filtering**: Dynamic task exclusion
|
||||
- ✅ **Enhanced Debugging**: Comprehensive logging system
|
||||
|
||||
### v3.1 - Background Video Integration (November 3, 2025)
|
||||
- ✅ **Seamless Video Playback**: Background videos during gameplay
|
||||
- ✅ **Opacity Controls**: Floating video control system
|
||||
- ✅ **40+ Video Integration**: Comprehensive video library access
|
||||
- ✅ **Multi-Mode Support**: Video features across all game modes
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Getting Started Guide
|
||||
|
||||
### 1. **First Launch**
|
||||
- Run the application via desktop app or open `index.html`
|
||||
- Complete the initial setup and library configuration
|
||||
- Link your video directories for enhanced experience
|
||||
|
||||
### 2. **Library Setup**
|
||||
- Upload task and consequence images via Image Management
|
||||
- Link video directories for background content
|
||||
- Organize content for optimal gameplay experience
|
||||
|
||||
### 3. **Choose Your Path**
|
||||
- **New to Training**: Start with **Quick Play** for immediate access
|
||||
- **Structured Learning**: Begin with **Training Academy** scenarios
|
||||
- **Media Focus**: Explore **Porn Cinema** for dedicated viewing
|
||||
|
||||
### 4. **Progress Tracking**
|
||||
- Monitor XP growth across all modes
|
||||
- Check statistics dashboard for detailed analytics
|
||||
- Use player profile to track achievements and milestones
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the MIT License - see the LICENSE file for details.
|
||||
|
||||
**Note**: This is adult content software intended for personal use by consenting adults. Please use responsibly and in accordance with local laws and regulations.
|
||||
12
index.html
12
index.html
|
|
@ -3669,8 +3669,18 @@
|
|||
// Initialize desktop file manager if in Electron environment
|
||||
if (window.electronAPI && typeof DesktopFileManager !== 'undefined') {
|
||||
window.desktopFileManager = new DesktopFileManager(window.game?.dataManager);
|
||||
console.log('? Desktop File Manager initialized for video management');
|
||||
console.log('📁 Desktop File Manager initialized for video management');
|
||||
|
||||
// Clean up legacy localStorage video directories
|
||||
const legacyDirs = localStorage.getItem('linkedVideoDirectories');
|
||||
const legacyIndividual = localStorage.getItem('linkedIndividualVideos');
|
||||
if (legacyDirs || legacyIndividual) {
|
||||
console.log('🧹 Cleaning up legacy localStorage video directories...');
|
||||
localStorage.removeItem('linkedVideoDirectories');
|
||||
localStorage.removeItem('linkedIndividualVideos');
|
||||
console.log('✅ Legacy video directory storage cleared');
|
||||
}
|
||||
|
||||
// Initialize the new unified video system
|
||||
setTimeout(() => {
|
||||
updateDirectoryList();
|
||||
|
|
|
|||
12
library.html
12
library.html
|
|
@ -773,6 +773,8 @@
|
|||
<div id="library-audio-content" class="library-content">
|
||||
<div class="content-section">
|
||||
<h3>🎵 Audio Library Management</h3>
|
||||
<p>WORK IN PROGRESS - FEATURE TO COME</p>
|
||||
|
||||
<p>Organize your background music and ambient sounds</p>
|
||||
|
||||
<!-- Audio Upload Section -->
|
||||
|
|
@ -1124,6 +1126,16 @@
|
|||
console.log('📸 isElectron:', window.desktopFileManager?.isElectron);
|
||||
console.log('📸 photoDirectory:', window.desktopFileManager?.photoDirectory);
|
||||
console.log('📸 Linked video directories:', window.desktopFileManager?.externalVideoDirectories?.length);
|
||||
|
||||
// Clean up legacy localStorage video directories
|
||||
const legacyDirs = localStorage.getItem('linkedVideoDirectories');
|
||||
const legacyIndividual = localStorage.getItem('linkedIndividualVideos');
|
||||
if (legacyDirs || legacyIndividual) {
|
||||
console.log('🧹 Cleaning up legacy localStorage video directories...');
|
||||
localStorage.removeItem('linkedVideoDirectories');
|
||||
localStorage.removeItem('linkedIndividualVideos');
|
||||
console.log('✅ Legacy video directory storage cleared');
|
||||
}
|
||||
}
|
||||
|
||||
updateProgress(30, 'Loading image library...');
|
||||
|
|
|
|||
|
|
@ -3,20 +3,6 @@ class DesktopFileManager {
|
|||
constructor(dataManager) {
|
||||
this.dataManager = dataManager;
|
||||
this.appPath = null;
|
||||
this.imageDirectories = {
|
||||
tasks: null,
|
||||
consequences: null
|
||||
};
|
||||
this.audioDirectories = {
|
||||
background: null,
|
||||
ambient: null
|
||||
};
|
||||
this.videoDirectories = {
|
||||
background: null,
|
||||
tasks: null,
|
||||
rewards: null,
|
||||
punishments: null
|
||||
};
|
||||
this.photoDirectory = null; // Directory for captured photos
|
||||
this.videoRecordingDirectory = null; // Directory for recorded videos
|
||||
|
||||
|
|
@ -42,27 +28,10 @@ class DesktopFileManager {
|
|||
try {
|
||||
this.appPath = await window.electronAPI.getAppPath();
|
||||
if (this.appPath) {
|
||||
this.imageDirectories.tasks = await window.electronAPI.pathJoin(this.appPath, 'images', 'tasks');
|
||||
this.imageDirectories.consequences = await window.electronAPI.pathJoin(this.appPath, 'images', 'consequences');
|
||||
|
||||
this.audioDirectories.background = await window.electronAPI.pathJoin(this.appPath, 'audio', 'background');
|
||||
this.audioDirectories.ambient = await window.electronAPI.pathJoin(this.appPath, 'audio', 'ambient');
|
||||
|
||||
this.videoDirectories.background = await window.electronAPI.pathJoin(this.appPath, 'videos', 'background');
|
||||
this.videoDirectories.tasks = await window.electronAPI.pathJoin(this.appPath, 'videos', 'tasks');
|
||||
this.videoDirectories.rewards = await window.electronAPI.pathJoin(this.appPath, 'videos', 'rewards');
|
||||
this.videoDirectories.punishments = await window.electronAPI.pathJoin(this.appPath, 'videos', 'punishments');
|
||||
|
||||
this.photoDirectory = await window.electronAPI.pathJoin(this.appPath, 'photos', 'captured');
|
||||
this.videoRecordingDirectory = await window.electronAPI.pathJoin(this.appPath, 'videos', 'recorded');
|
||||
|
||||
// Ensure directories exist
|
||||
await window.electronAPI.createDirectory(this.imageDirectories.tasks);
|
||||
await window.electronAPI.createDirectory(this.imageDirectories.consequences);
|
||||
|
||||
await window.electronAPI.createDirectory(this.audioDirectories.background);
|
||||
await window.electronAPI.createDirectory(this.audioDirectories.ambient);
|
||||
|
||||
await window.electronAPI.createDirectory(this.photoDirectory);
|
||||
await window.electronAPI.createDirectory(this.videoRecordingDirectory);
|
||||
|
||||
|
|
@ -71,8 +40,6 @@ class DesktopFileManager {
|
|||
|
||||
console.log('Desktop file manager initialized');
|
||||
console.log('App path:', this.appPath);
|
||||
console.log('Image directories:', this.imageDirectories);
|
||||
console.log('Audio directories:', this.audioDirectories);
|
||||
console.log('Photo directory:', this.photoDirectory);
|
||||
console.log('Video recording directory:', this.videoRecordingDirectory);
|
||||
|
||||
|
|
@ -94,132 +61,17 @@ class DesktopFileManager {
|
|||
}
|
||||
|
||||
async selectAndImportImages(category = 'task') {
|
||||
if (!this.isElectron) {
|
||||
this.showNotification('File import only available in desktop version', 'warning');
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
// Open file dialog
|
||||
const filePaths = await window.electronAPI.selectImages();
|
||||
|
||||
if (filePaths.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const importedImages = [];
|
||||
const targetDir = category === 'task' ? this.imageDirectories.tasks : this.imageDirectories.consequences;
|
||||
|
||||
if (!targetDir) {
|
||||
console.error('Target directory not initialized');
|
||||
this.showNotification('Directory not initialized', 'error');
|
||||
return [];
|
||||
}
|
||||
|
||||
for (const filePath of filePaths) {
|
||||
const fileName = filePath.split(/[\\/]/).pop();
|
||||
const targetPath = await window.electronAPI.pathJoin(targetDir, fileName);
|
||||
|
||||
// Copy file to app directory
|
||||
const success = await window.electronAPI.copyImage(filePath, targetPath);
|
||||
|
||||
if (success) {
|
||||
importedImages.push({
|
||||
name: fileName,
|
||||
path: targetPath,
|
||||
category: category
|
||||
});
|
||||
console.log(`Imported: ${fileName} to ${category}`);
|
||||
} else {
|
||||
console.error(`Failed to import: ${fileName}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (importedImages.length > 0) {
|
||||
// Update the game's image storage
|
||||
await this.updateImageStorage(importedImages);
|
||||
this.showNotification(`Imported ${importedImages.length} image(s) to ${category}!`, 'success');
|
||||
}
|
||||
|
||||
return importedImages;
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error importing images:', error);
|
||||
this.showNotification('Failed to import images', 'error');
|
||||
return [];
|
||||
}
|
||||
// Legacy method - no longer supported (use linked directories instead)
|
||||
console.warn('selectAndImportImages is deprecated - images should come from linked directories');
|
||||
this.showNotification('Image import not supported - use linked directories', 'warning');
|
||||
return [];
|
||||
}
|
||||
|
||||
async selectAndImportAudio(category = 'background') {
|
||||
if (!this.isElectron) {
|
||||
this.showNotification('Audio import only available in desktop version', 'warning');
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
// Open file dialog for audio files
|
||||
const filePaths = await window.electronAPI.selectAudio();
|
||||
|
||||
if (filePaths.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const importedAudio = [];
|
||||
let targetDir;
|
||||
|
||||
switch(category) {
|
||||
case 'background':
|
||||
targetDir = this.audioDirectories.background;
|
||||
break;
|
||||
case 'ambient':
|
||||
targetDir = this.audioDirectories.ambient;
|
||||
break;
|
||||
case 'effects':
|
||||
targetDir = this.audioDirectories.effects;
|
||||
break;
|
||||
default:
|
||||
targetDir = this.audioDirectories.background;
|
||||
}
|
||||
|
||||
if (!targetDir) {
|
||||
console.error('Target audio directory not initialized');
|
||||
this.showNotification('Audio directory not initialized', 'error');
|
||||
return [];
|
||||
}
|
||||
|
||||
for (const filePath of filePaths) {
|
||||
const fileName = filePath.split(/[\\/]/).pop();
|
||||
const targetPath = await window.electronAPI.pathJoin(targetDir, fileName);
|
||||
|
||||
// Copy file to app directory
|
||||
const success = await window.electronAPI.copyAudio(filePath, targetPath);
|
||||
|
||||
if (success) {
|
||||
importedAudio.push({
|
||||
name: fileName,
|
||||
path: targetPath,
|
||||
category: category,
|
||||
title: this.getAudioTitle(fileName)
|
||||
});
|
||||
console.log(`Imported audio: ${fileName} to ${category}`);
|
||||
} else {
|
||||
console.error(`Failed to import audio: ${fileName}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (importedAudio.length > 0) {
|
||||
// Update the game's audio storage
|
||||
await this.updateAudioStorage(importedAudio);
|
||||
this.showNotification(`Imported ${importedAudio.length} audio file(s) to ${category}!`, 'success');
|
||||
}
|
||||
|
||||
return importedAudio;
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error importing audio:', error);
|
||||
this.showNotification('Failed to import audio files', 'error');
|
||||
return [];
|
||||
}
|
||||
// Legacy method - no longer supported
|
||||
console.warn('selectAndImportAudio is deprecated');
|
||||
this.showNotification('Audio import not supported', 'warning');
|
||||
return [];
|
||||
}
|
||||
|
||||
async selectAndImportVideos(category = 'background') {
|
||||
|
|
@ -689,30 +541,9 @@ class DesktopFileManager {
|
|||
}
|
||||
|
||||
async scanDirectoryForImages(category = 'task') {
|
||||
if (!this.isElectron) {
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
const targetDir = category === 'task' ? this.imageDirectories.tasks : this.imageDirectories.consequences;
|
||||
|
||||
if (!targetDir) {
|
||||
console.error(`Target directory not initialized for ${category}`);
|
||||
return [];
|
||||
}
|
||||
|
||||
const images = await window.electronAPI.readDirectory(targetDir);
|
||||
|
||||
console.log(`Found ${images.length} images in ${category} directory`);
|
||||
return images.map(img => ({
|
||||
...img,
|
||||
category: category
|
||||
}));
|
||||
|
||||
} catch (error) {
|
||||
console.error(`Error scanning ${category} directory:`, error);
|
||||
return [];
|
||||
}
|
||||
// Legacy method - no longer used (images now come from linked directories)
|
||||
console.warn('scanDirectoryForImages is deprecated - use linked directories instead');
|
||||
return [];
|
||||
}
|
||||
|
||||
async updateImageStorage(images) {
|
||||
|
|
@ -810,67 +641,15 @@ class DesktopFileManager {
|
|||
}
|
||||
|
||||
async scanDirectoryForAudio(category = 'background') {
|
||||
if (!this.isElectron) {
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
let targetDir;
|
||||
|
||||
switch(category) {
|
||||
case 'background':
|
||||
targetDir = this.audioDirectories.background;
|
||||
break;
|
||||
case 'ambient':
|
||||
targetDir = this.audioDirectories.ambient;
|
||||
break;
|
||||
case 'effects':
|
||||
targetDir = this.audioDirectories.effects;
|
||||
break;
|
||||
default:
|
||||
targetDir = this.audioDirectories.background;
|
||||
}
|
||||
|
||||
if (!targetDir) {
|
||||
console.error(`Target audio directory not initialized for ${category}`);
|
||||
return [];
|
||||
}
|
||||
|
||||
const audioFiles = await window.electronAPI.readAudioDirectory(targetDir);
|
||||
|
||||
console.log(`Found ${audioFiles.length} audio files in ${category} directory`);
|
||||
return audioFiles.map(audio => ({
|
||||
...audio,
|
||||
category: category,
|
||||
title: this.getAudioTitle(audio.name)
|
||||
}));
|
||||
|
||||
} catch (error) {
|
||||
console.error(`Error scanning ${category} audio directory:`, error);
|
||||
return [];
|
||||
}
|
||||
// Legacy method - no longer supported
|
||||
console.warn('scanDirectoryForAudio is deprecated');
|
||||
return [];
|
||||
}
|
||||
|
||||
async scanAllAudioDirectories() {
|
||||
if (!this.isElectron) {
|
||||
this.showNotification('Audio directory scanning only available in desktop version', 'warning');
|
||||
return { background: [], ambient: [] };
|
||||
}
|
||||
|
||||
const backgroundAudio = await this.scanDirectoryForAudio('background');
|
||||
const ambientAudio = await this.scanDirectoryForAudio('ambient');
|
||||
|
||||
const results = {
|
||||
background: backgroundAudio,
|
||||
ambient: ambientAudio
|
||||
};
|
||||
|
||||
// Update game audio storage
|
||||
if (backgroundAudio.length > 0 || ambientAudio.length > 0) {
|
||||
await this.updateAudioStorage([...backgroundAudio, ...ambientAudio]);
|
||||
}
|
||||
|
||||
return results;
|
||||
// Legacy method - no longer supported
|
||||
console.warn('scanAllAudioDirectories is deprecated');
|
||||
return { background: [], ambient: [] };
|
||||
}
|
||||
|
||||
async updateAudioStorage(audioFiles) {
|
||||
|
|
@ -987,12 +766,9 @@ class DesktopFileManager {
|
|||
}
|
||||
|
||||
getImagePath(imageName, category = 'task') {
|
||||
if (!this.isElectron) {
|
||||
return `images/${category}s/${imageName}`;
|
||||
}
|
||||
|
||||
const dir = this.imageDirectories[category === 'task' ? 'tasks' : 'consequences'];
|
||||
return `${dir}/${imageName}`;
|
||||
// Legacy method - return web path
|
||||
console.warn('getImagePath is deprecated');
|
||||
return `images/${category}s/${imageName}`;
|
||||
}
|
||||
|
||||
getVideoTitle(fileName) {
|
||||
|
|
|
|||
|
|
@ -1447,6 +1447,83 @@ function handleVideoDirectoryResult(result) {
|
|||
}
|
||||
|
||||
function addVideoDirectory(directoryPath) {
|
||||
// Use desktopFileManager if available (preferred method)
|
||||
if (window.desktopFileManager && window.electronAPI) {
|
||||
console.log('📁 Adding directory via desktopFileManager:', directoryPath);
|
||||
|
||||
// Check if already exists
|
||||
if (window.desktopFileManager.externalVideoDirectories.some(dir => dir.path === directoryPath)) {
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('Directory already linked', 'warning');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Scan directory and add it manually
|
||||
(async () => {
|
||||
try {
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('🔍 Scanning directory for videos...', 'info');
|
||||
}
|
||||
|
||||
const videoFiles = await window.electronAPI.readVideoDirectoryRecursive(directoryPath);
|
||||
console.log(`Found ${videoFiles.length} video files in ${directoryPath}`);
|
||||
|
||||
if (videoFiles.length === 0) {
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('No video files found in directory', 'warning');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const dirName = directoryPath.split('\\').pop() || directoryPath.split('/').pop();
|
||||
const directoryObj = {
|
||||
id: Date.now(),
|
||||
name: dirName,
|
||||
path: directoryPath,
|
||||
videoCount: videoFiles.length,
|
||||
dateAdded: new Date().toISOString(),
|
||||
isRecursive: true
|
||||
};
|
||||
|
||||
// Process videos
|
||||
const videoExtensions = /\.(mp4|webm|mov|avi|mkv|m4v)$/i;
|
||||
const linkedVideos = videoFiles
|
||||
.filter(file => videoExtensions.test(file.name || file))
|
||||
.map(file => ({
|
||||
path: file.path || file,
|
||||
name: file.name || (typeof file === 'string' ? file.split(/[\\\/]/).pop() : 'unknown'),
|
||||
directoryId: directoryObj.id,
|
||||
directoryName: dirName
|
||||
}));
|
||||
|
||||
// Add to desktopFileManager
|
||||
window.desktopFileManager.externalVideoDirectories.push(directoryObj);
|
||||
window.desktopFileManager.allLinkedVideos.push(...linkedVideos);
|
||||
|
||||
// Save to storage
|
||||
await window.desktopFileManager.saveLinkedDirectories();
|
||||
await window.desktopFileManager.updateUnifiedVideoStorage();
|
||||
|
||||
// Refresh UI
|
||||
updateVideoDirectoriesList();
|
||||
loadLinkedVideos();
|
||||
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification(`✅ Added ${dirName} (${videoFiles.length} videos)`, 'success');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error adding directory:', error);
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('❌ Failed to add directory', 'error');
|
||||
}
|
||||
}
|
||||
})();
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback to localStorage (legacy method)
|
||||
console.log('📁 Adding directory via localStorage (legacy):', directoryPath);
|
||||
let linkedDirs;
|
||||
try {
|
||||
linkedDirs = JSON.parse(localStorage.getItem('linkedVideoDirectories') || '[]');
|
||||
|
|
@ -1500,6 +1577,21 @@ function handleRefreshVideoDirectories() {
|
|||
window.game.showNotification('🔄 Refreshing video directories...', 'info');
|
||||
}
|
||||
|
||||
// Use desktopFileManager refresh if available
|
||||
if (window.desktopFileManager && window.desktopFileManager.refreshAllDirectories) {
|
||||
console.log('📁 Refreshing via desktopFileManager...');
|
||||
window.desktopFileManager.refreshAllDirectories().then(() => {
|
||||
updateVideoDirectoriesList();
|
||||
loadLinkedVideos();
|
||||
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('✅ Video directories refreshed!', 'success');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback to just reloading
|
||||
loadLinkedVideos();
|
||||
|
||||
if (window.game && window.game.showNotification) {
|
||||
|
|
@ -1512,6 +1604,26 @@ function handleClearVideoDirectories() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Use desktopFileManager if available
|
||||
if (window.desktopFileManager) {
|
||||
console.log('📁 Clearing directories via desktopFileManager');
|
||||
(async () => {
|
||||
window.desktopFileManager.externalVideoDirectories = [];
|
||||
window.desktopFileManager.allLinkedVideos = [];
|
||||
await window.desktopFileManager.saveLinkedDirectories();
|
||||
await window.desktopFileManager.updateUnifiedVideoStorage();
|
||||
|
||||
updateVideoDirectoriesList();
|
||||
loadLinkedVideos();
|
||||
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('🗑️ All video directories unlinked', 'info');
|
||||
}
|
||||
})();
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback to localStorage (legacy)
|
||||
localStorage.removeItem('linkedVideoDirectories');
|
||||
localStorage.removeItem('linkedIndividualVideos');
|
||||
|
||||
|
|
@ -1594,6 +1706,23 @@ function updateVideoDirectoriesList() {
|
|||
}
|
||||
|
||||
function removeVideoDirectory(directoryId) {
|
||||
// Use desktopFileManager if available
|
||||
if (window.desktopFileManager && window.desktopFileManager.removeVideoDirectory) {
|
||||
console.log('📁 Removing directory via desktopFileManager:', directoryId);
|
||||
window.desktopFileManager.removeVideoDirectory(directoryId).then(() => {
|
||||
updateVideoDirectoriesList();
|
||||
loadLinkedVideos();
|
||||
|
||||
if (window.game && window.game.showNotification) {
|
||||
window.game.showNotification('🗑️ Video directory unlinked', 'info');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error removing directory:', error);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback to localStorage (legacy)
|
||||
let linkedDirs;
|
||||
try {
|
||||
linkedDirs = JSON.parse(localStorage.getItem('linkedVideoDirectories') || '[]');
|
||||
|
|
@ -1643,16 +1772,32 @@ async function loadVideosFromDesktopFileManager() {
|
|||
}
|
||||
|
||||
async function loadLinkedVideos() {
|
||||
let linkedDirs;
|
||||
try {
|
||||
linkedDirs = JSON.parse(localStorage.getItem('linkedVideoDirectories') || '[]');
|
||||
if (!Array.isArray(linkedDirs)) {
|
||||
let linkedDirs = [];
|
||||
|
||||
// Try to get from desktopFileManager first (preferred method)
|
||||
if (window.desktopFileManager && window.desktopFileManager.externalVideoDirectories) {
|
||||
linkedDirs = window.desktopFileManager.externalVideoDirectories;
|
||||
console.log(`🎬 Got ${linkedDirs.length} linked directories from desktopFileManager`);
|
||||
} else {
|
||||
// Fallback to localStorage (legacy support)
|
||||
try {
|
||||
const rawData = localStorage.getItem('linkedVideoDirectories');
|
||||
if (rawData) {
|
||||
const parsed = JSON.parse(rawData);
|
||||
|
||||
// Handle both formats: direct array or object with directories property
|
||||
if (Array.isArray(parsed)) {
|
||||
linkedDirs = parsed;
|
||||
} else if (parsed && parsed.directories && Array.isArray(parsed.directories)) {
|
||||
linkedDirs = parsed.directories;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error parsing linkedVideoDirectories:', e);
|
||||
linkedDirs = [];
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error parsing linkedVideoDirectories:', e);
|
||||
linkedDirs = [];
|
||||
}
|
||||
|
||||
let allVideos = [];
|
||||
|
||||
console.log(`🎬 Loading videos from ${linkedDirs.length} linked directories...`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue