wip: working episode pagination, season switcher, monitor only new content

This commit is contained in:
2025-06-19 13:30:22 -05:00
parent 20d397589a
commit e070b95a36
20 changed files with 378 additions and 42 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Tmdb;
use Aimeos\Map;
use App\Enum\MediaType;
use App\ValueObject\ResultFactory;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
@@ -97,6 +98,16 @@ class Tmdb
return $this->parseResult($movies[$movie], "movie");
});
$movies = Map::from($movies->toArray())->filter(function ($movie) {
return $movie !== null
&& $movie->imdbId !== null
&& $movie->tmdbId !== null
&& $movie->title !== null
&& $movie->poster !== null
&& $movie->description !== null
&& $movie->mediaType !== null;
});
$movies = array_values($movies->toArray());
if (null !== $limit) {
@@ -114,6 +125,16 @@ class Tmdb
return $this->parseResult($movies[$movie], "movie");
});
$movies = Map::from($movies->toArray())->filter(function ($movie) {
return $movie !== null
&& $movie->imdbId !== null
&& $movie->tmdbId !== null
&& $movie->title !== null
&& $movie->poster !== null
&& $movie->description !== null
&& $movie->mediaType !== null;
});
$movies = array_values($movies->toArray());
if (null !== $limit) {