Kodi Community Forum
Release script.embuary.helper - a skin helper service / widgets alternative - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: Release script.embuary.helper - a skin helper service / widgets alternative (/showthread.php?tid=345471)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-01

Try the latest GitHub commit.
I've added an optional  ",window=" parameter where you can set the window that you want to use.

Example:
Code:


                                    <onclick>SetProperty(Dialog.1.Label,label1 1,home)</onclick>
                                    <onclick>SetProperty(Dialog.1.Label2,testlabel2 1,home)</onclick>
                                    <onclick>SetProperty(Dialog.1.Icon,DefaultVideo.png,home)</onclick>
                                    <onclick>SetProperty(Dialog.1.BuiltIn,Notification(test1,test1),home)</onclick>
                                    <onclick>SetProperty(Dialog.2.Label,label1 2,home)</onclick>
                                    <onclick>SetProperty(Dialog.2.Label2,testlabel2 2,home)</onclick>
                                    <onclick>SetProperty(Dialog.2.Icon,DefaultActor.png,home)</onclick>
                                    <onclick>SetProperty(Dialog.2.BuiltIn,Notification(test2,test2),home)</onclick>
                                    <onclick>RunScript(script.embuary.helper,action=createselect,header=$LOCALIZE[137],usedetails=true,window=home)</onclick>



RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-01

Great. All working fine. Now i can start some serious replacing.

Thanks a lot for this man and for your patience in all my questions & requests Angel

I can't promise you that this is the last time Tongue


Cheers
Nessus


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-01

No prob. Suggestions are always welcome.


RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-02

Hey sualfred... if it's not too much trouble for you i have one last request about the selection function.

In some cases i use the select dialog to set a skinstring but in a fresh settings start a default selection it's needed to be set.

Is it possible to add another argument in the script call where the default selection can be set?.... ,default=foo

Thanks
Nessus


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-02

@nessus 

added on GitHub -> "preselect"
It sets the default index position and marks the listitem as selected (ListItem.IsSelected). 
The index value starts with 0. If you use "-1" it will disable the preselection (which is the default if argument is not provided).

Code:
<onclick>RunScript(script.embuary.helper,action=createselect,header=$LOCALIZE[137],preselect=1,usedetails=true,window=home)</onclick>



RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-02

Sorry, man but this is not working as i expected. I think it's my fault that i didn't explain it correctly.

I don't need a pre-selected item when the dialog is open or to be marked as ListItem.IsSelected, although will be a good addition. I want (and i think whoever uses this in the same case scenarios)... in a fresh skin settings start, when there is no selection at all since the selection dialog it's not even opened yet, the script to set a default selection (eg a skinstring), so i don't need to add more code in home window to set those defaults strings in case Kodi starts fresh.

Is that possible?

By the way with your last commit even the ListItem.IsSelected it's not working properly. Whatever item i select, still focus and mark goes to the item that is set as ,preselect=foo

Thanks
Nessus


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-02

Not really. I work with variables and with a init setup that I also use to provide a skin resetting button https://github.com/sualfred/skin.embuary/blob/master/xml/Custom_1112_Reset.xml
I know that Marcel had a "skinsettings" feature implemented, but I always found it too complicated and it did not saved me any time in coding. I have currently no plans to implement something like this.

For me the preselect works fine.

Code:

                                    <label>test</label>
                                    <onclick>SetProperty(Dialog.1.Label,label1 1,home)</onclick>
                                    <onclick>SetProperty(Dialog.1.Label2,label2 1,home)</onclick>
                                    <onclick>SetProperty(Dialog.1.Icon,DefaultVideo.png,home)</onclick>
                                    <onclick>SetProperty(Dialog.1.BuiltIn,Skin.String(Default,0),home)</onclick>
                                    <onclick>SetProperty(Dialog.2.Label,label1 2,home)</onclick>
                                    <onclick>SetProperty(Dialog.2.Label2,label2 2,home)</onclick>
                                    <onclick>SetProperty(Dialog.2.BuiltIn,Skin.String(Default,1),home)</onclick>
                                    <onclick>RunScript(script.embuary.helper,action=createselect,header=$LOCALIZE[137],preselect=$VAR[preselect],usedetails=true,window=home)</onclick>

preselect=0 -> First item gehts selected
preselect=1 -> Second item gehts selected
preselect=2 -> Third item gehts selected
preseletct -1 -> Nothing gets selected

You have to built a variable and use that for preselect index if it was changed once.

Code:

<variable name="preselect">
<value condition="String.IsEqual(Skin.String(Default),1)">1</value>
<value>0</value>
</variable>



RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-02

Well, we have a different approach on this. Always when i code i have in my mind to do as much as possible with a less code as possible. I don't like to throw around variables, includes etc for every little thing. I don't know from python side but, in skin code, Marcel's way it needs one single line of code instead of all these. But you know better and it's your work and your approach and i fully respect that. I am happy with what i got so far.

Again, thank you very much for your work and your help.

Cheers
Nessus


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-02

I've used it before $PARAM's, which offered me a lot of more options. All of my skin settings in Embuary are built with 5-10 $PARAM templates. But everyone has own requirements. Maybe I'll add something like this in the future.


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-02

@nessus 

First dirty and ugly alpha with basics for movies,tvshows,episodes,artists,albums,songs,musicvideos:
https://github.com/sualfred/script.metadata.editor

RunScript(script.metadata.editor,dbid=$INFO[ListItem.DBID,type=$INFO[ListItem.DBType]

or via context menu -> 'Manage...' --> 'Metadata editor'

Video items have .nfo updating but audio items not (lack of path information from JSON)

It would be helpful if you play a little bit with all scenarios, elements and library variants.

Note:
List/array items are splitted by ";" like you would add an additional email in mail clients.

Image

Image


RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-02

This is way too much more than i expected!!!.

Tested and works fine. Either from context menu or from script call.

Remarks & suggestions:
- Any information added/edited are placed in the end of the .nfo file (don't know if this important when scraping items)
- The updated .nfo file is converting to UNIX format (again i don't know if this matters for all other systems besides windows)
- I use MediaElch MediaManager for my .nfo files and i have set it to create also movie.nfo files for each movie. Is it possible to update also these with the script?.
- IMHO icons are to much. I understand that you are using the detailed list of select dialog but if is possible to remove them the list will look cleaner.
- When you finish editing an item going back takes to the top of the list again. This kinda downside since it's a list of more than 20 items and you have to go again in the next item after the one you edited.

That's it. All these are much more of minor details. The script it's working perfectly fine and like i said its more than i expected. If i found any bugs will report back.

Thanks a lot man. Excellent work as always.

Cheers
Nessus


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-02

-> nfo order is not important
-> UNIX format is not important, that's what xbmcvfs is doing (Kodi core module)
-> I could add a setting for a custom additional .nfo file
-> I use icons as identifier what type of element it is (string, date, float, integer), but the icons are just temporary and will be replaced with nicer ones.
-> I rerun the script from the beginning to fetch the updated data. I can use the preselect method I guess.

Edit:
movie.nfo support + preselection is added


RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-03

All working good. No issues found.
You are good to go for the official repo Tongue.... just kidding!

A bonus feature on this it could be... an option to update (from IMDB site) the IMDB ratings or votes Wink

In any case, awesome job man in a very short time!!!

Cheers
Nessus


RE: script.embuary.helper - a skin helper service / widgets alternative - sualfred - 2019-11-03

Still stuff missing that I want to add or to simplify for non experienced users.

IMDb updating is on the list.


RE: script.embuary.helper - a skin helper service / widgets alternative - nessus - 2019-11-03

(2019-11-03, 13:30)sualfred Wrote: IMDb updating is on the list.
Nod