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

Commit

Permalink
feat: Added trait for function in common
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick committed Apr 18, 2019
1 parent e4cf1d5 commit fb1d108
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 52 deletions.
29 changes: 3 additions & 26 deletions src/Joserick/PHPlex/Server/Library/Section/Movie.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Joserick\Plex\Server\Library\Item\Plex_Server_Library_Item_Movie;
use Joserick\Plex\Server\Library\Plex_Server_Library_SectionAbstract;
use Joserick\Plex\Server\Library\Section\Plex_Server_Library_Section_FilmeTrait;

/**
* Plex Server Library Movie Section
Expand Down Expand Up @@ -44,6 +45,8 @@
class Plex_Server_Library_Section_Movie
extends Plex_Server_Library_SectionAbstract
{
use Plex_Server_Library_Section_FilmeTrait;

/**
* Endpoint for retrieving movies by four digit decade.
*/
Expand All @@ -59,11 +62,6 @@ class Plex_Server_Library_Section_Movie
*/
const ENDPOINT_CATEGORY_ACTOR = 'actor';

/**
* Endpoint for retrieving movies by content rating.
*/
const ENDPOINT_CATEGORY_CONTENT_RATING = 'contentRating';

/**
* Endpoint for retrieving movies by resolution.
*/
Expand Down Expand Up @@ -374,27 +372,6 @@ public function getActors()
)
);
}

/**
* Returns a list of content ratings for the section. We use makeCall
* directly here because we want to return just the raw array of content
* ratings and not do any post processing on it.
*
* @uses Plex_MachineAbstract::makeCall()
* @uses Plex_Server_Library::buildUrl()
* @uses Plex_Server_Library_SectionAbstract::buildEndpoint()
* @uses Plex_Server_Library_SectionAbstract::ENDPOINT_CATEGORY_CONTENT_RATING
*
* @return array An array of content ratings with their names and keys.
*/
public function getContentRatings()
{
return $this->makeCall(
$this->buildUrl(
$this->buildEndpoint(self::ENDPOINT_CATEGORY_CONTENT_RATING)
)
);
}

/**
* Returns a list of resolutions for the section. We use makeCall directly
Expand Down
29 changes: 3 additions & 26 deletions src/Joserick/PHPlex/Server/Library/Section/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Joserick\Plex\Server\Library\Plex_Server_Library_SectionAbstract;
use Joserick\Plex\Server\Library\Item\Plex_Server_Library_Item_Show;
use Joserick\Plex\Server\Library\Item\Plex_Server_Library_Item_Episode;
use Joserick\Plex\Server\Library\Section\Plex_Server_Library_Section_FilmeTrait;

/**
* Plex Server Library Show Section
Expand Down Expand Up @@ -45,16 +46,13 @@
class Plex_Server_Library_Section_Show
extends Plex_Server_Library_SectionAbstract
{
use Plex_Server_Library_Section_FilmeTrait;

/**
* Endpoint for retrieving recently viewed shows.
*/
const ENDPOINT_CATEGORY_RECENTLY_VIEWED_SHOWS = 'recentlyViewedShows';

/**
* Endpoint for retrieving shows by content rating.
*/
const ENDPOINT_CATEGORY_CONTENT_RATING = 'contentRating';

/**
* Returns all the shows for the given section.
*
Expand Down Expand Up @@ -231,27 +229,6 @@ public function getShowsByContentRating($contentRating)
)
);
}

/**
* Returns a list of content ratings for the section. We use makeCall
* directly here because we want to return just the raw array of content
* ratings and not do any post processing on it.
*
* @uses Plex_MachineAbstract::makeCall()
* @uses Plex_Server_Library::buildUrl()
* @uses Plex_Server_Library_SectionAbstract::buildEndpoint()
* @uses Plex_Server_Library_SectionAbstract::ENDPOINT_CATEGORY_CONTENT_RATING
*
* @return array An array of content ratings with their names and keys.
*/
public function getContentRatings()
{
return $this->makeCall(
$this->buildUrl(
$this->buildEndpoint(self::ENDPOINT_CATEGORY_CONTENT_RATING)
)
);
}

/**
* Searches show titles for the passed query and returns the shows that
Expand Down

0 comments on commit fb1d108

Please sign in to comment.