Closed Asteriskx closed 1 year ago
OK
Observable.Interval(TimeSpan.FromSeconds(1)) .Where(_ => _CurrentlyPlaying is not null && _CurrentlyPlaying.IsPlaying) .Select(async _ => _CurrentlyPlaying = await _spotifyClient?.Player?.GetCurrentlyPlaying(new())) .Select(_ => CurrentTrackInfo.GetCurrentTrackInfo(_CurrentlyPlaying)) .DistinctUntilChanged() .Where(track => track is not null) .Subscribe(track => CurrentTrackChanged?.Invoke(track));
NG
var observer = Observable.Interval(TimeSpan.FromSeconds(1)) .Select(async _ => _CurrentlyPlaying = await _spotifyClient?.Player?.GetCurrentlyPlaying(new())) .Publish(); observer.Where(_ => _CurrentlyPlaying is not null && _CurrentlyPlaying.IsPlaying) .Select(track => CurrentTrackInfo.GetCurrentTrackInfo(_CurrentlyPlaying)) .DistinctUntilChanged() .Where(track => track is not null) .Subscribe(track => CurrentTrackChanged?.Invoke(track)); ~~~ observer.Connect();
Fix 564500d6c76e762547beeba73c77417976ebe5aa
OK
NG