vdb86/screensaver.digitalclock

skin.custom question

mgonzales71 opened this issue · 14 comments

where are you looking for the file skin.custom.xml in your script?

as a skin dev typically I will (let me use nextup notification addon as an example)
copy and then modify a file named (in this instance) script-nextup-notification-NextUpInfo.xml and place it in the skins xml dir (720, 1080i, etc). the script will then look for it and use it instead of it's own.

this way it will survive add-on updates of the script itself.

if you aren't looking for the file in the skin's xml dir you should change your script to do so.

I would suggest you look for a file named: script-screensaver-digitalclock-custom.xml

I am not sure of the mechanism a script/addon uses but you could peruse code of a script that I have personally wrote a custom skin override for and it works

https://github.com/im85288/service.nextup.notification

let me know if I can test anything for you etc - then once I have figured out the details I can customize titan for use with your screensaver :)

Thanks again!

vdb86 commented

Hi Mario!
Let me explain how everything works.
First of all the screensaver looks for skin.custom.xml.
If that is not found then it looks for a nameofthecurrentskin.xml.
If that doesn't exist either it goes to skin.default.xml.
It looks for all of those files in screensver.digitalclock\resources\skins\default\720p\

skin.custom.xml doesn't exist originally, but a user has to rename skin.custom - example.xml to skin.custom.xml and edit the values inside, so it's safe from future screensaver updates (as far as I know) nothing should either delete it or rewrite it.
I wanted everything to be concentrated in the screensaver folder, but if needed I could add a line to make it search for script-screensaver-digitalclock-custom.xml in the current skin directory if needed.

anything in \Kodi\addons\screensaver.digitalclock* will not survive an update or re-install of your add-on.

try it - everything will be deleted and replaced.

the only safe place for end-user data to survive updates, etc is userdata
http://kodi.wiki/view/Userdata

this is why skin customization's to support an addon/script are stored in the xml dir of the skin and will be installed/updated by the skin with skin updates - a skin is not able to write data anywhere else (how would a skin install or update a skin.custom.xml file to your addon's directory?)

look at any script that is skin customizable... trakt, nextup notification, video extras, extended info, tv next aired, etc they all use files in the skin's xml dir for this.

here is a list of them that titan uses (so far):

2015-10-18_06-58-55

there are two places you should look for custom xml files:

skin customization: addons/skin name/(1080i,720p,etc)/script-screensaver-digitalclock-custom.xml

the second is only if you wanted to implement the end user to be able to create an xml that overided the screensaver included and skin custom files

user customization xml would go in: userdata/addon_data/screensaver.digitalclock/

sorry - clicked close by accident.. oops.. hehe

hopefully this helps explain things better

thanks

mario

vdb86 commented

Fair enough, I'll take a look and implement this!

if you want to look at a script that may be helpful for you to see how others have implemented this....
check out - https://github.com/im85288/service.nextup.notification

Not only is Ian is a nice guy - he does both script and skin development.

I will be happy to test for you as always - again no rush, etc

Take care!

Mario

vdb86 commented

I've already taken a look, but at this point my brain isn't working, I'll do it my way, just to figure out how to get current skin dir and the current user folder.
Unfortunately I'm stuck right now, but when I figure it out I'll get it done.

vdb86 commented

I've added the support for screensaver to use script-screensaver-digitalclock-custom.xml which is in skins 1080i/720p etc folder.
There is an order in which it checks which folder to use.
I tried using userdata/addon_data/screensaver.digitalclock/ for a users custom xml file but that doesn't work.
The file is available, and Kodi sees it, but it just doesn't work, no clue why.
Nevertheless, skin developers can now provide their own script-screensaver-digitalclock-custom.xml and screensaver will use it!
I already tested it but try it out and let me know if it works for you too, or if anything should get changed.
Thanks again for all your help!
Voja

works great!

here is the previous test code I was using after converting it from 720p to 1080i
(since Titan is a 1080i skin):

http://pastebin.com/d8JZ0w6g

if you didn't already know - when say for instance a script like yours has things based on 720p but the target skin is based on another resolution (like 1080i) custom skin files will need to convert things like posx and posx, width, height, etc to account for the differences.

I use a tool like
https://github.com/phil65/xmlconvertgui

it's made to convert a whole skin folder but I just make a copy of confluence skin folder since it's 720p and toss in whatever xml I need to convert - overkill yea, but it's quick and easy :)

the result:

apwanek 1

although most folks who know enough to write custom skin xml code should know about the 720p -> 1080i, etc - you may want to make a note in your readme that target skins not based on 720p will need to make adjustments for the target skins resolution.

I am pleased - everything seems to work perfectly.

You are awesome! Thanks again!!

Mario

PS - regarding not being able to read from userdata/addon_data/your addon/ - this could be a limitation of the screensaver addon type - i could not readily find anything to say one way or the other. did you get an error of any kind when trying to read/write?

more playing around :)

2015-10-18_17-30-23

vdb86 commented

I tried my screensaver with some 1080i skins and everything worked normal, screen felt the same size and everything was centered.
I'll look into it.

I didn't go into the debug log since I'm almost sure it should show me information from my screensaver, which is not that well built for debugging.
I know that my screensaver "sees" the file, but it just won't use it.
The weird thing is that if I put the same file in for example current skins 1080i folder and try it again it will work, it's supposed to read the file in userdata/addon_data/your addon/ but it seems to read the one in skins 1080i folder, I know that the coding is correct, no mistakes.
It doesn't matter in the end, I have encountered so many undocumented things on which I wasted so much time it's unbelievable. :)

Yea - I would remove or comment out the addon_data code and push to kodi repo for the masses to enjoy :)

great work!

thanks

mario

----- Original Message -----

I tried my screensaver with some 1080i skins and everything worked normal, screen felt the same size and everything was centered.
I'll look into it.

I didn't go into the debug log since I'm almost sure it should show me information from my screensaver, which is not that well built for debugging.
I know that my screensaver "sees" the file, but it just won't use it.
The weird thing is that if I put the same file in for example current skins 1080i folder and try it again it will work, it's supposed to read the file in userdata/addon_data/your addon/ but it seems to read the one in skins 1080i folder, I know that the coding is correct, no mistakes.
It doesn't matter in the end, I have encountered so many undocumented things on which I wasted so much time it's unbelievable. :)


Reply to this email directly or view it on GitHub:
#3 (comment)

vdb86 commented

Will do, thanks again for your help!

hey totally forgot about these skin infolabels from http://kodi.wiki/view/InfoLabels

2015-10-19_11-44-07

so this would hopefully allow you to use special://skin + Skin.AspectRatio as a more reliable way to find the path to a skin's custom xml.

hope this works/helps!

Mario

vdb86 commented

I'm a bit worried about the closest aspect ratio part, current setup should work just fine :)
But thanks!