Skip to content

Commit

Permalink
v2.11.4 Community Updates**\
Browse files Browse the repository at this point in the history
Enhancement: Images to the bottom of Now Showing for resolution, sound format, and aspect ratio (Issue MattsShack#74)
- Create GIMP template file for all icons for 'Presented' mode
- Add support for resolution display
- Add support for rating display
- TODO:
    - Add support for sound format
    - Add support for aspect ratio
    - Add support for changing 'font color' for 'PRESENTED IN' text
    - Add icons for 720p & 1080p (explicit)
- BUG(s):
    - If playing a lower quality video the 'current' video resolution is not displayed.
  • Loading branch information
ZeroCoolGOS committed Mar 30, 2021
1 parent 29c6079 commit c1a40cb
Show file tree
Hide file tree
Showing 32 changed files with 352 additions and 35 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ ignore:
sha: []
merge-message-formats: {}
mode: ContinuousDelivery
next-version: 2.11.3
next-version: 2.11.4
165 changes: 165 additions & 0 deletions assets/plexmovieposter/PMPDLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,171 @@ function SetFullScreenMode($SetMode = FALSE) {
}
}

function PMPD_DisplayMediaInfo(){
// Global Variables - Input
global $mediaContentRating, $mediaVideoCodec, $mediaVideoResolution, $mediaAudioCodec, $mediaAudioChannelLayout;

// Global Variables - Output
global $bottomLine;

$iconPath = "assets/plexmovieposter/images/icons/mediaInfo";

$title = "PRESENTED IN";

$iconSizeWidth = "20%";

// https://www.spectrum.net/support/tv/tv-and-movie-ratings-descriptions/

switch ($mediaContentRating) {
case "TV-Y":
$contentRatingProfile = "$iconPath/Rated-TVY.png";
break;
case "TV-Y7":
$contentRatingProfile = "$iconPath/Rated-TVY7.png";
break;
case "TV-Y7 FV":
$contentRatingProfile = "$iconPath/Rated-TVY7FV.png";
break;
case "G":
$contentRatingProfile = "$iconPath/Rated-G.png";
break;
case "TV-G":
$contentRatingProfile = "$iconPath/Rated-TVG.png";
break;
case "PG":
$contentRatingProfile = "$iconPath/Rated-PG.png";
break;
case "TV-PG":
$contentRatingProfile = "$iconPath/Rated-TVPG.png";
break;
case "PG-13":
$contentRatingProfile = "$iconPath/Rated-PG13.png";
break;
case "TV-14":
$contentRatingProfile = "$iconPath/Rated-TV14.png";
break;
case "R":
$contentRatingProfile = "$iconPath/Rated-R.png";
break;
case "TV-MA":
$contentRatingProfile = "$iconPath/Rated-TVMA.png";
break;
case "NC-17":
$contentRatingProfile = "$iconPath/Rated-NC17.png";
break;
case "XXX":
$contentRatingProfile = "$iconPath/Rated-XXX.png";
break;
default:
$contentRatingProfile = "$iconPath/Rated-NA.png";
break;
}

switch ($mediaVideoResolution) {
case "sd":
$videoResolutionProfile = "$iconPath/Res-SD.png";
break;
case "720":
$videoResolutionProfile = "$iconPath/Res-HD720.png";
break;
case "720p":
$videoResolutionProfile = "$iconPath/Res-HD720.png";
break;
case "1080":
$videoResolutionProfile = "$iconPath/Res-HD1080.png";
break;
case "1080p":
$videoResolutionProfile = "$iconPath/Res-HD1080.png";
break;
case "4k":
$videoResolutionProfile = "$iconPath/Res-UHD4K.png";
break;
case "8k":
$videoResolutionProfile = "$iconPath/Res-UHD8K.png";
break;
default:
$videoResolutionProfile = "";
break;
}

switch ($mediaVideoCodec) {
case "h264":
$videoCodecProfile = "";
break;
case "mpeg4":
$videoCodecProfile = "";
break;
case "hevc":
$videoCodecProfile = "";
break;
default:
$videoCodecProfile = "";
break;
}

switch ($mediaAudioCodec) {
case "aac":
$audioCodecProfile = "";
break;
case "ac3":
$audioCodecProfile = "";
break;
case "eac3":
$audioCodecProfile = "";
break;
case "dca":
$audioCodecProfile = "";
break;
case "dca-ma":
$audioCodecProfile = "";
break;
case "mp3":
$audioCodecProfile = "";
break;
case "opus":
$audioCodecProfile = "";
break;
default:
$audioCodecProfile = "";
break;
}

switch ($mediaAudioChannelLayout) {
case "mono":
$audioChannelLayoutProfile = "";
break;
case "stereo":
$audioChannelLayoutProfile = "";
break;
case "5.1":
$audioChannelLayoutProfile = "";
break;
case "7.1":
$audioChannelLayoutProfile = "$iconPath/Dolby_TRUEHD71.png";
break;
default:
$audioCodecProfile = "";
break;
}

$profileHeader = "";
$titleProfile = "<div style=\"font-size:10px\">$title <p><p>";

$contentRatingProfile = "<img src=\"$contentRatingProfile\" width=$iconSizeWidth>";
$videoResolutionProfile = "<img src=\"$videoResolutionProfile\" width=$iconSizeWidth>";
$videoCodecProfile = "<img src=\"$videoCodecProfile\" width=$iconSizeWidth>";
$audioCodecProfile = "<img src=\"$audioCodecProfile\" width=$iconSizeWidth>";
$audioChannelLayoutProfile = "<img src=\"$audioChannelLayoutProfile\" width=$iconSizeWidth>";

$profileFooter = "</div>";

$mediaProfiles = "$videoResolutionProfile $videoCodecProfile $audioChannelLayoutProfile $contentRatingProfile";

$masterProfile = "$profileHeader $titleProfile $mediaProfiles $profileFooter";

$bottomLine = $masterProfile;
}

function PMPD_SetResults() {

// Global Variables - Input
Expand Down
131 changes: 118 additions & 13 deletions assets/plexmovieposter/PlexLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function plex_metadata_audioCodec($mediaType = "episode", $isPlayingMode = FALSE
// Notes: audioCodec
//

// contentRating
// Audio Codec
switch ($mediaType) {
case "episode":
$media_metadata_name = 'audioCodec';
Expand All @@ -345,12 +345,12 @@ function plex_metadata_audioCodec($mediaType = "episode", $isPlayingMode = FALSE
$media_logClass = "PLEX_getTVMetadata";
}

if ($isPlayingMode == TRUE) {
// if ($isPlayingMode == TRUE) {
$mediaAudioCodec = $clients->Media[$media_metadata_name];
}
else {
$mediaAudioCodec = "N/A";
}
// }
// else {
// $mediaAudioCodec = "N/A";
// }

// $media_MetadataID_TMP = preg_split("#/#", $mediaAudioCodec);
// $media_MetadataID = $media_MetadataID_TMP[3];
Expand All @@ -360,6 +360,58 @@ function plex_metadata_audioCodec($mediaType = "episode", $isPlayingMode = FALSE
pmp_Logging("$media_logClass", "\tmediaAudioCodec @ $mediaType ($media_metadata_name) - \"$mediaAudioCodec\"");
}

function plex_metadata_audioChannelLayout($mediaType = "episode", $isPlayingMode = FALSE) {
global $clients, $isPlaying;
global $mediaAudioChannelLayout, $mediaAudioChannelLayout_MetadataID;

$media_MetadataID_STR = "";

// Notes: audioChannelLayout
//

// Audio Codec
switch ($mediaType) {
case "episode":
$media_metadata_name = 'audioChannelLayout';
$media_logClass = "PLEX_getTVMetadata";
break;
case "season":
$media_metadata_name = 'audioChannelLayout';
$media_logClass = "PLEX_getTVMetadata";
break;
case "series":
$media_metadata_name = 'audioChannelLayout';
$media_logClass = "PLEX_getTVMetadata";
break;
case "movie":
$media_metadata_name = 'audioChannelLayout';
$media_logClass = "PLEX_getMovieMetadata";
break;
case "track":
$media_metadata_name = 'audioChannelLayout';
$media_logClass = "PLEX_getMusicMetadata";
break;
default:
$media_metadata_name = 'audioChannelLayout';
$media_logClass = "PLEX_getTVMetadata";
}

// if ($isPlayingMode == TRUE) {
$rootElement = $clients->Media->Part->Stream[0];
$mediaAudioChannelLayout = $rootElement[$media_metadata_name];
// }
// else {
// $mediaAudioChannelLayout = "N/A";
// }

// $media_MetadataID_TMP = preg_split("#/#", $mediaAudioChannelLayout);
// $media_MetadataID = $media_MetadataID_TMP[3];
// $media_MetadataID_STR = "(metadata ID: $media_MetadataID)";

// $mediaAudioChannelLayout_MetadataID = $media_MetadataID;
pmp_Logging("$media_logClass", "\tmediaAudioChannelLayout @ $mediaType ($media_metadata_name) - \"$mediaAudioChannelLayout\"");
}

function plex_metadata_videoCodec($mediaType = "episode", $isPlayingMode = FALSE) {
global $clients, $isPlaying;
global $mediaVideoCodec, $mediaVideoCodec_MetadataID;
Expand Down Expand Up @@ -396,12 +448,12 @@ function plex_metadata_videoCodec($mediaType = "episode", $isPlayingMode = FALSE
$media_logClass = "PLEX_getTVMetadata";
}

if ($isPlayingMode == TRUE) {
// if ($isPlayingMode == TRUE) {
$mediaVideoCodec = $clients->Media[$media_metadata_name];
}
else {
$mediaVideoCodec = "N/A";
}
// }
// else {
// $mediaVideoCodec = "N/A";
// }

// $media_MetadataID_TMP = preg_split("#/#", $mediaVideoCodec);
// $media_MetadataID = $media_MetadataID_TMP[3];
Expand All @@ -411,6 +463,57 @@ function plex_metadata_videoCodec($mediaType = "episode", $isPlayingMode = FALSE
pmp_Logging("$media_logClass", "\tmediaVideoCodec @ $mediaType ($media_metadata_name) - \"$mediaVideoCodec\"");
}

function plex_metadata_videoResolution($mediaType = "episode", $isPlayingMode = FALSE) {
global $clients, $isPlaying;
global $mediaVideoResolution, $mediaVideoResolution_MetadataID;

$media_MetadataID_STR = "";

// Notes: videoResolution
//

// videoResolution
switch ($mediaType) {
case "episode":
$media_metadata_name = 'videoResolution';
$media_logClass = "PLEX_getTVMetadata";
break;
case "season":
$media_metadata_name = 'videoResolution';
$media_logClass = "PLEX_getTVMetadata";
break;
case "series":
$media_metadata_name = 'videoResolution';
$media_logClass = "PLEX_getTVMetadata";
break;
case "movie":
$media_metadata_name = 'videoResolution';
$media_logClass = "PLEX_getMovieMetadata";
break;
case "track":
$media_metadata_name = 'videoResolution';
$media_logClass = "PLEX_getMusicMetadata";
break;
default:
$media_metadata_name = 'videoResolution';
$media_logClass = "PLEX_getTVMetadata";
}

// if ($isPlayingMode == TRUE) {
$mediaVideoResolution = $clients->Media[$media_metadata_name];
// }
// else {
// $mediaVideoResolution = "N/A";
// }

// $media_MetadataID_TMP = preg_split("#/#", $mediaVideoResolution);
// $media_MetadataID = $media_MetadataID_TMP[3];
// $media_MetadataID_STR = "(metadata ID: $media_MetadataID)";

// $mediaVideoResolution_MetadataID = $media_MetadataID;
pmp_Logging("$media_logClass", "\tmediaVideoResolution @ $mediaType ($media_metadata_name) - \"$mediaVideoResolution\"");
}

function plex_metadata_audioDisplay($mediaType = "episode", $isPlayingMode = FALSE) {
global $clients, $isPlaying;
global $mediaAudioDisplay, $mediaAudioDisplay_MetadataID;
Expand Down Expand Up @@ -981,11 +1084,13 @@ function plex_metadata_PROCESS() {
plex_metadata_thumb("$mediaType", $ComingSoonMode); // COMING SOON MODE
plex_metadata_art("$mediaType");
plex_metadata_contentRating("$mediaType");
plex_metadata_audioCodec("$mediaType");
plex_metadata_audioChannelLayout("$mediaType");
plex_metadata_videoCodec("$mediaType");
plex_metadata_videoResolution("$mediaType");

if ($isPlaying == TRUE) {
plex_metadata_decision("$mediaType", $isPlayingMode); // isPlaying Mode
plex_metadata_audioCodec("$mediaType", $isPlayingMode); // isPlaying Mode
plex_metadata_videoCodec("$mediaType", $isPlayingMode); // isPlaying Mode
plex_metadata_audioDisplay("$mediaType", $isPlayingMode); // isPlaying Mode
plex_metadata_videoDisplay("$mediaType", $isPlayingMode); // isPlaying Mode
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/plexmovieposter/setData.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function setData($configPage) {
\$comingSoonTopAutoScale = '$_POST[comingSoonTopAutoScale]'; // Default: FALSE
// Coming Soon Configuration - Bottom Settings
\$comingSoonBottom = '$_POST[comingSoonBottom]'; // Default: custom (title/summary/tagline/custom)
\$comingSoonBottom = '$_POST[comingSoonBottom]'; // Default: custom (title/summary/tagline/presented/custom)
\$comingSoonBottomText = '$_POST[comingSoonBottomText]';
\$comingSoonBottomFontSize = '$_POST[comingSoonBottomFontSize]'; // Default: 25 (px)
\$comingSoonBottomFontColor = '$_POST[comingSoonBottomFontColor]'; // Default: #FFFFFF (White)
Expand Down Expand Up @@ -494,7 +494,7 @@ function setData($configPage) {
\$nowShowingTopAutoScale = '$_POST[nowShowingTopAutoScale]'; // Default: FALSE
// Now Showing Configuration - Bottom Settings
\$nowShowingBottom = '$_POST[nowShowingBottom]'; // Default: title (title/summary/tagline/custom)
\$nowShowingBottom = '$_POST[nowShowingBottom]'; // Default: title (title/summary/tagline/presented/custom)
\$nowShowingBottomText = '$_POST[nowShowingBottomText]';
\$nowShowingBottomFontSize = '$_POST[nowShowingBottomFontSize]'; // Default: 25 (px)
\$nowShowingBottomFontColor = '$_POST[nowShowingBottomFontColor]'; // Default: #FFFFFF (White)
Expand Down
2 changes: 1 addition & 1 deletion build/DockerSetup.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ portexternal = 80
portinternal = 80
osplatform = linux
imagenameroot = plexmovieposterdisplay
tag = 2.11.3
tag = 2.11.4
dockerfileroot = ../.
imagetype =
networktype =
Expand Down
2 changes: 1 addition & 1 deletion build/UpdateVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def UpdatePHP(DisplayMSG=False,ConfigSegment="DEFAULT",ConfigKey="version",Confi
# there for there might be trailing data we need to truncate away.

DisplayMSG = False
SetVersion = "2.11.3"
SetVersion = "2.11.4"

PYScriptRoot = os.path.abspath(os.path.dirname(__file__))

Expand Down
Loading

0 comments on commit c1a40cb

Please sign in to comment.