Compare commits
1 Commits
main
...
dev-downlo
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f0d29b92e |
@@ -1,2 +1,2 @@
|
|||||||
# $1 = movies/tvshows/etc, $2 = title of media, $3 = URL of download
|
# $1 = movies/tvshows/etc, $2 = title of media, $3 = URL of download
|
||||||
cd /var/download/${1} && if [ ! -d "${2}" ]; then mkdir "${2}"; fi && cd "${2}" && wget "${3}"
|
cd /var/download/${1} && if [ ! -d "${2}" ]; then mkdir "${2}"; fi && cd "${2}" && wget -c "${3}"
|
||||||
|
|||||||
@@ -37,4 +37,25 @@ class DownloadController extends AbstractController
|
|||||||
|
|
||||||
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
|
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/download/test', name: 'app_download_test', methods: ['GET'])]
|
||||||
|
public function downloadTest(
|
||||||
|
|
||||||
|
): Response {
|
||||||
|
$download = $this->downloadRepository->find(32);
|
||||||
|
try {
|
||||||
|
$this->bus->dispatch(new \App\Download\Action\Command\DownloadMediaCommand(
|
||||||
|
$download->getUrl(),
|
||||||
|
$download->getTitle(),
|
||||||
|
$download->getFilename(),
|
||||||
|
$download->getMediaType(),
|
||||||
|
$download->getImdbId(),
|
||||||
|
$download->getId(),
|
||||||
|
));
|
||||||
|
} catch (\Throwable $exception) {
|
||||||
|
return $this->json(['error' => $exception->getMessage()], Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class DownloadRepository extends ServiceEntityRepository
|
|||||||
$firstResult = ($pageNumber - 1) * $perPage;
|
$firstResult = ($pageNumber - 1) * $perPage;
|
||||||
$query = $this->createQueryBuilder('d')
|
$query = $this->createQueryBuilder('d')
|
||||||
->andWhere('d.status IN (:statuses)')
|
->andWhere('d.status IN (:statuses)')
|
||||||
->orderBy('d.id', 'DESC')
|
->orderBy('d.id', 'ASC')
|
||||||
->setParameter('statuses', ['New', 'In Progress'])
|
->setParameter('statuses', ['New', 'In Progress'])
|
||||||
->setFirstResult($firstResult)
|
->setFirstResult($firstResult)
|
||||||
->setMaxResults($perPage)
|
->setMaxResults($perPage)
|
||||||
@@ -66,6 +66,7 @@ class DownloadRepository extends ServiceEntityRepository
|
|||||||
->setImdbId($imdbId)
|
->setImdbId($imdbId)
|
||||||
->setMediaType($mediaType)
|
->setMediaType($mediaType)
|
||||||
->setBatchId($batchId)
|
->setBatchId($batchId)
|
||||||
|
->setProgress(0)
|
||||||
->setStatus($status);
|
->setStatus($status);
|
||||||
|
|
||||||
$this->getEntityManager()->persist($download);
|
$this->getEntityManager()->persist($download);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
{% for download in this.getDownloads() %}
|
{% for download in this.getDownloads() %}
|
||||||
<tr id="ad_download_{{ download.id }}">
|
<tr id="ad_download_{{ download.id }}">
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 min-w-[45ch] max-w-[45ch] truncate">
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 min-w-[45ch] max-w-[45ch] truncate">
|
||||||
{{ download.title }}
|
{{ download.filename }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50">
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50">
|
||||||
<span class="p-1.5 bg-purple-600 rounded-full">
|
<span class="p-1.5 bg-purple-600 rounded-full">
|
||||||
@@ -26,6 +26,11 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<tr class="bg-amber-600">
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-xs uppercase text-center col-span-2 font-medium text-gray-50 dark:text-gray-50" colspan="2">
|
||||||
|
<a href="#">View all active downloads</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-xs uppercase text-center col-span-2 font-medium text-gray-800 dark:text-stone-800" colspan="2">
|
<td class="px-6 py-4 whitespace-nowrap text-xs uppercase text-center col-span-2 font-medium text-gray-800 dark:text-stone-800" colspan="2">
|
||||||
|
|||||||
Reference in New Issue
Block a user