Jump to content

Api questions


Tolriq

Recommended Posts

Tolriq

So after playing and implementing Emby API in Yatse I'm starting to look at optimizations and better handling of some details.

 

A few questions:

 

1) Artists

 
API end points:
- /Artists
- /Artists/AlbumArtists
 
Is there an indicator of an artist being an album artist without the need to do 2 calls and compare the lists?
Currently even artist that are not album artists still returns an albumCount and a child count (and no song count for both calls) so there's no way to distinguish them without 2 calls.
 
 
2) Persons
 
/Persons does not seems to properly handle the limit internaly, it takes the same time to request all the persons or to use limits (but returns correct amounts), limiting the interest of using limits to reduce load on server.
 
 
3) Libraries
 
/Users/XXXX/Items  returns the main libraries with some Id
 
Getting all items with queries like that queries database without limiting to one library:
/Users/XXXXXXX/Items?Recursive=true&IncludeItemTypes=Movie&ExcludeLocationTypes=Virtual&Fields=Genres,SortName,Path,Overview,RunTimeTicks,ParentId,People,ProviderIds,OriginalTitle,Studios,ProductionLocations,MediaSources,DateCreated,VoteCount,RemoteTrailers&CollapseBoxSetItems=false&limit=500
 
Returns the items with some parentId that corresponds to the folder architecture, moving up in the API via /Users/XXXXX/Items/theParentId only goes up to "root" AggredateFolder but no way to match with the source library.
 
Is there a way to correlate both things, without the need to make 1 query per library for optimisations purpose? Maybe a special field that would contain that info?

 

 

 

Link to comment
Share on other sites

Tolriq

Thanks but then :

 

1) Feature request? :)

 

2) Ok :( But for global syncs, goal is to get all data, using paging ensure that not too much data is handled without too much overhead. Let's hope the fix is on the TODO :)

 

3) I've read it and have no problem to get things, but the question is how do I avoid multiple unnecessary calls ;)

If a user have 10 movie library of 50 movies. It requires 10 calls to get each library content.

 

While when using /Users/XXXXXXX/Items?Recursive=true&IncludeItemTypes=Movie I can get the 500 items in one query. (And without duplicates)

 

This is way more efficient when doing global syncs. But in that case I'm missing the library/view whatever Id to match what goes where.

 

The question is : Is there a way to get this Id (those? as I suppose an item can be part of multiple views) with the /Users/XXXXXXX/Items?Recursive=true&IncludeItemTypes=Movie query?

Edited by Tolriq
Link to comment
Share on other sites

The api is not entirely designed for a syncing process. It is more designed around live browsing. You might want to take a look at the source code for the Emby for Kodi addon, because they've gone to great lengths to sync the library while still being able to preserve emby features from the kodi side. But it is important to keep in mind that if you're going to pull your own copy of all the data, then if you want to preserve emby features you're probably going to have to build them client-side just like they did.

Link to comment
Share on other sites

Tolriq

Ok thanks for the confirmation.

 

Yatse is not a pure Emby client as it's multi media center, and offers offline browsing / media download / sync.

 

So in all case I work with locally cached data for things that can be cached and rebuild common features. (Currently limited by Kodi being the first one implemented and well it's API is different ;) )

 

Will make multiple request then :(

 

I suppose there's no way to have Emby to download the actors thumbs when users does not pre load images, without making a call per actor / movie ?

Link to comment
Share on other sites

No, but when you download the individual person details, then it will happen at that point.  That is kind of a hard one. Why not instead blend offline with online, and make person details on demand with client-side response caching? In other words, instead of trying to do it all ahead of time.

Link to comment
Share on other sites

Tolriq

This is also what I do, but as requested by users for Kodi they love the offline access to library. And asked for automatic global sync with image caching.

 

They connect they have the data cached to browse offline even if no more connected when they look at some particular media even if not browsed online before.

 

Issue with Emby is that the thumbs url are not returned until they are cached while Kodi returns the url and will cache on access.

 

Anyway not sure it will also be asked for Emby but I prefer when I can have similar functionning for everything. Will tell them to force download on Emby scan if asked.

And I suppose that unlike Kodi most users will have their Emby always accessible including outside of home so less an issue.

Link to comment
Share on other sites

Yea i think it's a reasonable request to return the image urls, it just means we have to redo our images api.

Link to comment
Share on other sites

Tolriq

Ok thanks is there a proper way to make feature requests?

 

 

And last question, not fully related to API, but API does talk about user data "Likes"  and web interface allows to filter on that, but I can't find any way on the web interface or Android app to say I like something, only favorites, is this something that will be removed or that will be completed later?

Link to comment
Share on other sites

You can file a topic in the feature requests section of the forum.

 

Likes is something we used to have in our UI. We used to have thumbs up/down along with the favorites, but over time it started to seem redundant. The data and objects are still in the api in case we change our minds, so that is why you see them there.

Link to comment
Share on other sites

Tolriq

Thanks so it's fine to assume it will stay and we can use that to store an media/user value ? 

 

And really last question for now, but is it the same problem with user ratings? Can seems to find a way to rate from interface. Only API definition.

Link to comment
Share on other sites

like, dislike and favorite all translate to a number which is the user rating, so it's all one and the same. in general it's not necessarily safe to assume something will stay if it's not being used by Emby apps. If we discover some optimization we can make by deprecating unused code or data, then we'll most likely end up wanting to do that.

Link to comment
Share on other sites

Tolriq

Ok will stand to what is used then and see how it goes in future.

 

Thanks for all the fast answers.

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...