Skip to content

[bug] Episode AirDate has wrong value when TMDB api returns empty #242

@ptheofan

Description

@ptheofan
$season = $repo->load(71712, 5);  // The good doctor, current season
$episodes = $season->getEpisodes();
$episodes[5]->getAirDate(); // should be null, atm episodes 6-10 have no air-date

// currently the return value is a DateTime of 2021-09-21 19:31:17.648338 (which is the actual UTC time at the moment the code was run)

Here's the actual response from the TMDB Api
Actual Response from TMDB API

After doing some digging the problem is here (TMDB Api return empty string, but the inflator checks for null)
image

if (!$airDate instanceof DateTime && $airDate !== null) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions