Jump to content

API Client IsMissing results is inconsistent


psubsee2002

Recommended Posts

psubsee2002

When reading through some of the past questions I stumbled across http://emby.media/community/index.php?/topic/1150-missingfuture-episodes-how-to-handle-them/.  Unless something has changed in the last 18 months, I am interpreting that to mean that the all TV Episodes are available via the API, whether they are actual media files or not.

 

I did find the IsMissing property of ItemQuery of the API Client, but when I attempted to use it, I had some very inconsistent results.

 

  • When querying for "Seasons", the behavior was exactly as expected.  There are 16 series in my collection that are missing at least 1 entire season (some with more than one).  All missing 25 seasons that were returned.  No season that had any episodes was returned.
  • For TV Episodes, the behavior was not consistent.  I'm not certain on the exact behavior, but I've made a few guesses based on my observations, but I am not 100% certain it is the correct behavior for each scenario.
    • For any series in which I am missing 1 or more episodes from every season, only the missing episodes were returned.  This is the behavior I expected for this query.
    • For any series in which I have 100% of the episodes, the entire season was returned.  Exactly zero are missing but all were returned.
    • For any series in which I have 100% of the episodes for some seasons and am missing some episodes for a few seasons is where things get a little mixed
      • For seasons in which I have 100% of the episodes, all episodes were returned by the query.  None were missing but all were returned.  This was unexpected behavior.
      • For seasons in which I have 0% of the episodes, all episodes were returned by the query.  This is the behavior I expected for this query.
      • For seasons in which I have an incomplete series (1 or more episodes missing), all episodes were returned (whether they were missing or not) and every episode I did have was returned.  Effectively I had a duplicate result for episodes that I already had.  This was unexpected behavior.

Am I using this query wrong?  The query I used for this was:

 

For Seasons:

var items = await client.GetItemsAsync(new ItemQuery
{
    UserId = client.CurrentUserId,

    IncludeItemTypes = new[] { "Season" },

    Fields = Enum.GetValues(typeof(ItemFields)).Cast<ItemFields>().ToArray(),
    IsMissing = true,

    Recursive = true,
});

For Episodes:

var items = await client.GetItemsAsync(new ItemQuery
{
    UserId = client.CurrentUserId,

    IncludeItemTypes = new[] { "Episode" },

    Fields = Enum.GetValues(typeof(ItemFields)).Cast<ItemFields>().ToArray(),
    IsMissing = true,

    Recursive = true,
});
Edited by psubsee2002
Link to comment
Share on other sites

psubsee2002

Another self answer, but apparently using the LocationType property yields more accurate results than IsMissing.  

 

When I use

LocationType = new[] { MediaBrowser.Model.Entities.LocationType.Virtual }

in ItemQuery, the results are more accurate.  Still doesn't explain the inconsistency in the ItemQuery.IsMissing property.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...