[RELEASE] Super Favourites AKA Super-Addon Creator

  Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #31
(2014-05-09 20:15)Lunatixz Wrote:  Any chance you can make a small change to your plugin... if it's possible...

I noticed if you create a folder, copy a favorite directory. Then query super fav in json it returns the directory as a file not a directory.

Anyway to have it return it's true identity (directory)?

Root returns files and directories correctly...
Code:
{
            "file": "plugin://plugin.program.super.favourites/?label=Channel_100&mode=400&path=D%3A%5CXBMC%5Cportable_data%5Cuserdata%5Caddon_data%5Cplugin.program.su​per.favourites%5CSuper+Favourites%5CChannel_100",
            "filetype": "directory",
            "label": "Channel_100",
            "type": "unknown"
        },

Within a custom folder return is correct...but
Code:
{
    "files": [
        {
            "file": "plugin://plugin.program.super.favourites/?label=Create+New+Super+Folder&mode=500&path=D%3A%5CXBMC%5Cportable_data%5Cuserdata%5Caddon_data%5Cplugin.program.su​per.favourites%5CSuper+Favourites%5CChannel_100",
            "filetype": "file",
            "label": "Create New Super Folder",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=&mode=0",
            "filetype": "file",
            "label": "",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=Explore+XBMC+favourites&mode=300",
            "filetype": "directory",
            "label": "Explore XBMC favourites",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=&mode=0",
            "filetype": "file",
            "label": "",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=Latest+Episodes&mode=600&cmd=ActivateWindow%2810025%2C%22plugin%3A%2F%2Fplugin.video.cartoonworld%2F%​3Fmode%3Dlatest%22%2Creturn%29",
            "filetype": "file",
            "label": "Latest Episodes",
            "type": "unknown"
        }
    ],
    "limits": {
        "end": 5,
        "start": 0,
        "total": 5
    }
}

If you have a directory within the custom folder, it's listed as a file. "Latest Episodes is a directory"
Code:
{
            "file": "plugin://plugin.program.super.favourites/?label=Latest+Episodes&mode=600&cmd=ActivateWindow%2810025%2C%22plugin%3A%2F%2Fplugin.video.cartoonworld%2F%​3Fmode%3Dlatest%22%2Creturn%29",
            "filetype": "file",
            "label": "Latest Episodes",
            "type": "unknown"
        }

Bit of an odd one that.

The problem is that in my code when I add a Folder I call

Code:
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=True)

whereas when I add a Favourite I call:

Code:
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=False)

It is really a problem with what XBMC interprets isFolder to mean; really it just means when I click this listitem this plugin will populate a new folder (ie a list), in other words in the XBMC plugin framework if a list item is flagged as a folder then the plugin is responsible for populating the next list when the item is clicked.

Therefore as far as my plugin is concerned in this instance 'Latest Episodes' isn't a folder simply because my plugin itself isn't going to being populating a new list when the item is clicked, it just calls xbmc.exceutebuiltin (which just so happens to end up with a list being populated by someone else!)

But I'll do some more digging and see if I can trick XBMC into playing nicely!

(what json command are you using?)
(This post was last modified: 2014-05-09 21:48 by spoyser.)
find quote
Lunatixz Offline
Skilled Python Coder
Posts: 4,796
Joined: May 2011
Reputation: 141
Location: NYC
Post: #32
(2014-05-09 21:45)spoyser Wrote:  
(2014-05-09 20:15)Lunatixz Wrote:  Any chance you can make a small change to your plugin... if it's possible...

I noticed if you create a folder, copy a favorite directory. Then query super fav in json it returns the directory as a file not a directory.

Anyway to have it return it's true identity (directory)?

Root returns files and directories correctly...
Code:
{
            "file": "plugin://plugin.program.super.favourites/?label=Channel_100&mode=400&path=D%3A%5CXBMC%5Cportable_data%5Cuserdata%5Caddon_data%5Cplugin.program.su​per.favourites%5CSuper+Favourites%5CChannel_100",
            "filetype": "directory",
            "label": "Channel_100",
            "type": "unknown"
        },

Within a custom folder return is correct...but
Code:
{
    "files": [
        {
            "file": "plugin://plugin.program.super.favourites/?label=Create+New+Super+Folder&mode=500&path=D%3A%5CXBMC%5Cportable_data%5Cuserdata%5Caddon_data%5Cplugin.program.su​per.favourites%5CSuper+Favourites%5CChannel_100",
            "filetype": "file",
            "label": "Create New Super Folder",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=&mode=0",
            "filetype": "file",
            "label": "",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=Explore+XBMC+favourites&mode=300",
            "filetype": "directory",
            "label": "Explore XBMC favourites",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=&mode=0",
            "filetype": "file",
            "label": "",
            "type": "unknown"
        },
        {
            "file": "plugin://plugin.program.super.favourites/?label=Latest+Episodes&mode=600&cmd=ActivateWindow%2810025%2C%22plugin%3A%2F%2Fplugin.video.cartoonworld%2F%​3Fmode%3Dlatest%22%2Creturn%29",
            "filetype": "file",
            "label": "Latest Episodes",
            "type": "unknown"
        }
    ],
    "limits": {
        "end": 5,
        "start": 0,
        "total": 5
    }
}

If you have a directory within the custom folder, it's listed as a file. "Latest Episodes is a directory"
Code:
{
            "file": "plugin://plugin.program.super.favourites/?label=Latest+Episodes&mode=600&cmd=ActivateWindow%2810025%2C%22plugin%3A%2F%2Fplugin.video.cartoonworld%2F%​3Fmode%3Dlatest%22%2Creturn%29",
            "filetype": "file",
            "label": "Latest Episodes",
            "type": "unknown"
        }

Bit of an odd one that.

The problem is that in my code when I add a Folder I call

Code:
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=True)

whereas when I add a Favourite I call:

Code:
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=False)

It is really a problem with what XBMC interprets isFolder to mean; really it just means when I click this listitem this plugin will populate a new folder (ie a list), in other words in the XBMC plugin framework if a list item is flagged as a folder then the plugin is responsible for populating the next list when the item is clicked.

Therefore as far as my plugin is concerned in this instance 'Latest Episodes' isn't a folder simply because my plugin itself isn't going to being populating a new list when the item is clicked, it just calls xbmc.exceutebuiltin (which just so happens to end up with a list being populated by someone else!)

But I'll do some more digging and see if I can trick XBMC into playing nicely!

(what json command are you using?)

Code:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"plugin://plugin.program.super.favourites"},"id":17}

I then query the results to peek at the contents in the folders...

I wrote a plugin chtype for pseudo that walks recursively through a plugin looking for "files" but it counts on a plugin returning "directory" or "file" file types.

Hoping when we are finished your plugin is the go to easy configuration tool for creating "Plugin and Streaming" channels for PseudoTV Live...
(This post was last modified: 2014-05-09 22:46 by Lunatixz.)
find quote
psike Offline
Fan
Posts: 408
Joined: Aug 2008
Reputation: 0
Post: #33
Bug:
Enable override context menu, then disable super favorites addon.
XBMC will completely lose it's context menu, even after restart it's still gone.
Only way to fix it is by enabling the addon again then disabling the override.

Code:
10:20:37 T:6024   ERROR: EXCEPTION: Could not get AddonPtr!
10:20:37 T:6024   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: Could not get AddonPtr!
                                            Traceback (most recent call last):
                                              File "C:\Users\Psike\AppData\Roaming\XBMC\addons\plugin.program.super.favourites\captu​re.py", line 25, in <module>
                                                import utils
                                              File "C:\Users\Psike\AppData\Roaming\XBMC\addons\plugin.program.super.favourites\utils​.py", line 36, in <module>
                                                ADDON   =  xbmcaddon.Addon(ADDONID)
                                            RuntimeError: Could not get AddonPtr!
                                            -->End of Python script error report<--
10:20:37 T:2724   ERROR: Control 402 in window 10107 has been asked to focus, but it can't
(This post was last modified: 2014-05-10 09:30 by psike.)
find quote
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #34
(2014-05-10 09:27)psike Wrote:  Bug:
Enable override context menu, then disable super favorites addon.
XBMC will completely lose it's context menu, even after restart it's still gone.
Only way to fix it is by enabling the addon again then disabling the override.

Well spotted and thanks for letting me know about it.

I have sorted out a fix for it but since it isn't a show stopper I will wait to put it out in the next release.

Why would anyone want to disable Super Favourites anyway LOL
(This post was last modified: 2014-05-10 11:24 by spoyser.)
find quote
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #35
(2014-05-09 20:15)Lunatixz Wrote:  Any chance you can make a small change to your plugin... if it's possible...

I noticed if you create a folder, copy a favorite directory. Then query super fav in json it returns the directory as a file not a directory.

Anyway to have it return it's true identity (directory)?

Right, I have made a few changes which should hopefully give you what you need.

I have changed the addon so that PlayMedia type favourites are now set with isFolder=False (so will be classed as 'Files'), whereas ActivateWindow and RunScript types are set with isFolder=True (so will appear as Directories in the json response).

This should now do as you wish, if you see any classified incorrectly can you let me know and I'll see what can be done.

The code is in Git, but if you just want the latest addon you can get it from here:

https://github.com/spoyser/spoyser-repo/...-1.0.4.zip

This should definitely be classed as a beta release!
find quote
Lunatixz Offline
Skilled Python Coder
Posts: 4,796
Joined: May 2011
Reputation: 141
Location: NYC
Post: #36
(2014-05-10 16:16)spoyser Wrote:  
(2014-05-09 20:15)Lunatixz Wrote:  Any chance you can make a small change to your plugin... if it's possible...

I noticed if you create a folder, copy a favorite directory. Then query super fav in json it returns the directory as a file not a directory.

Anyway to have it return it's true identity (directory)?

Right, I have made a few changes which should hopefully give you what you need.

I have changed the addon so that PlayMedia type favourites are now set with isFolder=False (so will be classed as 'Files'), whereas ActivateWindow and RunScript types are set with isFolder=True (so will appear as Directories in the json response).

This should now do as you wish, if you see any classified incorrectly can you let me know and I'll see what can be done.

The code is in Git, but if you just want the latest addon you can get it from here:

https://github.com/spoyser/spoyser-repo/...-1.0.4.zip

This should definitely be classed as a beta release!

Thanks again... I'll check it out later

::Update::

Works great, thanks again...
(This post was last modified: 2014-05-11 01:18 by Lunatixz.)
find quote
senna99 Offline
Fan
Posts: 609
Joined: Sep 2011
Reputation: 4
Location: Xlendi Malta
Post: #37
Hello spoyser

Is there any possibility to display ContextMenu in home section,or edith super.favourites from home section ?

Best Regards
find quote
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #38
(2014-05-13 12:27)senna99 Wrote:  Hello spoyser

Is there any possibility to display ContextMenu in home section,or edith super.favourites from home section ?

Best Regards

I could have a look, what would you want the menu to have from the home screen.

As there isn't a currently selected list item when on the Home screen to add to favourites would you want it to offer to open Super Favourites for you instead?
find quote
senna99 Offline
Fan
Posts: 609
Joined: Sep 2011
Reputation: 4
Location: Xlendi Malta
Post: #39
Hello spoyser

Thanks for the reply, you're right, I want to have menu in home screen. Like on xbox one pins screen, to move or delete or rename super favourites .
Of course if this is possible .

Best Regards
find quote
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #40
(2014-05-13 19:51)senna99 Wrote:  Hello spoyser

Thanks for the reply, you're right, I want to have menu in home screen. Like on xbox one pins screen, to move or delete or rename super favourites .
Of course if this is possible .

Best Regards

But what do you want on the menu when on the home screen?
find quote
senna99 Offline
Fan
Posts: 609
Joined: Sep 2011
Reputation: 4
Location: Xlendi Malta
Post: #41
Hello spoyser

English is not my native language,I apologize if I was unclear.
Next, when I press F7 or any other button on the keyboard. I want to get menu with controls move up,move down,edith,delete,rename etc...
Of course if this is possible with your script.

Best Regards
find quote
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #42
(2014-05-13 21:03)senna99 Wrote:  Hello spoyser

English is not my native language,I apologize if I was unclear.
Next, when I press F7 or any other button on the keyboard. I want to get menu with controls move up,move down,edith,delete,rename etc...
Of course if this is possible with your script.

Best Regards

Can you not just press the menu button (or C on your keyboard)
find quote
senna99 Offline
Fan
Posts: 609
Joined: Sep 2011
Reputation: 4
Location: Xlendi Malta
Post: #43
Hello spoyser

In any case thanks,your last comment would probably say that it is not possible.

Best Regards
find quote
spoyser Offline
Donor
Posts: 1,339
Joined: Oct 2011
Reputation: 69
Post: #44
(2014-05-13 23:03)senna99 Wrote:  Hello spoyser

In any case thanks,your last comment would probably say that it is not possible.

Best Regards

I'm sure I could do what you want, unfortunately I don't really understand what it is you want Sad
find quote
senna99 Offline
Fan
Posts: 609
Joined: Sep 2011
Reputation: 4
Location: Xlendi Malta
Post: #45
Hello spoyser

I'm really sorry,I do not know how else to explain my question.
For example I have your one super.favourites on home section Eminem- Legacy.mp3 ,on the pictures you can see command window or ContextMenu.
That ContextMenu I want on home section, when I press the C button to have possibility to edith favourites froim home section.
I hope I made ​​an effort to explain my question.Once again apologize for bad writing English.

Best Regards

[Image: K3XbPBd.png]


[Image: 8pptid2.png]
find quote
Post Reply