# Multiple NotebookLM Assets Solution

## Discovery
🎉 **Great finding!** The NotebookLM notebook contains **3 audio files + 3 video files** instead of the expected 1 of each.

## Current System Limitation
The Jadwa AI system currently supports only **1 asset per type per report**, but NotebookLM has created multiple versions.

## Immediate Solutions

### ✅ Option 1: Direct NotebookLM Access (Easiest)
Users can access all assets directly in NotebookLM:
- **URL**: https://notebooklm.google.com/notebook/0f38d000-7497-442c-9b67-8773b02a558b
- **Benefits**: All assets available, no download needed
- **Implementation**: Add "View All in NotebookLM" button to UI

### 🔄 Option 2: Download All Assets (Manual)
1. **Open Notebook**: https://notebooklm.google.com/notebook/0f38d000-7497-442c-9b67-8773b02a558b
2. **Download Assets**:
   - Find "Audio Overview" section (3 files)
   - Find "Video Overview" section (3 files)
   - Download each with numbered names
3. **Upload to Server**: `/app/static/uploads/notebooks/35/`
4. **Run Database Update** (see SQL below)

### 💻 Option 3: System Enhancement (Development)
Enhance the system to support multiple assets per type:
```python
# Add asset_index field to support multiple assets
ALTER TABLE notebook_assets ADD COLUMN asset_index INTEGER DEFAULT 1;

# Update unique constraint
ALTER TABLE notebook_assets DROP CONSTRAINT notebook_assets_report_id_asset_type_key;
ALTER TABLE notebook_assets ADD CONSTRAINT notebook_assets_report_asset_type_index UNIQUE (report_id, asset_type, asset_index);
```

## File Naming Convention
```
🎧 Audio files:
  - audio_1.mp3 (27.97 MB) ✅ Already exists
  - audio_2.mp3 (to be downloaded)
  - audio_3.mp3 (to be downloaded)

🎬 Video files:
  - video_1.mp4 (to be downloaded)
  - video_2.mp4 (to be downloaded)
  - video_3.mp4 (to be downloaded)
```

## Database Update SQL
```sql
-- Add additional audio assets
INSERT INTO notebook_assets (report_id, asset_type, status, file_path, file_format, created_at, completed_at)
VALUES
  (35, 'audio', 'ready', 'uploads/notebooks/35/audio_2.mp3', 'mp3', NOW(), NOW()),
  (35, 'audio', 'ready', 'uploads/notebooks/35/audio_3.mp3', 'mp3', NOW(), NOW());

-- Add video assets
INSERT INTO notebook_assets (report_id, asset_type, status, file_path, file_format, created_at, completed_at)
VALUES
  (35, 'video', 'ready', 'uploads/notebooks/35/video_1.mp4', 'mp4', NOW(), NOW()),
  (35, 'video', 'ready', 'uploads/notebooks/35/video_2.mp4', 'mp4', NOW(), NOW()),
  (35, 'video', 'ready', 'uploads/notebooks/35/video_3.mp4', 'mp4', NOW(), NOW());

-- Update existing failed video asset
UPDATE notebook_assets
SET status = 'ready',
    file_path = 'uploads/notebooks/35/video.mp4',
    file_format = 'mp4',
    error_message = NULL,
    completed_at = NOW()
WHERE report_id = 35
  AND asset_type = 'video'
  AND status = 'failed';
```

## UI Enhancement (Recommended)
Add a new button to the notebook page:
```html
<a href="https://notebooklm.google.com/notebook/0f38d000-7497-442c-9b67-8773b02a558b"
   target="_blank"
   class="btn-notebooklm">
   👁 View All Assets in NotebookLM (3 audio + 3 video)
</a>
```

## Current Status Summary

### ✅ Successfully Created (7 assets)
- 📊 Infographic (4.55 MB)
- 📑 Slide Deck (11.02 MB)
- 🧠 Mind Map (2.7 KB)
- 📄 Report (8.2 KB)
- 📝 Flashcards (27 KB)
- ❓ Quiz (30 KB)
- 🎧 **Audio 1** (27.97 MB) - Fixed!

### 📥 Additional Assets Available (4 more)
- 🎧 **Audio 2** (available in NotebookLM)
- 🎧 **Audio 3** (available in NotebookLM)
- 🎬 **Video 1** (available in NotebookLM)
- 🎬 **Video 2** (available in NotebookLM)
- 🎬 **Video 3** (available in NotebookLM)

### ❌ Failed (1 asset)
- 🎬 Video (timeout during first attempt)

## Next Steps

### Immediate (Today)
1. ✅ **Fixed audio timeout issue** (completed)
2. 🔗 **Add NotebookLM link** to UI for easy access
3. 📊 **Show total asset count** (7 + 5 = 12 total)

### Short-term (This Week)
1. 📥 **Download additional assets** manually or create automated script
2. 💾 **Update database** for multiple assets per type
3. 🎨 **Update UI** to show all available assets

### Long-term (Next Sprint)
1. 🏗️ **Database schema enhancement** for multiple assets
2. 🤖 **Automated download script** for all NotebookLM artifacts
3. 📊 **Asset management UI** for handling multiple versions

## Quick Win Solution
The easiest immediate solution is to add a "View All in NotebookLM" button that links directly to the notebook. This gives users access to all 12 assets (7 downloaded + 5 additional) without requiring complex system changes.

**Notebook URL**: https://notebooklm.google.com/notebook/0f38d000-7497-442c-9b67-8773b02a558b

---

**Status**: 🟡 System limitation identified - multiple assets available but not fully supported
**Priority**: 🟠 Medium - enhances user experience but not critical
**Impact**: 📈 High - users get access to 5 additional content assets