Can we run addons AFTER a library update?
#1
I want to create a prompt that asks the user if they want to run the "Logo Downloader" addon and the "Tv Tunes" addon BUT only after they have updated the library and added new TV Shows.

Is there a way to do this?
Image
To learn more, click here.
Reply
#2
You might be able to track and watch the scanners state in a service add-on.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
vdrfan Wrote:You might be able to track and watch the scanners state in a service add-on.

Can you elaborate? I'm a skinner not a developer, sorry.
Image
To learn more, click here.
Reply
#4
Lemme hook up a test service add-on Wink
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
there is also the <onunload> tag, but that would just pop up the message after each scan.
Reply
#6
This one should work even though it's pretty hacky..

Code:
import xbmc

while (not xbmc.abortRequested):

  musicScan = False
  videoScan = False

  while (xbmc.getCondVisibility("library.isscanningmusic")):
    if (not musicScan):
      xbmc.log("service.scanner.notify: music scan started ..", level=xbmc.LOGDEBUG)
    musicScan = True
    xbmc.sleep(1000)

  while (xbmc.getCondVisibility("library.isscanningvideo")):
    if (not videoScan):
      xbmc.log("service.scanner.notify: video scan started ..", level=xbmc.LOGDEBUG)
    videoScan = True
    xbmc.sleep(1000)

  if (videoScan):
    xbmc.log("service.scanner.notify: video scan finished", level=xbmc.LOGDEBUG)

  if (musicScan):
    xbmc.log("service.scanner.notify: video scan finished", level=xbmc.LOGDEBUG)

  xbmc.sleep(1000)
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#7
vdrfan Wrote:This one should work even though it's pretty hacky..

Code:
import xbmc

while (not xbmc.abortRequested):

  musicScan = False
  videoScan = False

  while (xbmc.getCondVisibility("library.isscanningmusic")):
    if (not musicScan):
      xbmc.log("service.scanner.notify: music scan started ..", level=xbmc.LOGDEBUG)
    musicScan = True
    xbmc.sleep(1000)

  while (xbmc.getCondVisibility("library.isscanningvideo")):
    if (not videoScan):
      xbmc.log("service.scanner.notify: video scan started ..", level=xbmc.LOGDEBUG)
    videoScan = True
    xbmc.sleep(1000)

  if (videoScan):
    xbmc.log("service.scanner.notify: video scan finished", level=xbmc.LOGDEBUG)

  if (musicScan):
    xbmc.log("service.scanner.notify: video scan finished", level=xbmc.LOGDEBUG)

  xbmc.sleep(1000)

I found this: http://wiki.xbmc.org/index.php?title=HOW...g_services

Do I have to have different addons in general? Do I have to have a separate logo downloader addon that is a service instead?
Image
To learn more, click here.
Reply
#8
There are multiple scenarios. You could add a service that spawns the desired script/addon or you (the author) transforms the script into a service addon. I am 100% unsure about the <onunload> skin thingy..
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#9
Just add <onunload>your_control</onunload> to the library scan xml.
Reply
#10
as Big_Noid and Hitcher said You can use <onunload> in DialogVideoScan.xml:
Code:
<window id="133">
  <onunload>RunScript(<id_of_logo_downloader>)</onunload>
  [...]
Unfortunately this won't check if something was actually added. Perhaps logo downloader can be run in "silent" mode (no dialogs popping up) so this wouldn't annoy users? (just wild guess here)
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
Reply
#11
Thanks for the tips guys, I'll look into doing it this way and post my results.
Image
To learn more, click here.
Reply
#12
just note that adding it to DialogVideoScan.xml is not a 100% guarantee the script will run,
as users have the option to hide this dialog:
Settings > Videos > Hide progress of library updates.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#13
We really should make python aware of the announce managment stuff.. So we have something like the players OnPlayback* stuff.

I can recall topfs told me something about it on IRC a few month ago. Will ping him again .)
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#14
vdrfan Wrote:We really should make python aware of the announce managment stuff.. So we have something like the players OnPlayback* stuff.

I can recall topfs told me something about it on IRC a few month ago. Will ping him again .)

That would be great. It would be nice to be able to say..

Did the user just add music? If so....do this...

Did the user just add a movie? If so....do this...

etc.
Image
To learn more, click here.
Reply

Logout Mark Read Team Forum Stats Members Help
Can we run addons AFTER a library update?0