fix: adds download record at time of download
This commit is contained in:
@@ -21,14 +21,19 @@ readonly class DownloadMediaHandler implements HandlerInterface
|
||||
|
||||
public function handle(CommandInterface $command): ResultInterface
|
||||
{
|
||||
$download = $this->downloadRepository->insert(
|
||||
$command->url,
|
||||
$command->title,
|
||||
$command->filename,
|
||||
$command->imdbId,
|
||||
$command->mediaType,
|
||||
""
|
||||
);
|
||||
if (null === $command->downloadId) {
|
||||
$download = $this->downloadRepository->insert(
|
||||
$command->url,
|
||||
$command->title,
|
||||
$command->filename,
|
||||
$command->imdbId,
|
||||
$command->mediaType,
|
||||
""
|
||||
);
|
||||
} else {
|
||||
$download = $this->downloadRepository->find($command->downloadId);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$this->downloadRepository->updateStatus($download->getId(), 'In Progress');
|
||||
|
||||
Reference in New Issue
Block a user