Пример #1
0
        private void UpdateCurrently(Plugin.ApiCurrently nowPlaying)
        {
            _isPlaying = true;
            //SupportsRemoteControl Changes - Check Below:
            UpdateButtonVisibility();
            Logger.Instance().LogDump("Yatse PVR", "MediaType equals:" + nowPlaying.MediaType, true);
            switch (nowPlaying.MediaType)
            {
            case "Audio":
                Logger.Instance().Log("FrontView+", "New Music Media : " + nowPlaying.FileName);
                _yatse2Properties.Currently.IsMusic     = true;
                _yatse2Properties.Currently.MusicAlbum  = nowPlaying.Album;
                _yatse2Properties.Currently.MusicSong   = nowPlaying.Title;
                _yatse2Properties.Currently.MusicArtist = nowPlaying.Artist;
                _yatse2Properties.Currently.Fanart      = _config.MusicFanartRotation ? GetRandomImagePath(Helper.CachePath + @"Music\Fanarts") : GetMusicFanartPath(nowPlaying.FanartURL);

                // Wholesale change coming up......  Move away from DB for Currently Info, instead move to extrafanart for the artist detected....
                // Looks good - should do the same for Video Now Playing info screen

                Logger.Instance().LogDump("UpdateAUDIO", "Config Rotation:Currently Fanart equals:" + _yatse2Properties.Currently.Fanart, true);
                Logger.Instance().LogDump("UpdateAUDIO", "Config GetMusicFanartPath equals:" + GetMusicFanartPath(nowPlaying.FanartURL), true);


                var testaudiofanart = KodiSourceData.KodiMusicSources[0] + nowPlaying.Artist + @"\extrafanart\";

                foreach (var musicsource in KodiSourceData.KodiMusicSources)
                {
                    if (musicsource != null)
                    {
                        var testaudiofanartcheck = musicsource + nowPlaying.Artist + @"\extrafanart\";
                        Logger.Instance().LogDump("UpdateAUDIO ARRAY", "Checking all sources " + testaudiofanartcheck);
                        if (System.IO.Directory.Exists(testaudiofanartcheck))
                        {
                            Logger.Instance().LogDump("UpdateAUDIO ARRAY", "Directory Exists Usings - No check for contents though " + testaudiofanartcheck);
                            testaudiofanart = testaudiofanartcheck;
                            break;
                        }
                    }
                }

                //var testaudiofanart = KodiSourceData.KodiMusicSources[0] + nowPlaying.Artist + @"\extrafanart\";
                Logger.Instance().LogDump("UpdateAUDIO", "testfanart equals:" + testaudiofanart, true);
                Logger.Instance().LogDump("UpdateAUDIO", "GetRandomImagePath ==:" + GetRandomImagePath(testaudiofanart), true);


                if (!_config.MusicFanartRotation && GetRandomImagePath(testaudiofanart) != null)
                {
                    Logger.Instance().LogDump("UpdateAUDIO", "Currently.Fanart set to testaudiofanart:", true);
                    var FanartPathFilename = GetRandomImagePath(testaudiofanart);
                    var FanartisLocked     = true;
                    FanartisLocked = IsFileLocked(FanartPathFilename);
                    if (FanartisLocked == false)
                    {
                        Logger.Instance().LogDump("UpdateAUDIO", "Fanart File is not locked using " + FanartPathFilename, true);
                        _yatse2Properties.Currently.Fanart = FanartPathFilename;
                    }
                    if (FanartisLocked == true)
                    {
                        Logger.Instance().LogDump("UpdateAUDIO", "Fanart File is locked/using Default", true);
                        _yatse2Properties.Currently.Fanart = Helper.SkinPath + _config.Skin + @"\Interface\Default_Diaporama.png";
                    }
                }


                Logger.Instance().LogDump("UpdateAUDIO", "nowPlaying FanartURL:" + nowPlaying.FanartURL, true);
                Logger.Instance().LogDump("UpdateAUDIO", "Currently Fanart equals:" + _yatse2Properties.Currently.Fanart, true);
                _yatse2Properties.Currently.Thumb = GetMusicThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter
                Logger.Instance().LogDump("UpdateAUDIO", "Currently Thumb equals:" + _yatse2Properties.Currently.Thumb, true);
                _yatse2Properties.Currently.MusicYear  = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                _yatse2Properties.Currently.MusicTrack = nowPlaying.Track.ToString(CultureInfo.InvariantCulture);
                _yatse2Properties.Currently.MusicGenre = nowPlaying.Genre;


                var NowPlayingFile = SortOutPath(nowPlaying.FileName);
                try
                {
                    var pathfilename = Path.GetDirectoryName(NowPlayingFile);
                    Logger.Instance().LogDump("UpdateAUDIO", "Thumbnail:  Nowplaying Get DirectoryName" + pathfilename, true);
                    if (File.Exists(pathfilename + @"\cdart.png"))
                    {
                        _yatse2Properties.Currently.Thumb = pathfilename + @"\cdart.png";
                    }
                }
                catch (Exception ex)
                {
                    Logger.Instance().LogDump("Thumb Exception", "Thumbnail Exception Caught" + ex, true);
                }

                //Change Thumb if using Google play - recognise googleusercontent in string

                try
                {
                    var pathfilename = NowPlayingFile;
                    if (pathfilename.Contains("googleusercontent"))
                    {
                        Logger.Instance().LogDump("UpdateAUDIO", "Thumb GooglePlay:  Update to Skin Thumb", true);

                        if (File.Exists(Helper.SkinPath + _config.Skin + @"\Interface\Default_Music-ThumbGoogle.png"))
                        {
                            _yatse2Properties.Currently.Thumb = Helper.SkinPath + _config.Skin + @"\Interface\Default_Music-ThumbGoogle.png";
                            Logger.Instance().LogDump("UpdateAUDIO", "Thumb GooglePlay:  Changing to Google Thumb" + _yatse2Properties.Currently.Thumb, true);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.Instance().LogDump("Thumb Exception", "Thumbnail Exception Caught" + ex, true);
                }

                var songinfo = _database.GetAudioSongFromFile(_remoteInfo.Id, nowPlaying.FileName);
                if (songinfo.Count > 0)
                {
                    var artistinfo = _database.GetAudioArtistFromName(_remoteInfo.Id, songinfo[0].Artist);
                    _yatse2Properties.Currently.MusicBiography = artistinfo.Count > 0 ? artistinfo[0].Biography : "No information";
                    if (!_config.MusicFanartRotation)
                    {
                        _yatse2Properties.Currently.Fanart = artistinfo.Count > 0 ? GetMusicFanartPath(artistinfo[0].Fanart) : "";
                    }
                    Logger.Instance().LogDump("UpdateAUDIO", "Config Rotation:Currently Fanart equals:" + _yatse2Properties.Currently.Fanart, true);
                }
                AudioStarting();

                break;

            case "TvShow":
                Logger.Instance().Log("FrontView+", "New TvShow Media : " + nowPlaying.FileName);
                _yatse2Properties.Currently.IsTv  = true;
                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter
                var epinfo = _database.GetTvEpisodeFromFile(_remoteInfo.Id, nowPlaying.FileName);
                if (epinfo.Count > 0)
                {
                    _yatse2Properties.Currently.TvShow    = epinfo[0].ShowTitle + " - " + epinfo[0].Title;
                    _yatse2Properties.Currently.TvTitle   = epinfo[0].Title;
                    _yatse2Properties.Currently.TvAired   = epinfo[0].Date;
                    _yatse2Properties.Currently.TvPlot    = epinfo[0].Plot;
                    _yatse2Properties.Currently.TvEpisode = GetLocalizedString(77) + " " + epinfo[0].Season + " " + GetLocalizedString(78) + " " + epinfo[0].Episode;
                    _yatse2Properties.Currently.TvNote    = epinfo[0].Rating;
                    var showinfo = _database.GetTvShowFromName(_remoteInfo.Id, epinfo[0].ShowTitle);
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(showinfo.Count > 0 ? showinfo[0].Fanart : nowPlaying.FanartURL); // TODO : Change to Covnerter
                    _yatse2Properties.Currently.TvStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + epinfo[0].Studio + ".png";
                    _yatse2Properties.Currently.TvDirector = epinfo[0].Director;
                    _yatse2Properties.Currently.TvYear     = epinfo[0].Date.Length > 3 ? epinfo[0].Date.Substring(0, 4) : epinfo[0].Date;
                    _yatse2Properties.Currently.TvVotes    = "";
                }
                else
                {
                    _yatse2Properties.Currently.TvShow     = nowPlaying.ShowTitle + " - S" + nowPlaying.SeasonNumber + " E" + nowPlaying.EpisodeNumber;
                    _yatse2Properties.Currently.TvTitle    = nowPlaying.Title;
                    _yatse2Properties.Currently.TvAired    = nowPlaying.FirstAired.ToShortDateString();
                    _yatse2Properties.Currently.TvPlot     = nowPlaying.Plot;
                    _yatse2Properties.Currently.TvEpisode  = GetLocalizedString(77) + " " + nowPlaying.SeasonNumber + " " + GetLocalizedString(78) + " " + nowPlaying.EpisodeNumber;
                    _yatse2Properties.Currently.TvNote     = nowPlaying.Rating;
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Converter
                    _yatse2Properties.Currently.TvStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + nowPlaying.Studio + ".png";
                    _yatse2Properties.Currently.TvDirector = nowPlaying.Director;
                    _yatse2Properties.Currently.TvYear     = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.TvVotes    = "";
                }
                VideoStarting();
                break;

            case "Movie":
                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter

                Logger.Instance().Log("FrontView+", "New Movie Media : " + nowPlaying.FileName);
                var movieinfo = _database.GetMovieFromFile(_remoteInfo.Id, nowPlaying.FileName);
                _yatse2Properties.Currently.IsMovie = true;
                if (movieinfo.Count > 0)
                {
                    _yatse2Properties.Currently.MovieTitle    = movieinfo[0].Title;
                    _yatse2Properties.Currently.Fanart        = GetVideoFanartPath(movieinfo[0].Fanart); // TODO : Change to Covnerter
                    _yatse2Properties.Currently.MovieYear     = movieinfo[0].Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.MoviePlot     = movieinfo[0].Plot;
                    _yatse2Properties.Currently.MovieDirector = movieinfo[0].Director;
                    _yatse2Properties.Currently.MovieNote     = movieinfo[0].Rating;
                    _yatse2Properties.Currently.MovieVotes    = movieinfo[0].Votes + " " + GetLocalizedString(82);
                    _yatse2Properties.Currently.MovieStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + movieinfo[0].Studio + ".png";
                }
                else
                {
                    _yatse2Properties.Currently.MovieTitle    = nowPlaying.Title;
                    _yatse2Properties.Currently.Fanart        = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Converter
                    _yatse2Properties.Currently.MovieYear     = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.MoviePlot     = nowPlaying.Plot;
                    _yatse2Properties.Currently.MovieDirector = nowPlaying.Director;
                    _yatse2Properties.Currently.MovieNote     = nowPlaying.Rating;
                    _yatse2Properties.Currently.MovieStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + nowPlaying.Studio + ".png";
                }

                VideoStarting();
                break;

            case "Unknown":
                _yatse2Properties.Currently.IsUnknown   = true;
                _yatse2Properties.Currently.Thumb       = GetVideoThumbPath(nowPlaying.ThumbURL);   // TODO : Change to converter
                _yatse2Properties.Currently.UnknownFile = nowPlaying.FileName;
                _yatse2Properties.Currently.Fanart      = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Covnerter

                VideoStarting();
                break;
            //Attempt PVR support

            case "Pvr":
                Logger.Instance().LogDump("FrontView PVR:", "Case is PVR: ", true);

                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);
                Logger.Instance().LogDump("FrontView PVR:", "Thumb Set to " + _yatse2Properties.Currently.Thumb, true);

                _yatse2Properties.Currently.IsMovie    = true;
                _yatse2Properties.Currently.MovieTitle = nowPlaying.Title;
                nowPlaying.FileName = nowPlaying.Title;

                Logger.Instance().LogDump("FrontView PVR:", "nowPlaying Title: " + _yatse2Properties.Currently.MovieTitle, true);
                _yatse2Properties.Currently.Fanart = GetVideoThumbPath(nowPlaying.ThumbURL);
                Logger.Instance().LogDump("FrontView PVR:", "Fanart is : " + _yatse2Properties.Currently.Fanart, true);
                VideoStarting();
                break;

            default:
                break;
            }
        }
Пример #2
0
        private void UpdateCurrently(Plugin.ApiCurrently nowPlaying)
        {
            _isPlaying = true;
            switch (nowPlaying.MediaType)
            {
            case "Audio":
                Logger.Instance().Log("Yatse2", "New Music Media : " + nowPlaying.FileName);
                _yatse2Properties.Currently.IsMusic     = true;
                _yatse2Properties.Currently.MusicAlbum  = nowPlaying.Album;
                _yatse2Properties.Currently.MusicSong   = nowPlaying.Title;
                _yatse2Properties.Currently.MusicArtist = nowPlaying.Artist;
                _yatse2Properties.Currently.Fanart      = _config.MusicFanartRotation ? GetRandomImagePath(Helper.CachePath + @"Music\Fanarts") : GetMusicFanartPath(nowPlaying.FanartURL);

                _yatse2Properties.Currently.Thumb      = GetMusicThumbPath(nowPlaying.ThumbURL); // TODO : Change to converter
                _yatse2Properties.Currently.MusicYear  = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                _yatse2Properties.Currently.MusicTrack = nowPlaying.Track.ToString(CultureInfo.InvariantCulture);
                _yatse2Properties.Currently.MusicGenre = nowPlaying.Genre;

                var songinfo = _database.GetAudioSongFromFile(_remoteInfo.Id, nowPlaying.FileName);
                if (songinfo.Count > 0)
                {
                    var artistinfo = _database.GetAudioArtistFromName(_remoteInfo.Id, songinfo[0].Artist);
                    _yatse2Properties.Currently.MusicBiography = artistinfo.Count > 0 ? artistinfo[0].Biography : "No information";
                    if (!_config.MusicFanartRotation)
                    {
                        _yatse2Properties.Currently.Fanart = artistinfo.Count > 0 ? GetMusicFanartPath(artistinfo[0].Fanart) : "";
                    }
                }
                AudioStarting();

                break;

            case "TvShow":
                Logger.Instance().Log("Yatse2", "New TvShow Media : " + nowPlaying.FileName);
                _yatse2Properties.Currently.IsTv  = true;
                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter
                var epinfo = _database.GetTvEpisodeFromFile(_remoteInfo.Id, nowPlaying.FileName);
                if (epinfo.Count > 0)
                {
                    _yatse2Properties.Currently.TvShow    = epinfo[0].ShowTitle + " - " + epinfo[0].Title;
                    _yatse2Properties.Currently.TvTitle   = epinfo[0].Title;
                    _yatse2Properties.Currently.TvAired   = epinfo[0].Date;
                    _yatse2Properties.Currently.TvPlot    = epinfo[0].Plot;
                    _yatse2Properties.Currently.TvEpisode = GetLocalizedString(77) + " " + epinfo[0].Season + " " + GetLocalizedString(78) + " " + epinfo[0].Episode;
                    _yatse2Properties.Currently.TvNote    = epinfo[0].Rating;
                    var showinfo = _database.GetTvShowFromName(_remoteInfo.Id, epinfo[0].ShowTitle);
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(showinfo.Count > 0 ? showinfo[0].Fanart : nowPlaying.FanartURL); // TODO : Change to Covnerter
                    _yatse2Properties.Currently.TvStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + epinfo[0].Studio + ".png";
                    _yatse2Properties.Currently.TvDirector = epinfo[0].Director;
                    _yatse2Properties.Currently.TvYear     = epinfo[0].Date.Length > 3 ? epinfo[0].Date.Substring(0, 4) : epinfo[0].Date;
                    _yatse2Properties.Currently.TvVotes    = "";
                }
                else
                {
                    _yatse2Properties.Currently.TvShow     = nowPlaying.ShowTitle + " - S" + nowPlaying.SeasonNumber + " E" + nowPlaying.EpisodeNumber;
                    _yatse2Properties.Currently.TvTitle    = nowPlaying.Title;
                    _yatse2Properties.Currently.TvAired    = nowPlaying.FirstAired.ToShortDateString();
                    _yatse2Properties.Currently.TvPlot     = nowPlaying.Plot;
                    _yatse2Properties.Currently.TvEpisode  = GetLocalizedString(77) + " " + nowPlaying.SeasonNumber + " " + GetLocalizedString(78) + " " + nowPlaying.EpisodeNumber;
                    _yatse2Properties.Currently.TvNote     = nowPlaying.Rating;
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Converter
                    _yatse2Properties.Currently.TvStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + nowPlaying.Studio + ".png";
                    _yatse2Properties.Currently.TvDirector = nowPlaying.Director;
                    _yatse2Properties.Currently.TvYear     = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.TvVotes    = "";
                }
                VideoStarting();
                break;

            case "Movie":
                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter

                Logger.Instance().Log("Yatse2", "New Movie Media : " + nowPlaying.FileName);
                var movieinfo = _database.GetMovieFromFile(_remoteInfo.Id, nowPlaying.FileName);
                _yatse2Properties.Currently.IsMovie = true;
                if (movieinfo.Count > 0)
                {
                    _yatse2Properties.Currently.MovieTitle    = movieinfo[0].Title;
                    _yatse2Properties.Currently.Fanart        = GetVideoFanartPath(movieinfo[0].Fanart); // TODO : Change to Covnerter
                    _yatse2Properties.Currently.MovieYear     = movieinfo[0].Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.MoviePlot     = movieinfo[0].Plot;
                    _yatse2Properties.Currently.MovieDirector = movieinfo[0].Director;
                    _yatse2Properties.Currently.MovieNote     = movieinfo[0].Rating;
                    _yatse2Properties.Currently.MovieVotes    = movieinfo[0].Votes + " " + GetLocalizedString(82);
                    _yatse2Properties.Currently.MovieStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + movieinfo[0].Studio + ".png";
                }
                else
                {
                    _yatse2Properties.Currently.MovieTitle    = nowPlaying.Title;
                    _yatse2Properties.Currently.Fanart        = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Converter
                    _yatse2Properties.Currently.MovieYear     = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.MoviePlot     = nowPlaying.Plot;
                    _yatse2Properties.Currently.MovieDirector = nowPlaying.Director;
                    _yatse2Properties.Currently.MovieNote     = nowPlaying.Rating;
                    _yatse2Properties.Currently.MovieStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + nowPlaying.Studio + ".png";
                }

                VideoStarting();
                break;

            case "Unknown":
                _yatse2Properties.Currently.IsUnknown   = true;
                _yatse2Properties.Currently.Thumb       = GetVideoThumbPath(nowPlaying.ThumbURL);   // TODO : Change to converter
                _yatse2Properties.Currently.UnknownFile = nowPlaying.FileName;
                _yatse2Properties.Currently.Fanart      = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Covnerter

                VideoStarting();
                break;

            default:
                break;
            }
        }
Пример #3
0
        private void UpdateCurrently(Plugin.ApiCurrently nowPlaying)
        {
            _isPlaying = true;
            //SupportsRemoteControl Changes - Check Below:
            UpdateButtonVisibility();
            Logger.Instance().LogDump("Frontview PVR", "MediaType equals:" + nowPlaying.MediaType, true);


            switch (nowPlaying.MediaType)
            {
            case "Audio":
                Logger.Instance().Log("FrontView+", "New Music Media : " + nowPlaying.FileName);
                bool DefaultThumb     = false;
                bool usingExtrafanart = false;
                // Add below to reset Thumb and Fanart when new file starts
                //_yatse2Properties.Currently.Fanart = nowPlaying.FanartURL;
                //Helper.SkinorDefault(Helper.SkinPath, _config.Skin, @"\Interface\Default_Diaporama.png");
                _yatse2Properties.Currently.Thumb       = Helper.SkinorDefault(Helper.SkinPath, _config.Skin, @"\Interface\Default_Music-Thumbs.png");
                _yatse2Properties.Currently.IsMusic     = true;
                _yatse2Properties.Currently.MusicAlbum  = nowPlaying.Album;
                _yatse2Properties.Currently.MusicSong   = nowPlaying.Title;
                _yatse2Properties.Currently.MusicArtist = nowPlaying.Artist;
                _yatse2Properties.Currently.Logo        = GetVideoThumbPath(nowPlaying.LogoURL);
                Logger.Instance().LogDump("LogoUpdate [310 Y2W.Remote.cs]", "nowPlaying LogoURL equals:" + nowPlaying.LogoURL + " and Yatse2Properties.Currently.Logo equals:" + _yatse2Properties.Currently.Logo, true);
                _yatse2Properties.Currently.Fanart     = _config.MusicFanartRotation ? GetRandomImagePath(Helper.CachePath + @"Music\Fanarts") : GetMusicFanartPath(nowPlaying.FanartURL);
                _yatse2Properties.Currently.MovieIcons = nowPlaying.MovieIcons;

                // Wholesale change coming up......  Move away from DB for Currently Info, instead move to extrafanart for the artist detected....
                // Looks good - should do the same for Video Now Playing info screen
                if (_remotePlugin.Name.Contains("Kodi"))
                {
                    Logger.Instance().LogDump("UpdateAUDIO", "Config Rotation:Currently Fanart URL equals:" + nowPlaying.FanartURL, true);
                    Logger.Instance().LogDump("UpdateAUDIO", "Config GetMusicFanartPath equals:" + GetMusicFanartPath(nowPlaying.FanartURL), true);
                    Logger.Instance().LogDump("UpdateAUDIO", "*********** nowPlaying Artist Equals:" + nowPlaying.Artist + " and Currently MusicArtist:" + _yatse2Properties.Currently.MusicArtist, true);
                    Logger.Instance().LogDump("UpdateAUDIO", "*********** nowPlaying Album quals:" + nowPlaying.Album + " and Currently MusicArtist:" + _yatse2Properties.Currently.MusicAlbum, true);
                    Logger.Instance().LogDump("UpdateAUDIO", "*********** nowPlaying Song Equals:" + nowPlaying.Title + " and Currently MusicArtist:" + _yatse2Properties.Currently.MusicSong, true);

                    var testaudiofanart = KodiSourceData.KodiMusicSources[0] + nowPlaying.Artist + @"\extrafanart\";

                    // Change to checking first Kodi Audio source for extrafanart artist fanart - rather than all which time consuming

                    if (KodiSourceData.KodiMusicSources[0] != null || KodiSourceData.KodiMusicSources[0] != "")
                    {
                        var testaudiofanartcheck = KodiSourceData.KodiMusicSources[0] + @"\" + nowPlaying.Artist + @"\extrafanart\";
                        Logger.Instance().LogDump("UpdateAUDIO ARRAY", "Checking all sources " + testaudiofanartcheck);
                        if (System.IO.Directory.Exists(testaudiofanartcheck))
                        {
                            Logger.Instance().LogDump("UpdateAUDIO ARRAY", "Directory Exists Usings - No check for contents though " + testaudiofanartcheck);
                            testaudiofanart = testaudiofanartcheck;
                        }
                    }

                    /**
                     *                 foreach (var musicsource in KodiSourceData.KodiMusicSources)
                     *                 {
                     *                          if (musicsource != null)
                     *                          {
                     *                          var testaudiofanartcheck = musicsource + nowPlaying.Artist + @"\extrafanart\";
                     *                          Logger.Instance().LogDump("UpdateAUDIO ARRAY", "Checking all sources " + testaudiofanartcheck);
                     *                          if (System.IO.Directory.Exists(testaudiofanartcheck))
                     *                              {
                     *                               Logger.Instance().LogDump("UpdateAUDIO ARRAY", "Directory Exists Usings - No check for contents though " + testaudiofanartcheck);
                     *                               testaudiofanart = testaudiofanartcheck;
                     *                               break;
                     *                              }
                     *                          }
                     *
                     *
                     *                  }
                     **/
                    string resultextrafanart = GetRandomImagePath(testaudiofanart);

                    //var testaudiofanart = KodiSourceData.KodiMusicSources[0] + nowPlaying.Artist + @"\extrafanart\";
                    Logger.Instance().LogDump("UpdateAUDIO", "testfanart equals:" + testaudiofanart, true);
                    Logger.Instance().LogDump("UpdateAUDIO", "GetRandomImagePath ==:" + resultextrafanart, true);

                    // check for extrafanart -- if no images found will not run and default should apply


                    if (!_config.MusicFanartRotation && !resultextrafanart.EndsWith("Default_Diaporama.png"))
                    {
                        Logger.Instance().LogDump("UpdateAUDIO", "Currently.Fanart set to testaudiofanart:", true);
                        var FanartPathFilename = resultextrafanart;
                        var FanartisLocked     = true;
                        FanartisLocked = IsFileLocked(FanartPathFilename);
                        if (FanartisLocked == false)
                        {
                            Logger.Instance().LogDump("UpdateAUDIO", "Fanart File is not locked using " + FanartPathFilename, true);
                            _yatse2Properties.Currently.Fanart = FanartPathFilename;
                            usingExtrafanart = true;
                        }
                        if (FanartisLocked == true)
                        {
                            Logger.Instance().LogDump("UpdateAUDIO", "Fanart File is locked/using Default", true);
                            _yatse2Properties.Currently.Fanart = Helper.SkinorDefault(Helper.SkinPath, _config.Skin, @"\Interface\Default_Diaporama.png");
                            usingExtrafanart = false;
                        }
                    }
                }

                Logger.Instance().LogDump("UpdateAUDIO", "nowPlaying FanartURL:" + nowPlaying.FanartURL, true);
                Logger.Instance().LogDump("UpdateAUDIO", "Currently Fanart equals:" + _yatse2Properties.Currently.Fanart, true);
                _yatse2Properties.Currently.Thumb = GetMusicThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter
                Logger.Instance().LogDump("UpdateAUDIO", "Currently Thumb equals:" + _yatse2Properties.Currently.Thumb, true);
                _yatse2Properties.Currently.MusicYear  = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                _yatse2Properties.Currently.MusicTrack = nowPlaying.Track.ToString(CultureInfo.InvariantCulture);
                _yatse2Properties.Currently.MusicGenre = nowPlaying.Genre;


                var NowPlayingFile = SortOutPath(nowPlaying.FileName);

                if (!NowPlayingFile.Contains("googleusercontent"))
                {
                    try
                    {
                        var pathfilename = Path.GetDirectoryName(NowPlayingFile);
                        Logger.Instance().LogDump("UpdateAUDIO", "Thumbnail:  Nowplaying Get DirectoryName" + pathfilename, true);
                        if (File.Exists(pathfilename + @"\cdart.png"))
                        {
                            _yatse2Properties.Currently.Thumb = pathfilename + @"\cdart.png";
                        }
                    }
                    catch (Exception ex)
                    {
                        Logger.Instance().LogDump("Thumb Exception", "Thumbnail Exception Caught" + ex, true);
                    }
                }

                //Change Thumb if using Google play - recognise googleusercontent in string

                try
                {
                    var pathfilename = NowPlayingFile;
                    if (pathfilename.Contains("googleusercontent"))
                    {
                        Logger.Instance().LogDump("UpdateAUDIO", "Thumb GooglePlay:  Update to Skin Thumb", true);

                        if (_yatse2Properties.Currently.Thumb.EndsWith("Default_Music-Thumbs.png"))
                        {
                            if (File.Exists(Helper.SkinorDefault(Helper.SkinPath, _config.Skin, @"\Interface\Default_Music-ThumbGoogle.png")))
                            {
                                _yatse2Properties.Currently.Thumb = Helper.SkinorDefault(Helper.SkinPath, _config.Skin, @"\Interface\Default_Music-ThumbGoogle.png");
                                Logger.Instance().LogDump("UpdateAUDIO", "Thumb GooglePlay:  Changing to Google Thumb" + _yatse2Properties.Currently.Thumb, true);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.Instance().LogDump("Thumb Exception", "Thumbnail Exception Caught" + ex, true);
                }



                var songinfo = _database.GetAudioSongFromFile(_remoteInfo.Id, nowPlaying.FileName);
                if (songinfo.Count > 0)
                {
                    var artistinfo = _database.GetAudioArtistFromName(_remoteInfo.Id, songinfo[0].Artist);
                    _yatse2Properties.Currently.MusicBiography = artistinfo.Count > 0 ? artistinfo[0].Biography : "No information";
                    if (!_config.MusicFanartRotation)
                    {
                        _yatse2Properties.Currently.Fanart = artistinfo.Count > 0 ? GetMusicFanartPath(artistinfo[0].Fanart) : "";
                    }
                    Logger.Instance().LogDump("UpdateAUDIO", "Config Rotation:Currently Fanart equals:" + _yatse2Properties.Currently.Fanart, true);
                }

                AudioStarting();

                break;


            case "TvShow":
                Logger.Instance().Log("FrontView+", "New TvShow Media : " + nowPlaying.FileName);
                _yatse2Properties.Currently.IsTv  = true;
                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter
                _yatse2Properties.Currently.Logo  = GetVideoLogoPath(nowPlaying.LogoURL);
                Logger.Instance().LogDump("LogoUpdate", "nowPlaying LogoURL equals:" + nowPlaying.LogoURL + " and Yatse2Properties.Currently.Logo equals:" + _yatse2Properties.Currently.Logo, true);
                var epinfo = _database.GetTvEpisodeFromFile(_remoteInfo.Id, nowPlaying.FileName);
                if (epinfo.Count > 0)
                {
                    _yatse2Properties.Currently.TvShow    = epinfo[0].ShowTitle + " - " + epinfo[0].Title;
                    _yatse2Properties.Currently.TvTitle   = epinfo[0].Title;
                    _yatse2Properties.Currently.TvAired   = epinfo[0].Date;
                    _yatse2Properties.Currently.TvPlot    = epinfo[0].Plot;
                    _yatse2Properties.Currently.TvEpisode = GetLocalizedString(77) + " " + epinfo[0].Season + " " + GetLocalizedString(78) + " " + epinfo[0].Episode;
                    _yatse2Properties.Currently.TvNote    = epinfo[0].Rating;
                    var showinfo = _database.GetTvShowFromName(_remoteInfo.Id, epinfo[0].ShowTitle);
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(showinfo.Count > 0 ? showinfo[0].Fanart : nowPlaying.FanartURL); // TODO : Change to Covnerter
                    _yatse2Properties.Currently.TvStudio   = Helper.SkinorDefault(Helper.SkinPath, _yatse2Properties.Skin, @"\Studios\" + epinfo[0].Studio + ".png");
                    _yatse2Properties.Currently.TvDirector = epinfo[0].Director;
                    _yatse2Properties.Currently.TvYear     = epinfo[0].Date.Length > 3 ? epinfo[0].Date.Substring(0, 4) : epinfo[0].Date;
                    _yatse2Properties.Currently.TvVotes    = "";
                    _yatse2Properties.Currently.MovieIcons = nowPlaying.MovieIcons;
                }
                else
                {
                    _yatse2Properties.Currently.TvShow     = nowPlaying.ShowTitle + " - S" + nowPlaying.SeasonNumber + " E" + nowPlaying.EpisodeNumber;
                    _yatse2Properties.Currently.TvTitle    = nowPlaying.Title;
                    _yatse2Properties.Currently.TvAired    = nowPlaying.FirstAired.ToShortDateString();
                    _yatse2Properties.Currently.TvPlot     = nowPlaying.Plot;
                    _yatse2Properties.Currently.TvEpisode  = GetLocalizedString(77) + " " + nowPlaying.SeasonNumber + " " + GetLocalizedString(78) + " " + nowPlaying.EpisodeNumber;
                    _yatse2Properties.Currently.TvNote     = nowPlaying.Rating;
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Converter
                    _yatse2Properties.Currently.TvStudio   = Helper.SkinorDefault(Helper.SkinPath, _yatse2Properties.Skin, @"\Studios\" + nowPlaying.Studio + ".png");
                    _yatse2Properties.Currently.TvDirector = nowPlaying.Director;
                    _yatse2Properties.Currently.TvYear     = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.TvVotes    = "";
                    _yatse2Properties.Currently.MovieIcons = nowPlaying.MovieIcons;
                }
                VideoStarting();
                break;

            case "Movie":
                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);     // TODO : Change to converter
                //_yatse2Properties.Currently.Logo = GetVideoThumbPath(nowPlaying.LogoURL);
                Logger.Instance().LogDump("LogoUpdate", "nowPlaying LogoURL equals:" + nowPlaying.LogoURL + " and Yatse2Properties.Currently.Logo equals:" + _yatse2Properties.Currently.Logo, true);

                Logger.Instance().Log("FrontView+", "New Movie Media : " + nowPlaying.FileName);
                var movieinfo = _database.GetMovieFromFile(_remoteInfo.Id, nowPlaying.FileName);
                _yatse2Properties.Currently.IsMovie = true;

                Logger.Instance().LogDump("MovieIcons Currently", "nowPlaying MovieIcons equals:" + nowPlaying.MovieIcons + ":", true);
                _yatse2Properties.Currently.MovieIcons = nowPlaying.MovieIcons;
                if (movieinfo.Count > 0)
                {
                    _yatse2Properties.Currently.MovieTitle = movieinfo[0].Title;
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(movieinfo[0].Fanart); // TODO : Change to Covnerter
                    _yatse2Properties.Currently.Logo       = GetVideoLogoPath(movieinfo[0].Logo);
                    Logger.Instance().LogDump("LogoUpdate", "nowPlaying LogoURL equals:" + movieinfo[0].Logo + " and Yatse2Properties.Currently.Logo equals:" + _yatse2Properties.Currently.Logo, true);
                    _yatse2Properties.Currently.MovieYear     = movieinfo[0].Year.ToString(CultureInfo.InvariantCulture);
                    _yatse2Properties.Currently.MoviePlot     = movieinfo[0].Plot;
                    _yatse2Properties.Currently.MovieDirector = movieinfo[0].Director;
                    _yatse2Properties.Currently.MovieNote     = movieinfo[0].Rating;
                    _yatse2Properties.Currently.MovieVotes    = movieinfo[0].Votes + " " + GetLocalizedString(82);
                    _yatse2Properties.Currently.MovieStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + movieinfo[0].Studio + ".png";
                }
                else
                {
                    _yatse2Properties.Currently.MovieTitle = nowPlaying.Title;
                    _yatse2Properties.Currently.Fanart     = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Converter
                    _yatse2Properties.Currently.Logo       = GetVideoLogoPath(nowPlaying.LogoURL);
                    _yatse2Properties.Currently.MovieYear  = nowPlaying.Year.ToString(CultureInfo.InvariantCulture);
                    Logger.Instance().LogDump("LogoUpdate", "nowPlaying LogoURL equals:" + nowPlaying.LogoURL + " and Yatse2Properties.Currently.Logo equals:" + _yatse2Properties.Currently.Logo, true);
                    _yatse2Properties.Currently.MoviePlot     = nowPlaying.Plot;
                    _yatse2Properties.Currently.MovieDirector = nowPlaying.Director;
                    _yatse2Properties.Currently.MovieNote     = nowPlaying.Rating;
                    _yatse2Properties.Currently.MovieStudio   = Helper.SkinPath + _yatse2Properties.Skin + @"\Studios\" + nowPlaying.Studio + ".png";
                }

                VideoStarting();
                break;

            case "Unknown":
                _yatse2Properties.Currently.IsUnknown   = true;
                _yatse2Properties.Currently.Thumb       = GetVideoThumbPath(nowPlaying.ThumbURL);   // TODO : Change to converter
                _yatse2Properties.Currently.UnknownFile = nowPlaying.FileName;
                _yatse2Properties.Currently.Fanart      = GetVideoFanartPath(nowPlaying.FanartURL); // TODO : Change to Covnerter
                _yatse2Properties.Currently.Logo        = GetVideoLogoPath(nowPlaying.LogoURL);
                _yatse2Properties.Currently.MovieIcons  = nowPlaying.MovieIcons;
                VideoStarting();
                break;
            //Attempt PVR support

            case "Pvr":
                Logger.Instance().LogDump("FrontView PVR:", "Case is PVR: ", true);

                _yatse2Properties.Currently.Thumb = GetVideoThumbPath(nowPlaying.ThumbURL);
                Logger.Instance().LogDump("FrontView PVR:", "Thumb Set to " + _yatse2Properties.Currently.Thumb, true);
                _yatse2Properties.Currently.Logo       = GetVideoLogoPath(nowPlaying.LogoURL);
                _yatse2Properties.Currently.IsMovie    = true;
                _yatse2Properties.Currently.MovieTitle = nowPlaying.Title;
                nowPlaying.FileName = nowPlaying.Title;
                _yatse2Properties.Currently.MovieIcons = nowPlaying.MovieIcons;
                Logger.Instance().LogDump("FrontView PVR:", "nowPlaying Title: " + _yatse2Properties.Currently.MovieTitle, true);


                if (_yatse2Properties.Currently.Thumb != "" && nowPlaying.FanartURL == "")
                // if thumbnail not blank  and fanart is blank
                {
                    _yatse2Properties.Currently.Fanart = _yatse2Properties.Currently.Thumb;
                    Logger.Instance().LogDump("Frontview PVR", "nowPlaying_fanart Modified to Thumb:" + _yatse2Properties.Currently.Fanart, true);
                    Logger.Instance().LogDump("Frontview PVR", "nowPlaying_fanart Prior Fanart Received was::" + nowPlaying.FanartURL, true);
                }
                else
                {
                    _yatse2Properties.Currently.Fanart = GetVideoThumbPath(nowPlaying.FanartURL);
                    Logger.Instance().LogDump("Frontview PVR", "nowPlaying_fanart Not Modified:" + nowPlaying.FanartURL, true);
                }

                // _yatse2Properties.Currently.Fanart = GetVideoThumbPath(nowPlaying.ThumbURL);
                Logger.Instance().LogDump("FrontView PVR", "Fanart is : " + _yatse2Properties.Currently.Fanart, true);


                VideoStarting();
                break;

            default:
                break;
            }
        }