xbmc / generator-kodi-addon

Yeoman generator for the most common Kodi addon types.
http://www.kodi.tv
Other
74 stars 25 forks source link

Boilerplate for common code #3

Closed razzeee closed 7 years ago

razzeee commented 7 years ago

We should embed some common code like translation handling.

Any more ideas what might be nice to have?

phate89 commented 7 years ago

Some example code to handle the url parsing and adding a listitem it's something we should add (or directly using tamland's addon). In services we should add an example main loop with waitforabort For specific addons we can go further. For example I was thinking to subtitle or contextmenu addons we can show how to grab info needed to get the subtitle (title, year season, episode, ids etc etc)

enen92 commented 7 years ago

@Razzeee do you think it is viable to automatically generate a script.module out of a pipy package?

razzeee commented 7 years ago

Very interesting idea, we'll have to look if there is a subgenerator somewhere that can do that. Or maybe grab releases from github pages.

razzeee commented 7 years ago

@enen92 might be possible using some npm packages like https://github.com/lukaszb/pypi to talk with pypi let the user choose what he wants and then download the version. The other stuff should be doable via the file management classes of js.

enen92 commented 7 years ago

Great! My question was more if you think that option would fall into the purpose of this tool and lesser on how that would be achieved though :)

razzeee commented 7 years ago

Well I don't think updating modules is very hard, but automating it would be wonderful (less errors) Unfortunatly this generator is only really fit for creating something and improving upon it.

While it could work, to just generate a new module and replace it in your local checkout of the repo and then push it, it seems kind of "backwards"? Maybe just have a convention/config file in our modules and parse that with a weapon of our choice. Grab the new pypi files and replace the old ones. Thus keeping the action in your git tree make stuff easier?

razzeee commented 7 years ago

@phate89

Some example code to handle the url parsing and adding a listitem it's something we should add (or directly using tamland's addon).

Boilerplate now uses tamlands addon

In services we should add an example main loop with waitforabort

Done

For specific addons we can go further. For example I was thinking to subtitle or contextmenu addons we can show how to grab info needed to get the subtitle (title, year season, episode, ids etc etc)

Subtitle addon type is not yet supported. If you have some expertise on those, a little help or even a PR would be cool. Not sure what you would want to do for contextmenus

phate89 commented 7 years ago

Not sure if it's useful now but for the future might be useful to have different versions of the file according to the target version. So if we add something to improve kodi python api the addon uses already all the latest stuff..

razzeee commented 7 years ago

Yes, absolutely. I'm not sure how we would organize the folders. Been thinking of having also c++ generators added, but from the looks I had at those addons so far, they seem pretty hard to automate/different. (Read as in not worth it probably)

phate89 commented 7 years ago

binary addons? Until we don't have a binary repo it's probably not worh it..

razzeee commented 7 years ago

Merged https://github.com/xbmc/generator-kodi-addon/pull/6 should be enough for now