Jump to content

Genres and Query model


Armand

Recommended Posts

Armand

There doesn't seem to be a method and query model yet to support the genre listing like the browser version is doing.

Am i missing something or should i add it to the API interaction library. Also i noticed a lot of overlap between the different query models resulting in not very "DRY" code at the BaseApiClient level

Link to comment
Share on other sites

I can add tonight, unless you're held up and need them asap.

 

And yes, we call these "items by name". There is some slight repetition among them, unfortunately. If you want to look at improvements, let me know.

Link to comment
Share on other sites

go ahead with the 3.5 project then, although do whatever you need with BaseApiClient. But I'll do the regular one soon once I get to that area in the ui.

 

The model project actually has an IApiClient. I expect there's going to be a lot of MBT plugins so the interface will allow mbt plugins to avoid having a hard reference to ApiClient, so that they don't need to know anything about it. So anytime a method is added to the 4.5 version, it goes into the interface first.

Link to comment
Share on other sites

Armand

Ok will do, I have to create an 3.5 specific IApiClient interface as well then because of the signatures :)

 

I was also playing around with the some nuget packages and i noticed it's possible to get alot of the basic parallel library functionality into 3.5 as well.

Might be able to use the original IApiClient in that case (would result into major refactoring on the 3.5 side so that really depends on who is using it)

 

edit: refering to the AsyncBridge @ http://www.nuget.org/packages/AsyncBridge/

Link to comment
Share on other sites

well that's interesting. is it actually being used in production scenarios or is it just a developer tech demo?

Link to comment
Share on other sites

Armand

I think it's fully featured and production ready --> http://omermor.github.io/AsyncBridge/

 

The only issues i ran into trying to do a 1:1 port of the 4.5 client is missing paralel extensions methods on some framework assemblies and ofcourse the HttpClient.

Still i think i can manage a close port especially if everything is abstracted behind interfaces that don't use net 4.5 specific classes other than Task etc..

Link to comment
Share on other sites

Right, yea because of IAsyncHttpClient. And to think I was about to take that out. When we first started, the portable subset didn't support HttpClient, so we needed that. Now that it does I figured that interface was obsolete, but it may prove useful after all.

Link to comment
Share on other sites

cool. are you actually going to move forward with the async 3.5 solution? if not then probably don't need the IApiClient, unless you want it for the same purpose as I do. The only consumer of the 4.5 one is MBT, and the interface is the only thing visible to plugins and themes.

Link to comment
Share on other sites

Armand

i will do the async 3.5 solution on the side but i will focus on bringing as much functionality from MB to the MediaPortal client as i can :)

Link to comment
Share on other sites

Armand

can you release a new nuget package for the apiclient? I also added GetStudios.

Link to comment
Share on other sites

Armand

FYI i just started to port the ApiClient to net35 with the AsyncBridge libraries. I'm keeping as much of the original files from the net45 project as possible by linking them and replacing the classes that are missing.

Any reason why the IApiClient is in the Model library and not in the ApiInteraction one?

Link to comment
Share on other sites

because i don't want mbt plugins to have to know anything about the apiclient nuget package

Link to comment
Share on other sites

Armand

I figured yes... well then in order for me to still link the original IApiClient to the net35 libraries AsyncBridge needs to be added to the Model.net35. After that i can link all the stuff into the Model.net35 library and it will work :P

Link to comment
Share on other sites

That will potentially cause a problem because Ebr is using them for mbc, and the 3.5 version needs to be strong signed so that it can run within wmc. so we may have to get creative here

Link to comment
Share on other sites

I guess I would ask is it really worth it to use the 3.5 async library. what we have now seems to be working, it's just always a step behind the 4.5 version. but i can make sure to update both anytime i add a new method if that helps

Link to comment
Share on other sites

Armand

I'm doing this as a side challenge to see if i can make it work - i won't be touching the repo :)

If it works the only advantage is that it will reduce the amount of work required to keep the two in sync, also the clients will then be used the same in both versions.

(worst case being manually linking files in the net35 project)

Link to comment
Share on other sites

Yeah, just don't create any more dependencies in the model and I'm good. I have my own API client that I'm not looking to replace because there is no real benefit to doing so.

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