2017-08-31, 01:08
(2017-08-10, 00:53)sshah93 Wrote:(2017-08-09, 12:35)ironic_monkey Wrote: it sounds like you are doing everything correct but all the details are as important. did you remember to make them files and not directories ? you are supposed to get a callback to your add-on on that click, but something hinders it. can you extract some code maybe so we can inspect it ?
also one thing i forgot to make explicit: the url of the item you mark as playable has to be of the plugin://<your id> type.
Hello,
Sorry was at work all day
Anyways, your above comment fixed it.
Esentially within the:
Code:xbmcplugin.addDirectoryItem( )
For the url parameter, I was accidentally sending it the url itself instead of passing it u, which was:
Code:u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)+"&fanart="+urllib.quote_plus(fanart)+"&description="+urllib.quote_plus(description)
Finally, after changing xbmcplugin.addDirectoryItem(url = u), I could finally access it from the section where we do:
Code:if mode == ??: xxx
There after I got another error, regarding the way I setResolvedUrl, however, by looking at the python module docs, I identified, it was due to me not giving it certain parameters which it required, which were:
Code:xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
i.e. the parameters: int(sys.argv[1]) and True
Once again thankyou very much, It finally works as I wanted it to, which is it shows me whats watched now, and gives me option to resume partly watched videos. However, 2 more final things I would like to ask if possible.
ISSUE 1:
Essentially, currently my layout for my addon directory is in the following format:
Category Directory -> video_names Directory
So from the category directory, once opened we get to view the related video_names, now I have one main category which when clicked shows all video_names list, and then the rest of the categories, simply show related video names (i.e. part of the video_names, that are found in main category),
Currently if I set a video_name item to watched on the main category, its saved as watched there, however, if I go to its sub category, the video shows as unwatched, so is there away I can tell kodi to either just look out for matching names and give them their watched status accordingly (i.e. sync all related watched data for the same video_name item, found within different directories).
ISSUE 2:
Final thing is, Like many addons, how can i add an option to the category directory item, where if I right click on my mouse, on a particular category item, on the menu that appears, is there away I can make it set an option to set all items as watched or unwatched.
Once again, Thank you, very much for your support, you have really helped me solved an issue that I was struggling with, and I hope it helps other newbs like me. Sorry for pushing my luck but I hope you can continue to aid me with solving my other 2 issues.
Cheers
I am sorry to bring this up again, however I still havent been able to solve issue 2 above. Can anybody help me, please