2022-02-15, 11:56
I have written a little service add-on which practically just sends notification to Kodi when certain conditions are met. (When I start a movie/tv show or play music I want the language, resolution, refresh rate and sound mode to appear on the screen).
I have grouped my media in different folders.
The code is working fine but I can't fix one issue:
The line in bold where I actually send the notification xbmc.executebuiltin( 'Notification(Info, Some text)' ) stays on the screen - forever, unless I change the window or to a file which is in a different folder (then a different notification stays on the screen). Not what I want.
What is missing so the line only executes once and the notification disappears after a few seconds?
I have grouped my media in different folders.
The code is working fine but I can't fix one issue:
The line in bold where I actually send the notification xbmc.executebuiltin( 'Notification(Info, Some text)' ) stays on the screen - forever, unless I change the window or to a file which is in a different folder (then a different notification stays on the screen). Not what I want.
What is missing so the line only executes once and the notification disappears after a few seconds?
python:if __name__ == '__main__':
monitor = xbmc.Monitor()
while not monitor.abortRequested():
def my_function_one():
for root, dirs, files in os.walk(path_1):
for x in dirs:
if condition_1 and condition_2:
**xbmc.executebuiltin( 'Notification(Info, Some text)' )**
break
def my_function_two():
for root, dirs, files in os.walk(path_2):
for y in dirs:
if condition_3 and condition_4:
**xbmc.executebuiltin( 'Notification(Info, Some other text)' )**
break
if monitor.waitForAbort(5):
break
my_function_one()
my_function_two()