/** * Calculates the best fit for a command * * @param string $command Windows command line * @return array ezcMvcResult content, others... :) */ public static function doBestFit($command) { $command = MKVMergeCommandImportWindowsGUI::convert($command, false); $return = array('size' => $command->TargetSize); if ($command->conversionType === 'tvshow') { $return += mmMkvManagerDiskHelper::BestTVEpisodeFit($command->title, $command->TargetSize); } return $return; }
?> </select> <p><input type="checkbox" name="QueueCommand" value="1" id="chkQueueCommand" /><label for="chkQueueCommand">Add to queue</label></p> </p> <p><input type="submit" name="ConvertWinCmd" /></p> </form> <?php if ( $_POST['Target'] == "0" ) { die( '<p style="color: red">Target is mandatory</p>' ); } if ( isset( $_POST['ConvertWinCmd'] ) ) { try { $command = MKVMergeCommandImportWindowsGUI::convert( $_POST['WinCmd'], $_POST['Target'] ); } catch ( Exception $e ) { $exceptionMessage = $e->getMessage(); $callstack = $e->getTraceAsString(); $message = <<<EOF <p class="error">An exception has occured in <span class="filename">{$e->getFile()}:{$e->getLine()}</p> <p class="error message">{$exceptionMessage}</p> <pre class="error dump">{$callstack}</pre> EOF; die( $message ); } // symlink $command->appendSymLink = true; $command->appendMessage = true; } // end if ( isset( $_POST['ConvertWinCmd'] )