# Adapted from: merge 1.03a (c)2002 embeem if {[info exists allow_merge] && $allow_merge == 1} { proc action_merge {chan path env} { global db set recfsids "" if {[string index $path 0] == "/"} { set path [string range $path 1 end] } set firstslash [string first "/" $path] set recfsids [string range $path [expr $firstslash + 1] end] eval $env set rlist [lsort -dictionary -decreasing [info vars "fsid_*"]] foreach rec $rlist { lappend recfsids [lindex [split $rec "_"] 2] } puts $chan [html_start "Merge Recordings (by embeem)"] if { $recfsids == "" } { puts $chan "
ERROR: Not allowed to make empty recordings
" } else { puts $chan "Creating Multipart Recording
" set today [expr [clock seconds] / 86400] set now [expr [clock seconds] % 86400 + 10] RetryTransaction { set duration 0 set newtitle "" set parttime 0 set multirec [db $db create Recording] #puts "merged obj: [dbobj $multirec fsid]/[dbobj $multirec subobjid]" dbobj $multirec set BitRate 0 ;# obsolete dbobj $multirec set ErrorString "Multipart recording (embeem)" dbobj $multirec set RecordQuality 100 dbobj $multirec set Score 0 dbobj $multirec set SelectionType 3 dbobj $multirec set State 4 ;# complete foreach recording $recfsids { set recording [db $db openid $recording] set showing [dbobj $recording get Showing] set parts [dbobj $recording get Part] foreach part $parts { set multipart [db $db createsub RecordingPart $multirec] dbobj $multipart copyfrom $part dbobj $multipart set Begin $parttime set elapsed [expr [dbobj $part get End] - [dbobj $part get Begin]] incr parttime $elapsed dbobj $multipart set End $parttime dbobj $multirec add Part $multipart } incr duration [defaultval 0 [dbobj $recording get StartPadding]] incr duration [dbobj $showing get Duration] incr duration [defaultval 0 [dbobj $recording get EndPadding]] set program [dbobj $showing get Program] set title [strim [dbobj $program get Title]] set eptitle [strim [dbobj $program get EpisodeTitle]] if {$eptitle != ""} { set title "$title : $eptitle\n" } set newtitle "$newtitle$title\n" puts $chan "Added - $titleMultipart recording has been created.
" puts $chan {
While the total length is correct (5x 1/2 hour shows = 2:30), the progress bar makes it look like a partial recording, with only the first 1/2 hour being green. Then, when it reaches the end of the first 1/2 hour, the second 1/2 hour starts to play, but the progress bar "loops". If you stop playing, and then later resume, it will jump to that same point, but only in the first clip. So, if you are 15 minutes into program 2, then stop, and resume later, it starts playing 15 minutes into program 1. If you fastforward/rewind/skip (and maybe pause) the merged recording will not play properly. The merged recording is more of a playlist. It doesn't actually take more space, so don't merge recordings then delete the individual shows and expect it to work.
} puts $chan [html_link "/nowshowing" "Return to Now Playing"] puts $chan [html_end] } }