Skip to content

Cannot seem to access seasons in TV shows #16

@delovelady

Description

@delovelady

I have the following simple code:

    $librarySections = $client->getLibrarySections();
    foreach ($librarySections['Directory'] as $directoryNumber => $directoryAttributes) {
        if ($directoryAttributes['type'] == 'show') {
            $key = $directoryAttributes['key'] ;
            $collection = $client->getLibrarySectionContents($key, true) ;
            foreach ($collection as $TVShow) {
                $title = $TVShow->title ;
                $children = $TVShow->getChildren() ;
                printf("%2d %s\n", $title, count($children)) ;
                $unusedVar = true ;
            }
        }
    }

This dies with error "Error: Call to undefined method jc21\TV\Show::getChildren()"

I also tried to access $TVShow->seasons and $TVShow->Seasons and so on... to no avail.

Ultimately, I want to list the number of seasons for each show and the number of episodes for each season. But it seems that seasons are not accessible through the show???

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions