# 🎬 DaVinci Resolve Project Manager

A comprehensive solution for organizing and automating your scattered DaVinci Resolve projects, backups, and exports.

## 🚀 Quick Start

1. **Run the inventory** to see what you currently have:
   ```bash
   npm run inventory
   ```

2. **Preview the cleanup** (dry run):
   ```bash
   npm run cleanup
   ```

3. **Execute the cleanup** (edit cleanup tool and set `dryRun = false`):
   ```bash
   # Edit resolve-cleanup-tool.js first!
   npm run cleanup
   ```

4. **Start automation monitoring**:
   ```bash
   npm run start-automation
   ```

## 📁 What This Does

### 🔍 **Current Analysis (Your Situation)**
- **516 total database files** (38 local + 478 remote)
- **30 unique projects** across local and remote drives
- **12 DRP export files** scattered in different locations
- **3.2GB** in just one large project (a9b82928)

### 🗂️ **Organized Structure Created**
```
/Users/Sam/Sam Storage/DaVinci-Resolve-Master/
├── Local-Projects/
│   └── Active-Library/              # Your working projects
├── Remote-Projects/
│   └── Server-Library/              # Synced to remote server
├── Backups/
│   ├── active/                      # Recent projects (last 30 days)
│   ├── archive/                     # Older completed projects
│   ├── large-archived/              # Projects over 50MB
│   └── Database-Backups/            # Organized by project UUID
├── Recovery/
│   └── Found-Databases/             # Staging for recovered files
└── Archive/
    └── Old-Projects/                # Long-term storage
```

### 🤖 **Automation Features**
- **Real-time monitoring** of project changes
- **Auto-backup** when projects are modified
- **Smart cleanup** of old backup files
- **Remote drive sync** management
- **File organization** for new scattered files

## 📊 Your Project Breakdown

### 🎯 **Active Projects** (Recent - Last 30 Days)
- `b28092f2` - 11 backups, 33.7MB - **Latest: June 16, 2025** ⭐
- `9fe19297` - 4 backups, 11.9MB - Latest: June 12, 2025
- `e800e4c3` - 6 backups, 18.1MB - Latest: June 11, 2025
- `0be2d0d4` - 7 backups, 19.4MB - Latest: May 28, 2025
- `c0bbbc28` - 2 backups, 5.5MB - Latest: May 26, 2025

### 📦 **Large Archived Projects** (Over 50MB)
- `a9b82928` - 88 backups, **3.2GB** - Latest: Dec 17, 2024 ⚠️
- `472c7261` - 115 backups, 436.5MB - Latest: Oct 15, 2024
- `a6e147e1` - 49 backups, 187.1MB - Latest: April 11, 2024

## 🛠️ Available Commands

| Command | Description |
|---------|-------------|
| `npm run inventory` | Analyze all current resolve files |
| `npm run cleanup` | Organize files into new structure |
| `npm run start-automation` | Start real-time monitoring |
| `npm install` | Install dependencies |

## ⚠️ Before You Start

1. **Backup First**: Your files are safe - the cleanup tool copies (doesn't move) by default
2. **Review Dry Run**: Always check the dry-run output before executing cleanup
3. **Check Remote Drive**: Make sure your SMB drive is mounted at `/Volumes/Sam Storage`
4. **Update DaVinci**: Point DaVinci Resolve to the new organized library paths

## 🎯 Recommended Workflow

### **Phase 1: Analysis & Planning**
```bash
npm run inventory  # See what you have
npm run cleanup    # Preview organization (dry run)
```

### **Phase 2: Cleanup & Organization**
```bash
# Edit resolve-cleanup-tool.js and set dryRun = false
npm run cleanup    # Execute the organization
```

### **Phase 3: Automation & Monitoring**
```bash
npm run start-automation  # Keep running for real-time management
```

## 🔧 Configuration

Edit the scripts to customize:
- **Backup frequency** (default: 24 hours)
- **Max backups per project** (default: 10)
- **Watch paths** for monitoring
- **Archive thresholds** (size/age)

## 📝 What Gets Organized

- ✅ **Database backups** → Sorted by project UUID and date
- ✅ **Active projects** → Prioritized by recent activity  
- ✅ **DRP exports** → Grouped with related projects
- ✅ **Large projects** → Special handling for space management
- ✅ **Duplicate detection** → Identifies conflicts between local/remote

## 🚨 Important Notes

- **Remote Drive**: `/Volumes/Sam Storage` must be mounted for full functionality
- **DaVinci Resolve**: Update your database library paths after cleanup
- **Permissions**: Scripts may need to copy files across different drives
- **Space**: Large archived projects are handled separately to save space

## 📞 Support

If you encounter issues:
1. Check that all paths exist and are accessible
2. Ensure remote SMB drive is properly mounted
3. Review console output for specific error messages
4. Run in dry-run mode first to preview changes

---

**Created for Sam's DaVinci Resolve cleanup project - June 2025** 🎬
