/** * Merge interface for movies * @param string $this->Folder The name of the movie folder */ public function doMovieMerge() { $moviesPath = ezcConfigurationManager::getInstance()->getSetting( 'movies', 'GeneralSettings', 'SourcePath' ); $result = new ezcMvcResult; $result->variables['page_title'] = "{$this->Folder} :: Movies :: MKV Manager"; $result->variables['movie'] = $this->Folder; $generator = new MKVMergeCommandGenerator(); // video file, mandatory $videoFiles = glob( "{$moviesPath}/{$this->Folder}/{$this->Folder}.{mkv,avi}", GLOB_BRACE ); if ( !count( $videoFiles ) ) { throw new InvalidArgumentException( "No files found matching pattern {$moviesPath}/{$this->Folder}/{$this->Folder}.{mkv,avi}" ); } $videoFiles = $videoFiles[0]; $generator->addInputFile( new MKVMergeMediaInputFile( $videoFiles ) ); // subtitle file(s), optional $subtitlesFiles = glob( "{$moviesPath}/{$this->Folder}/{$this->Folder}*.{srt,avi}", GLOB_BRACE ); if ( count( $subtitlesFiles ) ) { } foreach( $subtitlesFiles as $subtitlesFile ) { $generator->addInputFile( new MKVMergeSubtitleInputFile( $subtitlesFile, 'und' ) ); } $tracks = array(); foreach ( $generator->trackSets as $trackSet ) { foreach ( $trackSet as $track ) { $tracks[] = $track; } } // output file $generator->setOutputFile( "/media/storage/VIMES/Movies/{$this->Folder}/{$this->Folder}.mkv" ); $result->variables['tracks'] = $tracks; $result->variables['command'] = $generator->getCommandString(); $result->variables += mmApp::doMovies(); return $result; }
/** * @param AllocineId * @param MovieFolder */ public function doSaveNfo() { $result = new ezcMvcResult(); $result->variables += mmApp::doSaveNfo( $this->AllocineId, $this->Folder ); return $result; }