• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 23
[RELEASE] RandomItems (Random Items) Script
#76
Big_Noid Wrote:this works:
Code:
<onclick>RunAddon($INFO[Window.Property(RandomAddon.%d.Path)])</onclick>

Indeed, I feel stupid now. Wink
Image
To learn more, click here.
Reply
#77
igotdvds Wrote:Indeed, I feel stupid now. Wink

my bad.
i've corrected the info i provided a few pages back.
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
#78
grajen3 Wrote:you can query sql directly from python (using f.e. pysqlite)

cheers mate, i'll keep that in mind.
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
#79
ronie Wrote:i have added Random Addons to the script

the script will now also scan your addons folder for installed plugins and scripts
and make these info labels available to the skin:

Code:
RandomAddon.%d.Name
RandomAddon.%d.Author
RandomAddon.%d.Summary
RandomAddon.%d.Version
RandomAddon.%d.Path
RandomAddon.%d.Fanart
RandomAddon.%d.Thumb
Addons.Count

the Path can be used to run the addon:
Code:
<onclick>RunAddon($INFO[Window.Property(RandomAddon.%d.Path)])</onclick>


as mentioned, it's currently plugins and scripts only.
i'm not sure if it would make sense to include other addons as well,
like skins, visualizations, scrapers, etc..
since we can't run them from our home screen anyway.

let me now what you think and if there's any issues.

note: this is for nightly builds only. it is not Dharma compatible!

available in the eden-pre addon repo as of today.
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
#80
Getting this error on latest nightly:

Quote:16:31:21 T:4832 M:2545885184 ERROR: Error Type: <type 'exceptions.Exception'>
16:31:21 T:4832 M:2545885184 ERROR: Error Contents: Could not get AddonPtr given a script id of plugin.image.facebook. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
16:31:21 T:4832 M:2545909760 ERROR: Traceback (most recent call last):
File "C:\Users\Wiz\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 311, in <module>
Main()
File "C:\Users\Wiz\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 105, in __init__
self._fetch_addon_info()
File "C:\Users\Wiz\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 258, in _fetch_addon_info
addontype = xbmcaddon.Addon(id=addonid).getAddonInfo('type')
Exception: Could not get AddonPtr given a script id of plugin.image.facebook. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
16:31:22 T:7056 M:2547798016 ERROR: Texture manager unable to load file: special://profile/Thumbnails/Video/e/auto-e1d3e1cd.tbn
16:31:23 T:7792 M:2545487872 ERROR: dll_fgets emulated function failed
Image
To learn more, click here.
Reply
#81
igotdvds Wrote:Getting this error on latest nightly:

cheers for the report :-)
will check if i can figure out what's causing this issue.
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
#82
The link to download the pre-eden script from google code is broken
Reply
#83
DanLongman Wrote:The link to download the pre-eden script from google code is broken

that's most certainly because of this :-)
ronie Wrote:available in the eden-pre addon repo as of today.

http://mirrors.xbmc.org/addons/eden-pre/...ndomitems/
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
#84
igotdvds Wrote:Getting this error on latest nightly:

the only reason why i can see this happening is if you manually
copy an addon to the addons folder and don't restart xbmc afterwards...

will add some better error handling in the next version to avoid a thing like that will crash the script.
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
#85
@ ronie

Care to check out this error please?

Code:
13:46:37 T:1080 M:2203914240    INFO: -->Python script returned the following error<--
13:46:37 T:1080 M:2203914240   ERROR: Error Type: <type 'exceptions.Exception'>
13:46:37 T:1080 M:2203914240   ERROR: Error Contents: Could not get AddonPtr given a script id of metadata.amazon.com. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
13:46:37 T:1080 M:2203901952   ERROR: Traceback (most recent call last):
                                              File "C:\Users\Kevin\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 311, in <module>
                                                Main()
                                              File "C:\Users\Kevin\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 105, in __init__
                                                self._fetch_addon_info()
                                              File "C:\Users\Kevin\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 258, in _fetch_addon_info
                                                addontype = xbmcaddon.Addon(id=addonid).getAddonInfo('type')
                                            Exception: Could not get AddonPtr given a script id of metadata.amazon.com. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
13:46:37 T:1080 M:2203901952    INFO: -->End of Python script error report<--

Thanks.
Reply
#86
i have (almost) completely re-written the script from scratch,
it now uses json-rpc to fetch the data instead of the deprecated http-api.

also, the error posted above should be fixed now.

similar to recentlyadded, you now have seperate infolabels for albums and songs,
here's what's available:

Quote:"RandomMovie.%d.Title"
"RandomMovie.%d.Rating"
"RandomMovie.%d.Year"
"RandomMovie.%d.RunningTime"
"RandomMovie.%d.Path"
"RandomMovie.%d.Trailer"
"RandomMovie.%d.Fanart"
"RandomMovie.%d.Thumb"
"RandomMovie.Count"

"RandomEpisode.%d.ShowTitle"
"RandomEpisode.%d.EpisodeTitle"
"RandomEpisode.%d.EpisodeNo"
"RandomEpisode.%d.EpisodeSeason"
"RandomEpisode.%d.EpisodeNumber"
"RandomEpisode.%d.Rating"
"RandomEpisode.%d.Path"
"RandomEpisode.%d.Fanart"
"RandomEpisode.%d.Thumb"
"RandomEpisode.Count"

"RandomAlbum.%d.Title"
"RandomAlbum.%d.Year"
"RandomAlbum.%d.Artist"
"RandomAlbum.%d.Path"
"RandomAlbum.%d.Fanart"
"RandomAlbum.%d.Thumb"
"RandomAlbum.%d.Rating"
"RandomAlbum.Count"

"RandomSong.%d.Title"
"RandomSong.%d.Year"
"RandomSong.%d.Artist"
"RandomSong.%d.Album"
"RandomSong.%d.Path"
"RandomSong.%d.Fanart"
"RandomSong.%d.Thumb"
"RandomSong.%d.Rating"
"RandomSong.Count"

"RandomAddon.%d.Name"
"RandomAddon.%d.Author"
"RandomAddon.%d.Summary"
"RandomAddon.%d.Version"
"RandomAddon.%d.Path"
"RandomAddon.%d.Fanart"
"RandomAddon.%d.Thumb"
"RandomAddon.Count"

script options:
Quote:limit=# ; # to limit returned results (default=5)
unplayed=True ; True to return only items that have not been played (default=False)
trailer=True ; True to play the trailer (if available) (default=False)
alarm=# ; # number of minutes before running again (default=Off)

download: script.randomitems-3.0.1.zip


if some of you could test it and let me know of any errors, i'd appreciate it.
will submit it to the addon repo if no bugs are found.

this script is for xbmc pre-eden only!
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
#87
ronie Wrote:this script is for xbmc pre-eden only!

I expect this is because of technical limitations otherwise it would be Dharma compatible too?
My skins:

Amber
Quartz

Reply
#88
pecinko Wrote:I expect this is because of technical limitations otherwise it would be Dharma compatible too?

the json-rpc implementation in dharma is kinda 'immature' compared to what we can do with it now.
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
#89
Everything else works but I still get an error to do with Addons -

Code:
17:13:19 T:2752 M:2446483456    INFO: -->Python script returned the following error<--
17:13:19 T:2752 M:2446483456   ERROR: Error Type: <type 'exceptions.Exception'>
17:13:19 T:2752 M:2446483456   ERROR: Error Contents: Could not get AddonPtr given a script id of metadata.amazon.com. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
17:13:19 T:2752 M:2446446592   ERROR: Traceback (most recent call last):
                                              File "C:\Users\Kevin\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 479, in <module>
                                                Main()
                                              File "C:\Users\Kevin\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 71, in __init__
                                                self._fetch_addon_info()
                                              File "C:\Users\Kevin\AppData\Roaming\XBMC\addons\script.randomitems\RandomItems.py", line 415, in _fetch_addon_info
                                                addontype = xbmcaddon.Addon(id=addonid).getAddonInfo('type')
                                            Exception: Could not get AddonPtr given a script id of metadata.amazon.com. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
17:13:19 T:2752 M:2446442496    INFO: -->End of Python script error report<--

Appreciate the work done though. Big Grin
Reply
#90
hehe, i'm a sloppy coder Smile
i did fix the issue, but forgot to remove the code that was causing the error...


script.randomitems-3.0.1.zip
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
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 23

Logout Mark Read Team Forum Stats Members Help
[RELEASE] RandomItems (Random Items) Script2