예제 #1
0
        private async Task <UploadMetaData.TwitchVodData> UpdateTwitchVodData(bool streaming)
        {
            if (!streaming)
            {
                return(null);
            }
            bool Selected(TwitchAccount x) => x.Id == Config.Instance.SelectedTwitchUser;

            var user = HSReplayNetOAuth.TwitchUsers?.FirstOrDefault(Selected);

            if (user == null)
            {
                return(null);
            }
            var url = await TwitchApi.GetVodUrl(user.Id);

            if (url == null)
            {
                return(null);
            }
            var streamerLanguage = await TwitchApi.GetStreamerLanguage(user.Id);

            return(new UploadMetaData.TwitchVodData
            {
                ChannelName = user.Username,
                Url = url,
                Language = streamerLanguage
            });
        }