public function scanProgressAction(Storage $storage)
    {
        $filename = $this->container->getParameter('anime_db.catalog.storage.scan_progress');
        $filename = sprintf($filename, $storage->getId());
        if (!file_exists($filename)) {
            throw $this->createNotFoundException('The progress status cannot be read');
        }

        $log = trim(file_get_contents($filename), " \r\n%");

        return new JsonResponse(['status' => ($log != '' ? intval($log) : 100)]);
    }
public function scanProgressAction(Storage $storage)
    {
        $filename = $this->container->getParameter('anime_db.catalog.storage.scan_progress');
        $filename = sprintf($filename, $storage->getId());
        if (!file_exists($filename)) {
            throw $this->createNotFoundException('The progress status cannot be read');
        }

        $log = trim(file_get_contents($filename), " \r\n%");

        return new JsonResponse(['status' => ($log != '' ? intval($log) : 100)]);
    }
public function scanProgressAction ( Storage $ storage ) { $ filename = $ this -> container -> getParameter ( 'anime_db.catalog.storage.scan_progress' ) ; $ filename = sprintf ( $ filename , $ storage -> getId ( ) ) ; if ( ! file_exists ( $ filename ) ) { throw $ this -> createNotFoundException ( 'The progress status cannot be read' ) ; } $ log = trim ( file_get_contents ( $ filename ) , " \r\n%" ) ; return new JsonResponse ( [ 'status' => ( $ log != '' ? intval ( $ log ) : 100 ) ] ) ; }
Get storage scan progress.

@param Storage $storage

@return JsonResponse
Get storage scan progress .