public function scanOutputAction(Storage $storage, Request $request)
    {
        $filename = $this->container->getParameter('anime_db.catalog.storage.scan_output');
        $filename = sprintf($filename, $storage->getId());
        if (!file_exists($filename)) {
            throw $this->createNotFoundException('Log file is not found');
        }

        $log = file_get_contents($filename);
        $is_end = $this->isEndOfLog($log);

        // force stop scan progress
        if ($is_end) {
            $this->get('anime_db.storage.scan_executor')->forceStopScan($storage);
        }

        return LogResponse::logOffset($log, $request->query->get('offset', 0), $is_end);
    }
public function scanOutputAction(Storage $storage, Request $request)
    {
        $filename = $this->container->getParameter('anime_db.catalog.storage.scan_output');
        $filename = sprintf($filename, $storage->getId());
        if (!file_exists($filename)) {
            throw $this->createNotFoundException('Log file is not found');
        }

        $log = file_get_contents($filename);
        $is_end = $this->isEndOfLog($log);

        // force stop scan progress
        if ($is_end) {
            $this->get('anime_db.storage.scan_executor')->forceStopScan($storage);
        }

        return LogResponse::logOffset($log, $request->query->get('offset', 0), $is_end);
    }
public function scanOutputAction ( Storage $ storage , Request $ request ) { $ filename = $ this -> container -> getParameter ( 'anime_db.catalog.storage.scan_output' ) ; $ filename = sprintf ( $ filename , $ storage -> getId ( ) ) ; if ( ! file_exists ( $ filename ) ) { throw $ this -> createNotFoundException ( 'Log file is not found' ) ; } $ log = file_get_contents ( $ filename ) ; $ is_end = $ this -> isEndOfLog ( $ log ) ; // force stop scan progress if ( $ is_end ) { $ this -> get ( 'anime_db.storage.scan_executor' ) -> forceStopScan ( $ storage ) ; } return LogResponse :: logOffset ( $ log , $ request -> query -> get ( 'offset' , 0 ) , $ is_end ) ; }
Get storage scan output.

@param Storage $storage
@param Request $request

@return JsonResponse
Get storage scan output .