Advice needed - where to put file (addon later in repo)
#1
Hi,

I need to include a small animation with my addon (about 20 kbyte).
I would like to try to get my addon accepted in the official repo (when it's complete).

wiki:
"add-ons should store all their data in their own subfolder inside the addon_data directory. Access (read/write/delete) to any other files / folders is not allowed by default. Exceptions to this rule may be granted in specific cases only."


Is there a way to copy the file to "special://userdata/addon_data/myaddon/myfile.mp4"? In other words, how do I get my file copied to this location while installing the addon?

Is it allowed to keep the file at "special://home/addons/myaddon/resources/myfile.mp4"? I just play it, I don't want to write to the file.

Some other solution?

What is the preferred solution?

Thanks
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#2
Why do you need that file within userdata?
Just leave it in your resources subfolder and access it from there whenever you have to.

E.g. that's how I define the location of images I need frequently in different files
https://github.com/linuxwhatelse/plugin..../thumbs.py

After that I can access a image by simply doing:
Quote:from addon import thumbs

thumbs.IMG_ALBUM

To give you a better solution in general we need more information on what you'r trying to achieve though.

Where do you wan't to display this animation?
Reply
#3
The wiki says it should be there? see first post...

This is a dummy animation (12 seconds of showing a black screen).

I need it to get an onplaybackstarted event from xbmc.player.

It is used as the first line in a ".strm" file, and I redirect the player then to another animation to play (a rewrite of my currrent addon for bluray iso support).

I just keep it then as "special://home/addons/myaddon/resources/myfile.mp4"...
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#4
I see...

I assume than that you want to display the dummy animation because whatever comes next takes some time before being playable?

In that case I think it'd be better to show a progress-dialog of some sort letting the user know that the addon "Is processing the request"
e.g. xbmcgui.DialogProgressBG should work for that (leaving the user the option to keep using kodi)
or xbmcgui.DialogProgress which would show a popup allowing the user to cancle the operation (if you implement it properly that is)
Reply
#5
Euh, no can do...

I really need the onplaybackstarted event. Playback of the dummy animation is stopped as soon as detected, user should see nothing of that dummy animation. But it is used to create a onplaybackstarted event. Otherwise I can't intercept the start of the playing of the .strm file and redirect Kodi to the correct bluray streamlist.

So, "special://home/addons/myaddon/resources/myfile.mp4" is OK? Would not give probs later when trying to get this addon in the repo?

thanks
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#6
As there is no copyright involved and it's rather small, I think it's okay.
And as long as this add-on doesn't do any form of piracy, you should be good.

As we don't have source code yet nor know what exactly this add-on will do,
I can't guarantee anything though.
This needs to be seen once you submit it to the repository.
Reply
#7
And the addon_data requirement is for written data. The addon can be hosted on ro storage, eg android
Reply

Logout Mark Read Team Forum Stats Members Help
Advice needed - where to put file (addon later in repo)0