• 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 23
[RELEASE] RandomItems (Random Items) Script
#91
I cannot get the randomalbums to display. Is this a fault of the script or has anybody got it working. In the log it seems to only load the query from songsview, not albumview:
Code:
16:22:27 T:5032 M:1709252608   DEBUG: CApplication::ExecuteXBMCAction : Translating XBMC.RunScript(script.randomitems,limit=8&unplayed=True)
16:22:27 T:5032 M:1709252608   DEBUG: CApplication::ExecuteXBMCAction : To XBMC.RunScript(script.randomitems,limit=8&unplayed=True)
16:22:27 T:5032 M:1709252608    INFO: initializing python engine.
16:22:27 T:5032 M:1709252608   DEBUG: new python thread created. id=24
16:22:27 T:4676 M:1709248512   DEBUG: Thread XBPyThread start, auto delete: 0
16:22:27 T:4676 M:1709248512   DEBUG: Python thread: start processing
16:22:27 T:4676 M:1708908544  NOTICE: -->Python Interpreter Initialized<--
16:22:27 T:4676 M:1708908544   DEBUG: XBPyThread::Process - The source file to load is C:\Program Files (x86)\XBMC_SVN\portable_data\addons\script.randomitems\RandomItems.py
16:22:27 T:4676 M:1708908544   DEBUG: XBPyThread::Process - Setting the Python path to C:\Program Files (x86)\XBMC_SVN\portable_data\addons\script.randomitems;C:\Program Files (x86)\XBMC_SVN\portable_data\addons\script.module.simplejson\lib;C:\Program Files (x86)\XBMC_SVN\portable_data\addons\script.module.beautifulsoup\lib;C:\Program Files (x86)\XBMC_SVN\addons\script.module.pil\lib;C:\Program Files (x86)\XBMC_SVN\portable_data\addons\script.module.elementtree\lib;C:\Program Files (x86)\XBMC_SVN\addons\script.module.pysqlite\lib;C:\Program Files (x86)\XBMC_SVN\system\python\DLLs;C:\Program Files (x86)\XBMC_SVN\system\python\Lib;C:\Program Files (x86)\XBMC_SVN\python26.zip;C:\Program Files (x86)\XBMC_SVN\system\python\lib\plat-win;C:\Program Files (x86)\XBMC_SVN\system\python\lib\lib-tk;C:\Program Files (x86)\XBMC_SVN;C:\Program Files (x86)\XBMC_SVN\system\python;C:\Program Files (x86)\XBMC_SVN\system\python\lib\site-packages;
16:22:27 T:4676 M:1708908544   DEBUG: XBPyThread::Process - Entering source directory C:\Program Files (x86)\XBMC_SVN\portable_data\addons\script.randomitems
16:22:27 T:4676 M:1708908544   DEBUG: Instantiating addon using automatically obtained id of "script.randomitems" dependent on version 2.0 of the xbmc.python api
16:22:27 T:4676 M:1707261952   DEBUG: CVideoDatabase::RunQuery took 16 ms for 265 items query: select * from movieview
16:22:27 T:4676 M:1705832448   DEBUG: CVideoDatabase::RunQuery took 8 ms for 424 items query: select * from episodeview
16:22:29 T:4676 M:1706098688 WARNING: JSONRPC: Value does not match any of the enum values in type
16:22:29 T:4676 M:1706098688 WARNING: JSONRPC: Array element at index 0 does not match in type fields
16:22:29 T:4676 M:1706082304   DEBUG: CMusicDatabase::GetSongsByWhere query = select * from songview
16:22:29 T:4676 M:1697878016   DEBUG: CMusicDatabase::GetSongsByWhere() - took 206 ms
16:22:30 T:4676 M:1691709440    INFO: Scriptresult: Success
16:22:30 T:4676 M:1691709440    INFO: Python script stopped
16:22:30 T:4676 M:1691709440   DEBUG: Thread Python Thread 4676 terminating
16:22:30 T:5032 M:1691414528   DEBUG: waiting for python thread 24 to stop
16:22:30 T:5032 M:1691398144   DEBUG: python thread 24 destructed
16:22:30 T:5032 M:1691385856   DEBUG: CWinEventsWin32::WndProcWindow is active
Reply
#92
Big_Noid Wrote:I cannot get the randomalbums to display. Is this a fault of the script or has anybody got it working.

how come i'm always convinced i've tested everything throughly before releasing it
and than after a day or two it turns out certain parts just don't work at all? ;-)

script.randomitems-3.0.2.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
#93
ronie Wrote:how come i'm always convinced i've tested everything throughly before releasing it
and than after a day or two it turns out certain parts just don't work at all? ;-)

script.randomitems-3.0.2.zip

I know what you mean, that sort of thing always happens to me too.
That fixed it. Thx.
I can't play a album list however:
Code:
DEBUG: CApplication::ExecuteXBMCAction : Translating PlayList.Clear
19:06:51 T:316 M:2216390656   DEBUG: CApplication::ExecuteXBMCAction : To PlayList.Clear
19:06:51 T:316 M:2216390656   DEBUG: CApplication::ExecuteXBMCAction : Translating PlayMedia("$INFO[Window.Property(RandomAlbum.4.Path)]")
19:06:51 T:316 M:2216390656   DEBUG: CApplication::ExecuteXBMCAction : To PlayMedia("XBMC.RunScript(script.randomitems,albumid=70)")
19:06:51 T:316 M:2216308736   DEBUG: CPlayerCoreFactory::GetPlayers(XBMC.RunScript(script.randomitems,albumid=70))
19:06:51 T:316 M:2216308736   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
19:06:51 T:316 M:2216308736   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
19:06:51 T:316 M:2216308736   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtv
19:06:51 T:316 M:2216308736   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: hdhomerun/myth/rtmp/mms/udp
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdfile
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
19:06:51 T:316 M:2216304640   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
19:06:51 T:316 M:2216304640   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
19:06:51 T:316 M:2216304640   DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (1)
19:06:51 T:316 M:2216304640   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
19:06:51 T:316 M:2216304640   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
19:06:51 T:316 M:2216304640   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
19:06:51 T:316 M:2216304640   DEBUG: CPlayerCoreFactory::GetPlayers: added 1 players
19:06:51 T:316 M:2215780352  NOTICE: DVDPlayer: Opening: XBMC.RunScript(script.randomitems,albumid=70)
19:06:51 T:316 M:2215780352 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
19:06:51 T:3224 M:2215780352   DEBUG: Thread CDVDPlayer start, auto delete: 0
19:06:51 T:3224 M:2215780352  NOTICE: Creating InputStream
19:06:51 T:3224 M:2215780352   ERROR: CDVDPlayer::OpenInputStream - error opening [XBMC.RunScript(script.randomitems,albumid=70)]
19:06:51 T:3224 M:2215780352  NOTICE: CDVDPlayer::OnExit()
19:06:51 T:3224 M:2215780352  NOTICE: CDVDPlayer::OnExit() deleting input stream
19:06:51 T:3224 M:2215780352   DEBUG: Thread CDVDPlayer 3224 terminating

I use this to play the album:
Code:
<onclick>PlayList.Clear</onclick>
              <onclick>PlayMedia(&quot;$INFO[Window.Property(RandomAlbum.%d.Path)]&quot;)</onclick>
Reply
#94
Big_Noid Wrote:I can't play a album list however:

nothing's changed in this regard, so you still need to use:

Code:
<onclick>$INFO[Window.Property(RandomAlbum.%d.Path)]</onclick>
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
#95
Okay, I was using the new recentlyadded way of playing albums. It's working now, thx ronie.
Reply
#96
I've been trying to hack this script to do what I want but I can't seem to get it to work. I find the idea of a random t.v episode utterly pointless, it rarely gives anything of use. I'm quite aware this script picks a random unwatched T.V episode but what I want is the next unwatched episode from a random t.v series.

Problem is I can't seem to get this to work as I want. I've always been quite a reasonable programmer but I've never used python and always had a bit of a weakness with sql ... basically the things I need for this Confused

Anyone able to help? This is just for my own personal use with the Xeebo skin.
Reply
#97
@ ronie are you pushing this soon?
Reply
#98
Hitcher Wrote:@ ronie are you pushing this soon?

i'm still in doubt...

i recently noticed there's quite a delay when fetching fanart for episodes with json.
as a result it will take ~6 secs for the randomitems script to come up with all the results.

might not be a big issue as you'll only notice it at startup, when the script runs for the first time,
but i keep my fingers crossed it may be possible to speed things up a bit.

http://trac.xbmc.org/ticket/11624
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
#99
I used this to run script

Code:
<onfocus>XBMC.RunScript(script.randomitems,limit=9&amp;albums=True&amp;unplayed=true)</onfocus>

and I got this returned to log

Code:
13:56:44 T:2960498688 M:6401277952  NOTICE: -->Python Interpreter Initialized<--
13:56:44 T:2960498688 M:6401277952   DEBUG: Process - The source file to load is /Users/pecinko/Library/Application Support/XBMC/addons/script.randomitems/RandomItems.py
13:56:44 T:2960498688 M:6401277952   DEBUG: Process - Setting the Python path to /Users/pecinko/Library/Application Support/XBMC/addons/script.randomitems:/Users/pecinko/Library/Application Support/XBMC/addons/script.module.simplejson/lib:/Users/pecinko/Library/Application Support/XBMC/addons/script.module.beautifulsoup/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pil/lib:/Users/pecinko/Library/Application Support/XBMC/addons/script.web.viewer/lib:/Users/pecinko/Library/Application Support/XBMC/addons/script.module.elementtree/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pysqlite/lib:/Applications/XBMC.app/Contents/Frameworks:/Applications/XBMC.app/Contents/Frameworks/lib/python26.zip:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-darwin:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac/lib-scriptpackages:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-old:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/site-packages:
13:56:44 T:2960498688 M:6401277952   DEBUG: Process - Entering source directory /Users/pecinko/Library/Application Support/XBMC/addons/script.randomitems
13:56:44 T:2960498688 M:6401277952   DEBUG: Instantiating addon using automatically obtained id of "script.randomitems" dependent on version 2.0 of the xbmc.python api
13:56:44 T:2961563648 M:6396981248   DEBUG: CRecentlyAddedJob::UpdateTotal() - Running RecentlyAdded home screen update
13:56:44 T:2685568320 M:6396968960   DEBUG: HttpApi Start command: SetResponseFormat  paras: SetResponseFormat
13:56:44 T:2685568320 M:6395396096   DEBUG: HttpApi Start command: SetResponseFormat  paras: SetResponseFormat; OpenRecord;<record>
13:56:44 T:2685568320 M:6393823232   DEBUG: HttpApi Start command: SetResponseFormat  paras: SetResponseFormat; CloseRecord;</record>
13:56:44 T:2685568320 M:6390677504   DEBUG: HttpApi Start command: QueryVideoDatabase  paras: QueryVideoDatabase; select * from movieview order by RANDOM() limit 9
13:56:44 T:2957832192 M:6386802688   DEBUG: Got rss feed: http://feeds.feedburner.com/xbmc
13:56:44 T:2957832192 M:6386802688   DEBUG: RSS feed encoding: UTF-8
13:56:44 T:2957832192 M:6386802688   DEBUG: Parsed rss feed: http://feeds.feedburner.com/xbmc
13:56:44 T:2957832192 M:6389571584   DEBUG: Thread CRssReader 2957832192 terminating
13:56:45 T:2685568320 M:6388547584   DEBUG: HttpApi Start command: QueryVideoDatabase  paras: QueryVideoDatabase; select * from episodeview order by RANDOM() limit 9
13:56:45 T:2962096128 M:6387576832   DEBUG: Thread CJobWorker start, auto delete: 1
13:56:45 T:2685568320 M:6387523584   DEBUG: Previous line repeats 2 times.
13:56:45 T:2685568320 M:6387523584   DEBUG: HttpApi Start command: QueryMusicDatabase  paras: QueryMusicDatabase; select * from albumview order by RANDOM() limit 9
13:56:45 T:2961563648 M:6382239744   DEBUG: DoWork - took 166 ms to load special://profile/Thumbnails/Video/3/3b38db6e.tbn
13:56:45 T:2962628608 M:6384984064   DEBUG: DoWork - took 158 ms to load special://profile/Thumbnails/Video/f/fa91f9dc.tbn
13:56:45 T:2963161088 M:6382649344   DEBUG: DoWork - took 185 ms to load special://profile/Thumbnails/Video/9/90220bc8.tbn
13:56:45 T:2962096128 M:6375546880   DEBUG: DoWork - took 102 ms to load special://profile/Thumbnails/Video/8/8b162bcb.tbn
13:56:46 T:2962628608 M:6374252544   DEBUG: DoWork - took 184 ms to load special://profile/Thumbnails/Video/f/f7348d19.tbn
13:56:46 T:2963161088 M:6373015552   DEBUG: DoWork - took 268 ms to load special://profile/Thumbnails/Video/4/4b779bf5.tbn
13:56:46 T:2960498688 M:6371368960    INFO: -->Python script returned the following error<--
13:56:46 T:2960498688 M:6371315712   ERROR: Error Type: <type 'exceptions.Exception'>
13:56:46 T:2960498688 M:6371282944   ERROR: Error Contents: Could not get AddonPtr given a script id of script.cinema.experience. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
13:56:46 T:2960498688 M:6370902016   ERROR: Traceback (most recent call last):
                                              File "/Users/pecinko/Library/Application Support/XBMC/addons/script.randomitems/RandomItems.py", line 311, in <module>
                                                Main()
                                              File "/Users/pecinko/Library/Application Support/XBMC/addons/script.randomitems/RandomItems.py", line 105, in __init__
                                                self._fetch_addon_info()
                                              File "/Users/pecinko/Library/Application Support/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 script.cinema.experience. If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 2.0 plugin.
13:56:46 T:2960498688 M:6370902016    INFO: -->End of Python script error report<--
13:56:46 T:2960498688 M:6370811904    INFO: Python script stopped

a few stupid questions, if I may:

- it seams that it's trying to fetch random addons, although I did not set addons=True ?
- there seams that older, both dharma and pre-eden compatible version 1.0.12 is no more?
My skins:

Amber
Quartz

Reply
Ronie, just to inform:

script randomitems 3.0.2 + Aeon MQ 3 (alpha 1) + XBMC Eden (build 17th july) + Windows 7 32bits and 64bits = works perfectly.
------------------------------------------------------

Want to know more about the skin? Liked my work and want contribute?
Visit my website
XBMC Brazilian Community Forum
By making a donation, please do not post in the forum, send me an email or PM, thank you.
Reply
MarcosQui Wrote:script randomitems 3.0.2 + Aeon MQ 3 (alpha 1) + XBMC Eden (build 17th july) + Windows 7 32bits and 64bits = works perfectly.

It seams to work for me too. However, I see only version 2.0 in

Code:
http://mirrors.xbmc.org/addons/eden-pre/

so users will get errors if they don't manually install new version?
My skins:

Amber
Quartz

Reply
Version 3.0.2:

http://forum.xbmc.org/showpost.php?p=832...stcount=92
------------------------------------------------------

Want to know more about the skin? Liked my work and want contribute?
Visit my website
XBMC Brazilian Community Forum
By making a donation, please do not post in the forum, send me an email or PM, thank you.
Reply
pecinko Wrote:and I got this returned to log

that issue was fixed in v3.0.2

pecinko Wrote:- it seams that it's trying to fetch random addons, although I did not set addons=True ?
correct, the script doesn't have any options to enable/disable certain catagories.
pecinko Wrote:- there seams that older, both dharma and pre-eden compatible version 1.0.12 is no more?

nope, v1.0.11 is for dharma, v2.0.0 for eden.
v3.0.2 is the latest test version that will replace v2.0.0 one day.
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
@ OK, thanks for info. Let me try to sum it up:

- Older version 1 is not compatible with nighties
- Version 2 works, but gives an error because of addons (and you can not turn those off)
- Version 3 works nicely but is not available from a repo
- Users experiencing errors should manually DL version 3.02, which will eventually be in the repo but not just yet

Or did I miss something?
My skins:

Amber
Quartz

Reply
pecinko Wrote:Or did I miss something?

nope.

the bug sucks indeed, so i'll submit v3.0.2 to the repo today/tomorrow.
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
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 23

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