Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
fix: Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick committed Apr 21, 2019
1 parent 7e51148 commit 972afd0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $server = $plex->getServer('my_server');
```php
// First get a section of type movie.
$section = $server->getLibrary()->getSection('Movies');
$movies = $section->getUnwatchedMovies();
$movies = $section->getUnwatched();
foreach ($movies as $movie){
echo $movie->title;
}
Expand All @@ -78,28 +78,28 @@ foreach ($movies as $movie){
```php
$clients = $plex->getAllClients();
foreach ($clients as $client){
echo $client->name;
echo $client->getName();
}
// Get a client specific.
$client_version = $plex->getClient('Chrome')->version;
```
### Example 3: List all genre in a section type movie.
### Example 3: List all genres in a section of type movie.
```php
$section = $server->getLibrary()->getSection('TV Shows')->```
$section = $server->getLibrary()->getSection('TV Shows')->
foreach ($section->getGenres() as $genre){
echo $genre->title;
echo $genre->getName();
}
```
### Example 4: List all movies in a section with the word 'Terminator' in the title.
```php
$section = $server->getLibrary()->getSection('Movies');
foreach ($section->searchMovies('terminator') as $movie){
echo $movie->name;
foreach ($section->search('terminator') as $movie){
echo $movie->getTitle();
}
```
### Example 5: List all file for the latest episode of 'Friends'.
```php
$last_episode = $server->getLibrary()->getSection('TV Shows')->getShow('Friends')->getEpisodes()[-1];
$last_episode = $server->getLibrary()->getSection('TV Shows')->get('Friends')->getEpisodes()[-1];
foreach ($last_episode->getMedia()->getFiles() as $file){
echo $file->getPath();
}
Expand Down

0 comments on commit 972afd0

Please sign in to comment.