Changeset 3e86f1c in Klonkt for src/routes/admin-audio.js
- Timestamp:
- 06/15/2026 03:23:29 AM (3 months ago)
- Branches:
- main
- Children:
- 7f46817d
- Parents:
- 4c9f29a
- File:
-
- 1 edited
-
src/routes/admin-audio.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-audio.js
r4c9f29a r3e86f1c 185 185 `).run(mediaId, site.id, transcoded.filename, transcoded.mimeType, transcoded.size, transcoded.path); 186 186 187 console.log('[admin-audio] inserting audio_tracks row'); 187 // Duur automatisch: primair uit de transcode (ffmpeg codecData), anders een 188 // optionele client-side waarde (bulk-uploader leest <audio>.duration uit), 189 // anders NULL (UI toont dan '—:—', handmatig bij te werken in de editor). 190 const clientDur = req.body.duration != null ? parseInt(req.body.duration, 10) : NaN; 191 const finalDuration = 192 (transcoded.durationSec != null && transcoded.durationSec > 0) ? transcoded.durationSec 193 : (Number.isFinite(clientDur) && clientDur > 0) ? clientDur 194 : null; 195 196 console.log('[admin-audio] inserting audio_tracks row (duration=' + finalDuration + ')'); 188 197 db.prepare(` 189 INSERT INTO audio_tracks (id, site_id, title, artist, album, cover_url, media_id, position)190 VALUES (?, ?, ?, ?, ?, ?, ?, COALESCE(198 INSERT INTO audio_tracks (id, site_id, title, artist, album, duration, cover_url, media_id, position) 199 VALUES (?, ?, ?, ?, ?, ?, ?, ?, COALESCE( 191 200 (SELECT MAX(position) + 1 FROM audio_tracks WHERE site_id = ?), 192 201 0 … … 195 204 trackId, site.id, 196 205 finalTitle, finalArtist, finalAlbum, 206 finalDuration, 197 207 coverUrl, 198 208 mediaId, site.id
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)