Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Pausing FilteredStream, adding tracks, then resuming stops stream

$
0
0
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](IEnumerable1 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!

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>