-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V1.8.1 GetTvShowChangesAsync returns a JToken in TMDbLib.Objects.Changes.ChangesContainer #380
Comments
It seems that GetTvSeasonChangesAsync and GetTvEpisodeChangesAsync responses also contain JTokens. |
Looking at it further, is there a way to pass the optional start and end dates, or the page? |
As I recall, I made those values JTokens as I can't say anything about their contents. Iirc, the contents correspond to the actual change that was made, f.ex. when adding it could be the values that were added etc. The value is a Newtonsoft JToken, so you could make your own object if you know what to expect, and convert to it like As for pagination - there are both start, end and page parameters. |
Part of my struggle is that I'm not seeing .Value available to me. Here is a sample snippet. As you can see, I can have Action, Id, Iso_639_1, and Time. But the JToken fields OriginalValue and Value appear inaccessible. Regarding start, end, and page... I see them on the Season and Episode change methods, but they aren't on the Show method. Thanks! |
I've created this example that shows how it can be used. I still can't say anything about the value, hence it being an I can also see where your confusion comes from. The var changes = await client.GetMovieChangesAsync(848533);
// Example serialization back to json
var json = TMDbJsonSerializer.Instance.SerializeToString(changes);
foreach (var change in changes)
{
Console.WriteLine("Key: " + change.Key);
foreach (ChangeItemBase item in change.Items)
{
Console.WriteLine(" - Id: " + item.Id);
switch (item)
{
case ChangeItemAdded changeItemAdded:
Console.WriteLine(" Added: " + changeItemAdded.Value);
break;
case ChangeItemCreated changeItemCreated:
Console.WriteLine(" Created");
break;
case ChangeItemDeleted changeItemDeleted:
Console.WriteLine(" Deleted: " + changeItemDeleted.OriginalValue);
break;
case ChangeItemDestroyed changeItemDestroyed:
Console.WriteLine(" Destroyed: " + changeItemDestroyed.Value);
break;
case ChangeItemUpdated changeItemUpdated:
Console.WriteLine(" Updated: " + changeItemUpdated.OriginalValue + " => " + changeItemUpdated.Value);
break;
default:
throw new ArgumentOutOfRangeException(nameof(item));
}
}
Console.WriteLine();
} |
Thanks for your reply.
Your sample (thank you for it) works for Movies, but not for TVShows. And, I'm afraid I still don't see start, end, or page on |
I see that. The four methods could all have been of one or the other type, this is just inconcistency. I've created #381. The sample should be the same, albeit with minor modifications. The ChangesContainer wraps a I can also see the mismatch of parameters in those methods, it could be that a lot of methods are like this. So if you're up for it, you can try adding some of these parameters - f.ex. just for the TV Shows Client. I've created #382 for this. Mike. |
… On Thu, Jul 8, 2021 at 4:05 PM Michael Bisbjerg ***@***.***> wrote:
I see that. The four methods could all have been of one or the other type,
this is just inconcistency. I've created #381
<#381>.
The sample should be the same, albeit with minor modifications. The
ChangesContainer wraps a List<Change>, which in turn has the
ChangeItemBase which the sample works on.
I can also see the mismatch of parameters in those methods, it could be
that a lot of methods are like this. So if you're up for it, you can try
adding some of these parameters - f.ex. just for the TV Shows Client. I've
created #382 <#382> for this.
Mike.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALL6WHY74XVTFGJ2TDCROGDTWYAKNANCNFSM47XDLYKA>
.
|
I'm trying to work with GetTvShowChangesAsync which returns a TMDbLib.Objects.Changes.ChangesContainer. Drilling down to the Item list there is a Value field of type JToken. I am having difficulty accessing the data in it. Should this be a JToken or something else?
The text was updated successfully, but these errors were encountered: