From 68d031e6125b2d1ee3a0a64047615fc3e6f6daa1 Mon Sep 17 00:00:00 2001 From: nebojsa Date: Fri, 25 Dec 2009 13:32:28 +0000 Subject: [PATCH] fixed crash when making playlists from web client --- .../modules/storageServer/var/Playlist.php | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/campcaster/src/modules/storageServer/var/Playlist.php b/campcaster/src/modules/storageServer/var/Playlist.php index c8e932737..bf6264d86 100644 --- a/campcaster/src/modules/storageServer/var/Playlist.php +++ b/campcaster/src/modules/storageServer/var/Playlist.php @@ -162,7 +162,14 @@ class Playlist extends StoredFile { // insert new playlist element $offset = $plLen; - $plElInfo = $this->insertPlaylistElement($parid, $offset, + + // insert default values until UI starts supporting clip in / clip out + $clipStart = 00.000000; + $clipEnd = $acLen; + $clipLength = $acLen; + + + $plElInfo = $this->insertPlaylistElement($parid, $offset, $clipStart, $clipEnd, $clipLength, $acGunid, $acLen, $acTit, $fadeIn, $fadeOut, $plElGunid, $elType); if (PEAR::isError($plElInfo)) { @@ -1025,7 +1032,7 @@ class Playlist extends StoredFile { *
  • fadeOutId int - record id
  • * */ - private function insertPlaylistElement($parid, $offset, $acGunid, $acLen, $acTit, + private function insertPlaylistElement($parid, $offset, $clipStart, $clipEnd, $clipLength, $acGunid, $acLen, $acTit, $fadeIn=NULL, $fadeOut=NULL, $plElGunid=NULL, $elType='audioClip') { // insert playlistElement @@ -1048,6 +1055,24 @@ class Playlist extends StoredFile { if (PEAR::isError($r)) { return $r; } + // insert clipLength + $r = $this->md->insertMetadataElement( + $plElId, 'clipLength', $clipLength, 'A'); + if (PEAR::isError($r)) { + return $r; + } + // insert clipStart + $r = $this->md->insertMetadataElement( + $plElId, 'clipStart', $clipStart, 'A'); + if (PEAR::isError($r)) { + return $r; + } + // insert clipEnd + $r = $this->md->insertMetadataElement( + $plElId, 'clipEnd', $clipEnd, 'A'); + if (PEAR::isError($r)) { + return $r; + } // insert audioClip (or playlist) element into playlistElement $r = $this->md->insertMetadataElement($plElId, $elType); if (PEAR::isError($r)) {