public PostListIterator(VSharpService service, int board, int count) { _service = service; _board = board; _count = count; hasNext = true; }
public ChannelVideoListIterator(VSharpService service, int channelSeq, int count) { _service = service; _channelSeq = channelSeq; _count = count; currentPage = 1; hasNext = true; }
public LiveMonitorTask(int channelSeq, int count, TimeSpan period, VSharpService service) : base(channelSeq, period, service) { _count = count; Timer = new Timer(async(s) => { if (Checking) { return; } // Set flag to prevent overlapping checks Checking = true; try { ChannelVideoListResponse channelVideoListResponse = await Service.GetChannelVideoListAsync(ChannelSeq, _count, 1); List <Video> videos = channelVideoListResponse.Videos; videos = videos.Where(x => x.VideoType == "LIVE" && x.OnAirStartAt > lastLive).ToList(); for (int i = videos.Count - 1; i >= 0; i--) { LiveFound.Invoke(null, CreateLiveFoundEventArgs(videos[i], channelVideoListResponse.ChannelInfo)); } if (videos.Any()) { lastLive = videos.Max(x => x.OnAirStartAt); } } catch (Exception e) { ExceptionThrown.Invoke(null, e); } finally { Checking = false; } }, null, Timeout.Infinite, Timeout.Infinite); }
public AVideoMonitorTask(int videoSeq, TimeSpan period, VSharpService service) : base(period, service) { VideoSeq = videoSeq; }
public static async Task Main(string[] args) { VSharpService service = new VSharpService("app_id", Locale.EN); VSharpMonitor monitor = new VSharpMonitor(service); await Task.Delay(-1); }
public SubtitleMonitorTask(int videoSeq, Language language, SubtitleType type, TimeSpan period, VSharpService service) : base(videoSeq, period, service) { Language = language; Type = type; Id = new SubtitleMonitorTaskId(videoSeq, language, type); Timer = new Timer(async(s) => { if (Checking) { return; } // Set flag to prevent overlapping checks Checking = true; try { VODInfo vodInfo = await Service.GetVODInfoAsync(VideoSeq); // Only continue if the VOD has caption data if (vodInfo.CaptionInfo == null) { return; } foreach (var details in vodInfo.CaptionInfo.Details) { if (details.Locale == Language.Value && details.Type.ToLower() == Type.Value) { SubtitleAvailable.Invoke(null, CreateSubtitleEventArgs(VideoSeq, details)); } } } catch (Exception e) { ExceptionThrown.Invoke(null, e); } finally { Checking = false; } }, null, Timeout.Infinite, Timeout.Infinite); }
public AMonitorTask(TimeSpan period, VSharpService service) { Service = service; _period = period; }
public AChannelMonitorTask(int channelSeq, TimeSpan period, VSharpService service) : base(period, service) { ChannelSeq = channelSeq; }