Fix: Last Played Media Title persists in plex (#9664)
Fix: Last Played Media Title persists in plex (#9664)

* Fix: Last Played Media Title in plex would stay even when player was idle/off
     Primary Fix is in the "if self._device" portion.
     code in "if self._session" is a catch all but i'm not 100% if it is needed.

* Fixed lint issues with previous commit

* 1st Pass at refactoring plex refresh
Moved _media** into clearMedia() which is called in _init_ and
at start of refresh.

Removed redunant _media_* = None entries

Grouped TV Show and Music under single if rather than testing
seperately for now.

* Fixed invalid name for _clearMedia()
Removed another media_* = None entry

* Removed print() statements used for debug

* Removed unneeded "if" statement

soldag/home-assistant,PetePriority/home-assistant,jabesq/home-assistant,FreekingDean/home-assistant,tboyce1/home-assistant,lukas-hetzenecker/home-assistant,toddeye/home-assistant,HydrelioxGitHub/home-assistant,Teagan42/home-assistant,Cinntax/home-assistant,PetePriority/home-assistant,adrienbrault/home-assistant,jamespcole/home-assistant,tboyce1/home-assistant,PetePriority/home-assistant,rohitranjan1991/home-assistant,mKeRix/home-assistant,mezz64/home-assistant,aequitas/home-assistant,fbradyirl/home-assistant,turbokongen/home-assistant,molobrakos/home-assistant,pschmitt/home-assistant,postlund/home-assistant,jnewland/home-assistant,stefan-jonasson/home-assistant,MartinHjelmare/home-assistant,aequitas/home-assistant,fbradyirl/home-assistant,partofthething/home-assistant,HydrelioxGitHub/home-assistant,auduny/home-assistant,mKeRix/home-assistant,Danielhiversen/home-assistant,jamespcole/home-assistant,postlund/home-assistant,persandstrom/home-assistant,tchellomello/home-assistant,Danielhiversen/home-assistant,qedi-r/home-assistant,rohitranjan1991/home-assistant,auduny/home-assistant,ewandor/home-assistant,nkgilley/home-assistant,rohitranjan1991/home-assistant,FreekingDean/home-assistant,Cinntax/home-assistant,jawilson/home-assistant,stefan-jonasson/home-assistant,tboyce1/home-assistant,joopert/home-assistant,toddeye/home-assistant,stefan-jonasson/home-assistant,w1ll1am23/home-assistant,adrienbrault/home-assistant,nugget/home-assistant,molobrakos/home-assistant,robbiet480/home-assistant,home-assistant/home-assistant,jnewland/home-assistant,tchellomello/home-assistant,leppa/home-assistant,titilambert/home-assistant,Teagan42/home-assistant,nkgilley/home-assistant,joopert/home-assistant,GenericStudent/home-assistant,leppa/home-assistant,jawilson/home-assistant,jamespcole/home-assistant,jabesq/home-assistant,kennedyshead/home-assistant,stefan-jonasson/home-assistant,w1ll1am23/home-assistant,nugget/home-assistant,MartinHjelmare/home-assistant,tboyce1/home-assistant,DavidLP/home-assistant,ewandor/home-assistant,DavidLP/home-assistant,MartinHjelmare/home-assistant,aronsky/home-assistant,turbokongen/home-assistant,kennedyshead/home-assistant,tboyce021/home-assistant,aronsky/home-assistant,sander76/home-assistant,ewandor/home-assistant,nugget/home-assistant,qedi-r/home-assistant,persandstrom/home-assistant,sander76/home-assistant,DavidLP/home-assistant,balloob/home-assistant,titilambert/home-assistant,pschmitt/home-assistant,persandstrom/home-assistant,tinloaf/home-assistant,tinloaf/home-assistant,tinloaf/home-assistant,sdague/home-assistant,robbiet480/home-assistant,jnewland/home-assistant,auduny/home-assistant,fbradyirl/home-assistant,home-assistant/home-assistant,sdague/home-assistant,molobrakos/home-assistant,tboyce021/home-assistant,GenericStudent/home-assistant,partofthething/home-assistant,aequitas/home-assistant,balloob/home-assistant,balloob/home-assistant,mezz64/home-assistant,HydrelioxGitHub/home-assistant,lukas-hetzenecker/home-assistant,soldag/home-assistant,mKeRix/home-assistant,jabesq/home-assistant,mKeRix/home-assistant