Hi -
I having a little trouble adding tracks to a running filtered stream. Based on previous research, the approach seems to be pausing, adding tracks, and then resuming. Doing this stops the filteredstream unexpectedly.
Would you mind advising? Here's the exception - "Specified argument was out of the range of valid values. Parameter name: index".
Source : System.Core
at System.Linq.Enumerable.ElementAt[TSource](IEnumerable
at Tweetinvi.Streams.Helpers.StreamTrackManager`1.GetMatchingTracksAndActions(String input)
at Tweetinvi.Streams.FilteredStream.<StartStreamMatchingAnyConditionAsync>b__c(String json)
at Tweetinvi.Streams.Helpers.StreamResultGenerator.<>c__DisplayClass1.<StartStreamAsync>b__0(String json)
at Tweetinvi.Streams.Helpers.StreamResultGenerator.<StartStreamAsync>d__7.MoveNext()
My code:
I having a little trouble adding tracks to a running filtered stream. Based on previous research, the approach seems to be pausing, adding tracks, and then resuming. Doing this stops the filteredstream unexpectedly.
Would you mind advising? Here's the exception - "Specified argument was out of the range of valid values. Parameter name: index".
Source : System.Core
at System.Linq.Enumerable.ElementAt[TSource](IEnumerable
1 source, Int32 index)
at Tweetinvi.Streams.Helpers.StreamTrackManager
1._matchingTracks(String input)at Tweetinvi.Streams.Helpers.StreamTrackManager`1.GetMatchingTracksAndActions(String input)
at Tweetinvi.Streams.FilteredStream.<StartStreamMatchingAnyConditionAsync>b__c(String json)
at Tweetinvi.Streams.Helpers.StreamResultGenerator.<>c__DisplayClass1.<StartStreamAsync>b__0(String json)
at Tweetinvi.Streams.Helpers.StreamResultGenerator.<StartStreamAsync>d__7.MoveNext()
My code:
private void queryNotificationReceived(object sender, EventArgs e)
{
var required = _Flow.GetRequiredData();
lock (queryList)
{
queryList = required.queries.ToList();
stream.PauseStream();
stream.Tracks.Clear();
foreach (var q in queryList){
stream.AddTrack(q.QueryValue);
}
stream.ResumeStream();
}
}
Thanks for your help!