appydave-tools 0.68.0 → 0.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,400 @@
1
+ # VideoFileNamer - Filename Generation Tool
2
+
3
+ > **Web-based utility for generating structured video segment filenames** following the FliVideo naming convention.
4
+
5
+ ---
6
+
7
+ ## 📋 Overview
8
+
9
+ **App Name**: VideoFileNamer
10
+ **Type**: Web Application (Replit)
11
+ **Purpose**: Generate structured filenames for video recording segments with clipboard management
12
+ **Target Users**: Content creators, video producers, YouTubers
13
+ **Database**: ReplDB
14
+
15
+ ### Important Clarification
16
+
17
+ ⚠️ **This application does NOT rename or modify actual files on your system.** It is purely a filename generator that:
18
+ - Creates structured filenames following conventions
19
+ - Copies filenames to your clipboard
20
+ - You manually rename files in your file manager
21
+
22
+ ---
23
+
24
+ ## 🎯 Core Features
25
+
26
+ ### 1. Automatic Filename Generation
27
+
28
+ Generates filenames using a standardized format compatible with **FliVideo naming conventions**:
29
+
30
+ ```
31
+ [chapter]-[part]-[label]-[metadata?].mov
32
+ ```
33
+
34
+ **Format Components:**
35
+ - **Chapter**: Sequential number (1, 2, 3, etc.) - auto-incremented
36
+ - **Part**: Part number within chapter (1, 2, 3, etc.) - resets on new chapter
37
+ - **Label**: Chapter name/description (intro, content, outro, etc.)
38
+ - **Metadata** (Optional): Additional tags (cta, endcards, etc.)
39
+
40
+ ### 2. Real-Time Filename Preview
41
+
42
+ - Read-only column shows generated filename as you type
43
+ - Updates instantly when you modify chapter, part, label, or metadata
44
+ - Visual feedback for filename generation
45
+
46
+ ### 3. Clipboard Integration
47
+
48
+ - Copy individual filenames to clipboard with one click
49
+ - Auto-clipboard option: Automatically copy filenames to clipboard after you finish typing
50
+ - Clipboard actions are logged for debugging
51
+
52
+ ### 4. Smart Row Management
53
+
54
+ - **Next Chapter**: Adds new row with chapter incremented, part reset to 1
55
+ - **Next Part**: Adds new row with same chapter, part incremented
56
+ - Preserves labels when adding new parts in same chapter
57
+ - Prevents manual data entry redundancy
58
+
59
+ ### 5. Data Persistence
60
+
61
+ - Stores generated filenames and metadata in ReplDB
62
+ - Retrieve history of previously generated names
63
+ - Track transcript text alongside filenames
64
+
65
+ ---
66
+
67
+ ## 🎬 Filename Format & Examples
68
+
69
+ ### Default Structure
70
+
71
+ ```
72
+ [chapter number]-[part number]-[label].mov
73
+ ```
74
+
75
+ ### With Metadata
76
+
77
+ ```
78
+ [chapter number]-[part number]-[label]-[metadata].mov
79
+ ```
80
+
81
+ ### Examples
82
+
83
+ | Input | Output |
84
+ |-------|--------|
85
+ | Chapter: 1, Part: 1, Label: intro | `1-1-intro.mov` |
86
+ | Chapter: 1, Part: 2, Label: intro | `1-2-intro.mov` |
87
+ | Chapter: 2, Part: 1, Label: content | `2-1-content.mov` |
88
+ | Chapter: 2, Part: 1, Label: content, Metadata: cta | `2-1-content-cta.mov` |
89
+ | Chapter: 3, Part: 2, Label: outro, Metadata: endcards | `3-2-outro-endcards.mov` |
90
+
91
+ ---
92
+
93
+ ## 🖥️ User Interface & Workflow
94
+
95
+ ### Initial Load
96
+
97
+ - Empty table displayed on startup
98
+ - One pre-filled row created automatically:
99
+ - Chapter: 1
100
+ - Part: 1
101
+ - Label: (empty - user fills in)
102
+
103
+ ### Typical Workflow
104
+
105
+ 1. **View default row**: Table shows one empty row (1-1)
106
+ 2. **Enter label**: Type label name (e.g., "intro")
107
+ 3. **See filename update**: Read-only column shows `1-1-intro.mov`
108
+ 4. **Copy filename**: Click copy button or enable auto-clipboard
109
+ 5. **Add more segments**: Use "Next Part" to add 1-2, "Next Chapter" to add 2-1
110
+ 6. **Continue workflow**: Repeat for each segment
111
+
112
+ ### UI Elements
113
+
114
+ #### Input Fields (Per Row)
115
+ - **Chapter**: Numeric input (auto-incremented via buttons)
116
+ - **Part**: Numeric input (auto-incremented via buttons)
117
+ - **Label**: Text input (chapter name/description)
118
+ - **Metadata**: Text input (optional tags)
119
+
120
+ #### Output Column
121
+ - **Filename**: Read-only display of generated name
122
+ - **Copy Button**: One-click clipboard copy
123
+
124
+ #### Control Buttons
125
+ - **Next Chapter**: Increment chapter, reset part to 1, add new row
126
+ - **Next Part**: Increment part, keep chapter, add new row
127
+ - **Auto-Clipboard Checkbox**: Toggle auto-copy functionality
128
+
129
+ #### Additional Controls
130
+ - **Delete Row**: Remove row from table
131
+ - **Clear All**: Start fresh
132
+
133
+ ---
134
+
135
+ ## ⚙️ Technical Specifications
136
+
137
+ ### Filename Generation Algorithm
138
+
139
+ ```
140
+ 1. Validate inputs (chapter, part, label not empty)
141
+ 2. Format chapter as integer (1, 2, 3... not 01, 02, 03)
142
+ 3. Format part as integer (1, 2, 3... not 01, 02, 03)
143
+ 4. Combine: "{chapter}-{part}-{label}"
144
+ 5. Append metadata if provided: "{chapter}-{part}-{label}-{metadata}"
145
+ 6. Append extension: "{chapter}-{part}-{label}-{metadata}.mov"
146
+ ```
147
+
148
+ ### Auto-Increment Logic
149
+
150
+ **Next Chapter Button:**
151
+ - Chapter: current_chapter + 1
152
+ - Part: reset to 1
153
+ - Label: prompt user for new chapter name
154
+ - Create new row with these values
155
+
156
+ **Next Part Button:**
157
+ - Chapter: keep same
158
+ - Part: current_part + 1
159
+ - Label: preserve from previous row
160
+ - Create new row with these values
161
+
162
+ ### Debouncing
163
+
164
+ - API calls debounced to 1 second after user stops typing
165
+ - Prevents excessive database operations
166
+ - Smooth typing experience without lag
167
+
168
+ ### Auto-Clipboard
169
+
170
+ - Triggered 1 second after user finishes editing
171
+ - Only copies when auto-clipboard is enabled
172
+ - Shows toast notification: "Filename copied to clipboard"
173
+ - Logged for debugging
174
+
175
+ ---
176
+
177
+ ## 📊 Data Structure
178
+
179
+ ### File Entry
180
+
181
+ ```json
182
+ {
183
+ "id": "unique-identifier",
184
+ "chapter": 1,
185
+ "part": 1,
186
+ "label": "intro",
187
+ "metadata": ["cta"],
188
+ "filename": "1-1-intro-cta.mov",
189
+ "transcript": "Optional transcript text...",
190
+ "createdAt": "2024-11-25T10:30:00Z",
191
+ "updatedAt": "2024-11-25T10:30:00Z"
192
+ }
193
+ ```
194
+
195
+ ### Database Storage (ReplDB)
196
+
197
+ - **Filenames Table**: Stores all generated filename entries
198
+ - **Metadata Table**: Optional - stores transcript and additional context
199
+ - **History**: Full edit history maintained for reference
200
+
201
+ ---
202
+
203
+ ## 🔍 Input Validation
204
+
205
+ ### Required Fields
206
+ - ✅ **Chapter**: Must be numeric, > 0
207
+ - ✅ **Part**: Must be numeric, > 0
208
+ - ✅ **Label**: Must not be empty
209
+
210
+ ### Optional Fields
211
+ - ⭕ **Metadata**: Optional, can contain multiple comma-separated tags
212
+
213
+ ### Error Handling
214
+
215
+ **Display descriptive errors:**
216
+ - "Chapter must be a number greater than 0"
217
+ - "Label cannot be empty"
218
+ - "Database connection error - please try again"
219
+ - "Clipboard copy failed - try again manually"
220
+
221
+ ---
222
+
223
+ ## 📝 Logging & Debugging
224
+
225
+ ### Logged Events
226
+
227
+ **Input Changes:**
228
+ ```
229
+ [LOG] Chapter changed: 1 → 2
230
+ [LOG] Part changed: 1 → 2
231
+ [LOG] Label changed: "" → "intro"
232
+ [LOG] Metadata changed: "" → "cta"
233
+ ```
234
+
235
+ **Filename Generation:**
236
+ ```
237
+ [LOG] Filename generated: 1-1-intro.mov
238
+ [LOG] Filename updated: 1-1-intro.mov → 1-1-intro-cta.mov
239
+ ```
240
+
241
+ **Clipboard Actions:**
242
+ ```
243
+ [LOG] Filename copied to clipboard: 1-1-intro.mov
244
+ [LOG] Auto-clipboard enabled: true
245
+ [LOG] Auto-clipboard disabled: false
246
+ ```
247
+
248
+ **Database Operations:**
249
+ ```
250
+ [LOG] Saving filename to database: 1-1-intro.mov
251
+ [LOG] Retrieved 12 filenames from history
252
+ [LOG] Database error: Connection timeout
253
+ ```
254
+
255
+ ### Browser Console
256
+
257
+ - All events logged to browser console (F12 → Console tab)
258
+ - Timestamps included for debugging
259
+ - Debug information easily searchable for troubleshooting
260
+
261
+ ---
262
+
263
+ ## 🎬 Integration with FliVideo
264
+
265
+ VideoFileNamer is a companion tool to **FliVideo** that generates segment filenames following FliVideo naming conventions:
266
+
267
+ ### FliVideo Naming Standards
268
+
269
+ | Element | Format | Example |
270
+ |---------|--------|---------|
271
+ | Project Folder | `[sequence]-[project-name]` | `a27-my-video-project` |
272
+ | Episode Folder | `[sequence]-[episode-name]` | `01-introduction` |
273
+ | **Video Segment** | **`[chapter]-[part]-[label].mov`** | **`1-1-intro.mov`** ✅ |
274
+ | Project Structure | `/project/recordings/` | `/a27-my-video/recordings/` |
275
+
276
+ ### Workflow Integration
277
+
278
+ ```
279
+ Ecamm Live Recording
280
+
281
+ [automatic save with date/time name]
282
+
283
+ VideoFileNamer
284
+ [generate: 1-1-intro.mov]
285
+
286
+ Manual Rename
287
+ [1-1-intro.mov on file system]
288
+
289
+ FliVideo Project
290
+ [organized in recordings/ folder]
291
+
292
+ Transcription & Processing
293
+ [FliVideo handles this automatically]
294
+ ```
295
+
296
+ ---
297
+
298
+ ## 🚀 Quick Start
299
+
300
+ ### Access the App
301
+
302
+ 1. Open Replit project: **VideoFileNamer (4)**
303
+ 2. Start development server: `npm run dev`
304
+ 3. Navigate to: `http://localhost:5000`
305
+
306
+ ### Basic Usage
307
+
308
+ 1. **First segment**:
309
+ - Label field shows empty, type "intro"
310
+ - Filename generates: `1-1-intro.mov`
311
+ - Click copy or enable auto-clipboard
312
+
313
+ 2. **Second attempt at intro**:
314
+ - Click "Next Part"
315
+ - Filename generates: `1-2-intro.mov`
316
+ - Label preserved automatically
317
+
318
+ 3. **Move to next chapter**:
319
+ - Click "Next Chapter"
320
+ - System prompts for new chapter name: "content"
321
+ - Filename generates: `2-1-content.mov`
322
+
323
+ ### Common Actions
324
+
325
+ | Action | Steps |
326
+ |--------|-------|
327
+ | Copy filename | Click copy button OR enable auto-clipboard |
328
+ | Add video segment | Click "Next Part" (same chapter) |
329
+ | Start new chapter | Click "Next Chapter" (reset part) |
330
+ | Undo/Delete row | Click delete button on row |
331
+ | Clear everything | Click "Clear All" button |
332
+
333
+ ---
334
+
335
+ ## 🔧 Troubleshooting
336
+
337
+ ### Application Won't Start
338
+
339
+ ```bash
340
+ # Check if port is in use
341
+ lsof -i :5000
342
+
343
+ # Kill existing process
344
+ pkill -f "node|tsx"
345
+
346
+ # Start fresh
347
+ npm run dev
348
+ ```
349
+
350
+ ### Typing Lag
351
+
352
+ - Debouncing is set to 1 second
353
+ - Short delay is normal while API processes
354
+ - Should feel responsive after debouncing implementation
355
+ - Check browser console (F12) for errors
356
+
357
+ ### Filenames Not Saving
358
+
359
+ - Check ReplDB connection status
360
+ - Verify metadata fields are not empty
361
+ - Check browser console for database errors
362
+ - Try refreshing page and re-entering data
363
+
364
+ ### Clipboard Copy Failed
365
+
366
+ - Some browsers restrict clipboard access
367
+ - Try using the copy button instead of auto-clipboard
368
+ - Or manually select and copy the filename text
369
+ - Check browser console for permission errors
370
+
371
+ ---
372
+
373
+ ## 📦 Feature Checklist
374
+
375
+ - ✅ Automatic filename generation
376
+ - ✅ Real-time filename preview
377
+ - ✅ Chapter/part smart increment buttons
378
+ - ✅ Label preservation on next part
379
+ - ✅ Optional metadata support
380
+ - ✅ Clipboard copy (manual)
381
+ - ✅ Auto-clipboard option with debouncing
382
+ - ✅ ReplDB persistence
383
+ - ✅ Comprehensive logging
384
+ - ✅ Error handling and validation
385
+ - ✅ User-friendly UI with table layout
386
+ - ✅ Responsive design
387
+
388
+ ---
389
+
390
+ ## 📖 Related Documentation
391
+
392
+ - **[FliVideo Naming Conventions](../../../architecture/dam/dam-vision.md)** - Project/episode/segment naming standards
393
+ - **[FliVideo Overview](../../../../../../flivideo/docs/fli-video.md)** - Complete VAM system
394
+ - **[DAM (Digital Asset Management)](./dam/)** - Video project organization
395
+
396
+ ---
397
+
398
+ **Last Updated**: 2025-11-25
399
+ **Status**: Active
400
+ **Platform**: Replit (Web-based)
@@ -37,7 +37,12 @@ module Appydave
37
37
 
38
38
  unless Dir.exist?(path)
39
39
  brands_list = available_brands_display
40
- raise "Brand directory not found: #{path}\nAvailable brands:\n#{brands_list}"
40
+ # Use fuzzy matching to suggest similar brands (check both shortcuts and keys)
41
+ Appydave::Tools::Configuration::Config.configure
42
+ brands_config = Appydave::Tools::Configuration::Config.brands
43
+ all_brand_identifiers = brands_config.brands.flat_map { |b| [b.shortcut, b.key] }.uniq
44
+ suggestions = FuzzyMatcher.find_matches(brand_key, all_brand_identifiers, threshold: 3)
45
+ raise BrandNotFoundError.new(path, brands_list, suggestions)
41
46
  end
42
47
 
43
48
  path