v17 Kodi Default Directory Loader Overlaying over the GUI Progress Bar in Kodi 17
#1
Hi,

I was wondering if someone can help me.

I am trying to develop a test addon, for myself and today I have run in to an issue, that I just cant seem to overcome.

Essentially, my issue relates to the loader displayed when kodi tries to load the contents of a selected directory item.

I have set up my kodi addon today, to start using xbmcgui.DialogProgress(), when loading the contents of a particular selected directory item within my addon, which works fine and as wanted.

Basically, after implementing this "xbmcgui.DialogProgress()", which allowed me to set a more personalised loader menu, showing relevant info of the contents being loaded, and also allowing any user to know that the code is still executing when time.sleep() has been activated, and finally the cancel button also allowed me to set it up as an option to break the loop, and allow a user to continue seeing what has already been loaded.

Unfortunately, after testing it several times, now a weird issue seems to occur, which is basically when i open the relevant directory, the progress bar shows as expected, however, it shows in the background, due to the default kodi 17 loader (The spinning circle shown in the middle of the screen) being overlayed over it.

This is annoying because the default kodi loader, creates a transparent layer, which dms the visibility of other things in the background, and also because it is in the middle it also covers some of the progress bar info. Additionally, if I need to cancel out of the loader, I am forced to press escape or backspace now, to get rid of the default kodi loader and then once again either press backspace, escape or "The Cancel Button" on the displaying Dialog progress bar to take it off the screen.

I have checked several places online and my code for displaying the progressbar is not the issue, but cant seem to finad any solution on getting rid of the default kodi loader and making it just display "xbmcgui.DialogProgress()" progressbar instead, if anyone can recommend what maybe the cause and how to solve it, I would really appreciate it.

Currently, I feel its just a bug on Kodi 17, maybe just my Kodi 17 setup, and therefore I will later try to test it on a different device to confirm and update this post later.

Sorry for the long explanation, I have tried my best to inform what my issue is, however if you still require more information please dont hesitate to ask.

Many Thanks.
Reply
#2
Is this is a plugin or a script? There is a lot of speculation without looking at code... assuming this is a video plugin... My guess is you are building a xbmc.addDirectoryItem while trying to use a custom progress bar. This will conflict with Kodis builtin progress bar that is control using the "totalItems" parameter.
https://codedocs.xyz/xbmc/xbmc/namespace...2baff1dc34
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
Hi Thankyou for the reply,

I understand what you mean, yes for my code I am using the xbmc.addDirectoryItem function, and within it I do have the "totalItems" parameter, this was because in the previous versions of Kodi before kodi 17, the "totalItems" parameter allowed kodi to show a sort of progress bar loader with default kodi loader (Which was a spinner in the bottom right corner with a progress bard above it), however kodi 17 got rid of the progress bar for Kodi 17, by just showing the middle circle spinner for the default kodi loader, and therefore I decided to make this custom progressbar.

Ok so I can definitely confirm now, what I experienced yesterday must have most definitely been a bug (Couldnt pick the cause in the logs even though I put Kodi on Debugging mode aswell), because today when I retried before omitting the totalItems parameter, the default kodi parameter did not overlay over the custom one I made using xbmcgui.DialogpProgress(), however just to be safe, I will be getting rid of the "totalItems" parameter aswell since its kinda useless for kodi 17.

Just to reassure that my code is fine, below is a sample of how i have written my code for displaying the custom progress bar:

Code:
#Global Variables
progressbar             = xbmcgui.DialogProgress()

def addDir(name,url,mode,iconimage,fanart,description, total):
    #processes relevant content for "xbmcgui.ListItem" and stuff, finally leading to:
    ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True, totalItems = total)
    return ok
    
def retrieve vid_list(selectedCategory):
    content = # retrieves contents from the site i am using.
    match = #performing regex to retrieve relevant info from

    progressbar.create('Retreiving Episode List For: ' + name, 'Processing:')
    progressCount = 1
    total = len(match)

    for url, name in match:
        if progressbar.iscanceled():
            break

        percent = float(progressCount)/float(total) * 100

        message1 = "Processing: " + name) #Skipping message2 because message1 is multi line according to pydocs, giving room for larger names to overflow.
        message3 = "Processed: {}/ {}".format(progressCount, total)
        
        progressbar.update(int(percent),message1,"",message3)

        progressCount += 1

        #Then processing of the related directory content done beyond this point

        #finally after all is done, I make the following call for it to process and create a new directory items.
        addDir(name2,url2,4,icon,fanart,description,total)

This is a skimmed down version of my code so hopefully its easy for you to check and let me know what I am doing wrong.

Side Note: to get the percent i was forced to convert the int values to float, because python decided that an int divided by an int = 0, found that so silly, but oh well.

Well currently my issue seems to have gone away for now, but if it happens again I will repost it here.

Final question, Is the parameter totalItems, even necessary now since they have removed the default kodi progress bar loader in kodi 17, I was thinking of getting rid of them n just use my custom loaders as they are more informative and appealing, over a spinning circle.

Thank you.
Reply
#4
I wasn't aware it was removed... at least its still in source:
https://github.com/xbmc/xbmc/blob/fb8a03...y.cpp#L577

What you described sounds to me like "DialogProgressBG" is being displayed because of the totalitems option during directory build, which in some skins can trigger the "dim" layer you described.

Let me know if removing totalitems works...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
Hi Lunatixz,

Sorry for the late reply.

I had a long fun weekend, due to a friends engagement taking place.

Anyways, back to the topic, I havent attempted to use, "DialogProgressBG" because, I wasnt sure if it was going to take up the whole screen, which I didnt want.

I had already removed "totalitems" as mentioned on my last post, and still seem to be having the issue randomly happen from time to time.

In most cases where it does not directly happen, and loads the content using xbmcgui.DialogProgress, if I hit cancel which is meant to break the loop, and then go back and open the same directory, I have noticed the issue reoccuring again.

Side Note: I am currently stuck from testing this any further, because the website I am webscrapping used emojis as part of some names which HTMLParser().unescape() was not able to properly decode, and so far, my attempts to try and fix these "encoding" and "special character" related issues are not working at all. And actually, trying to fix them, I have sort of broken my addon atm, because I keep running into Log errors which I had already fixed in the past. Oh well, I guess this is an issue for another post, but if you dont mind, could you recommend a better decoder then HTMLParser().unescape(), which can be imported by Kodi on any device. If you dont know of an alternative, could you show me how I can get kodi to import Beautiful Soup then, because several posts online say that beautiful soup is far better at decoding special character encodings.

Sorry for all the trouble and I really appreaciate all your support.
Reply
#6
Hi Lunatixz,

I found this post of yours: https://forum.kodi.tv/showthread.php?tid=238546, showing how you get beautifulsoup to import on your addon.

Unfortunately, even though I ammended the addon.xml to include:
Code:
<import addon="script.module.beautifulsoup" version="3.2.1"/>

AND

My default.py to include:
Code:
from BeautifulSoup import BeautifulSoup

When opening my addon, I keep getting "ImportError: No module named BeautifulSoup".

Sorry for being off topic, but for me to solve my existing issue, I kinda need this working because, htmlparser() does not work properly and is breaking my addon.

Sorry for all the trouble and once again I really appreaciate all your support.

Thank you.
Reply
#7
Hello,

Never mind please ignore my last posts, I have managed to fix my addons, issues in relation to character encodings, unfortunately, I am forced to just hard code the special characters that are failing to convert to replace them to their respective symbols.

However, my orginial issue of the default kodi loader overlaying over xbmcgui.progress() still occurs randomly, and I really appreciate if anybody has a solution.

Thank you.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi Default Directory Loader Overlaying over the GUI Progress Bar in Kodi 170