private Track GetTrackWithFreshYoutubeUrl(Track originalTrack)
        {
            IEnumerable <Track> tracks = playlistManager.ReadTracks().Where(t => t.Artist == originalTrack.Artist && t.Title == originalTrack.Title);

            DateTime timeTrackRequested        = new DateTime(1970, 1, 1, 0, 0, 0);
            Track    trackWithLatestYoutubeUrl = null;
            string   youTubeVideo = null;

            foreach (Track track in tracks)
            {
                if (track.Url != null)
                {
                    Match match = Regex.Match(track.Url, @"lmt(\=[^&]*)?(?=&|$)|^lmt(\=[^&]*)?(&|$)");
                    if (match.Success)
                    {
                        string timestamp;
                        timestamp = match.Groups[1].Value;
                        timestamp.Replace("lmt=", "");
                        DateTime datetime = new DateTime(1970, 1, 1, 0, 0, 0).AddMilliseconds(Convert.ToDouble(timestamp));
                        if (datetime > timeTrackRequested)
                        {
                            timeTrackRequested        = datetime;
                            trackWithLatestYoutubeUrl = track;
                        }
                    }
                }
            }
            if (timeTrackRequested.AddHours(6) >= DateTime.UtcNow || trackWithLatestYoutubeUrl == null)
            {
                var youTube = YouTube.Default;                                      // starting point for YouTube actions
                youTubeVideo = youTube.GetVideo(originalTrack.TrackSource.Url).Uri; // gets a Video object with info about the video
            }
            else
            {
                youTubeVideo = trackWithLatestYoutubeUrl.Url;
            }

            Track newTrack = new Track()
            {
                Id          = originalTrack.Id,
                Artist      = originalTrack.Artist,
                CoverArtUrl = originalTrack.CoverArtUrl,
                Duration    = originalTrack.Duration,
                TrackSource = new TrackSource()
                {
                    Id         = originalTrack.TrackSource.Id,
                    SourceType = originalTrack.TrackSource.SourceType,
                    TrackId    = originalTrack.TrackSource.TrackId,
                    Url        = originalTrack.TrackSource.Url
                },
                Title = originalTrack.Title,
                Url   = youTubeVideo
            };

            return(newTrack);
        }