Exemplo n.º 1
0
        public static async Task <ContentManageResult> UpdateMylistItemAsync(NiconicoContext context, string group_id, NiconicoItemType item_type, string item_id, string description)
        {
            var dict = new Dictionary <string, string>();

            dict.Add(nameof(group_id), group_id);
            dict.Add(nameof(item_type), ((uint)item_type).ToString());
            dict.Add(nameof(item_id), item_id);
            dict.Add(nameof(description), description);

            var json = await context.PostAsync(NiconicoUrls.MylistUpdateUrl, dict);

            return(ContentManagerResultHelper.ParseJsonResult(json));
        }
Exemplo n.º 2
0
        public static async Task <ContentManageResult> AddDeflistAsync(NiconicoContext context, NiconicoItemType item_type, string item_id, string description)
        {
            var dict = new Dictionary <string, string>();

            var group_id    = "default";
            var mylistToken = await context.GetMylistToken(group_id, item_id);

            dict.Add(nameof(group_id), group_id);
            dict.Add(nameof(item_type), ((uint)item_type).ToString());
            dict.Add(nameof(item_id), mylistToken.ItemId);
            dict.Add(nameof(description), description);
            dict.Add("token", mylistToken.Token);

            var json = await context.PostAsync(NiconicoUrls.MylistDeflistAddUrl, dict, withToken : false);

            return(ContentManagerResultHelper.ParseJsonResult(json));
        }
Exemplo n.º 3
0
        public static async Task <ContentManageResult> UpdateDeflistAsync(NiconicoContext context, NiconicoItemType item_type, string item_id, string description)
        {
            var dict = new Dictionary <string, string>();

            dict.Add(nameof(item_id), item_id);

            if (item_type != NiconicoItemType.Video)
            {
                dict.Add(nameof(item_type), ((uint)item_type).ToString());
            }
            if (!string.IsNullOrWhiteSpace(description))
            {
                dict.Add(nameof(description), description);
            }

            var json = await context.PostAsync(NiconicoUrls.MylistDeflistUpdateUrl, dict);

            return(ContentManagerResultHelper.ParseJsonResult(json));
        }