[RELEASE] RecentlyAdded Script (RecentlyAdded.py) Recently Added for Skins / Skinners

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mindweaver Offline
Posting Freak
Posts: 998
Joined: Jan 2004
Reputation: 1
Location: Sweden
Post: #61
ronie Wrote:yep, try the one from the T! svn:
http://code.google.com/p/transparency-xb...loads/list

that one is working fine on my end (requires xbmc r30369 or up).

I have tied that one on rev 30515 with the latest SVN of Transparency! Same error :/
find quote
mindweaver Offline
Posting Freak
Posts: 998
Joined: Jan 2004
Reputation: 1
Location: Sweden
Post: #62
I installed SVN 30538 and now it works! Big Grin
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,879
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #63
A couple of questions -

1) Can the VideoResolution (ie 480, 576, 540, 720, 1080) be added as I'd like to use that please.

2) Also the 'date added' would be helpful.


EDIT: Forget about the above I've been looking at the database and you can't get this info anyway.

3) Can this way of playing full albums be added to the official version -
CF2009 Wrote:one more thing i have just added to my script is the ability to play full albums from the Recently Added script (extras.py).

i'm not using unplayed or songs like yours but you can see how it works...

PHP Code:
# Current Working Directory
CWD os.getcwd() 
PHP Code:
def _fetch_music_infoself ):
        
# sql statement
        
if ( self.RANDOM_ORDER ):
            
sql_music "select * from albumview order by RANDOM() limit %d" % ( self.LIMIT, )
        else:
            
sql_music "select * from albumview order by idAlbum desc limit %d" % ( self.LIMIT, )
        
# query the database for recently added albums
        
music_xml xbmc.executehttpapi"QueryMusicDatabase(%s)" quote_plussql_music ), )
        
# separate the records
        
items re.findall"<record>(.+?)</record>"music_xmlre.DOTALL )
        
# enumerate thru our records and set our properties
        
for countitem in enumerateitems ):
            
# separate individual fields
            
fields re.findall"<field>(.*?)</field>"itemre.DOTALL )
            
# set properties
            
self.WINDOW.setProperty"LatestSong.%d.Genre" % ( count 1, ), fields] )
            
self.WINDOW.setProperty"LatestSong.%d.Year" % ( count 1, ), fields] )
            
self.WINDOW.setProperty"LatestSong.%d.Artist" % ( count 1, ), fields] )
            
self.WINDOW.setProperty"LatestSong.%d.Album" % ( count 1, ), fields] )
            
self.WINDOW.setProperty"LatestSong.%d.Plot" % ( count 1, ), fields14 ] )
            
# Album Path  (ID)
            
path 'XBMC.RunScript(' CWD 'extras.py,albumid=' fields] + ')'
            
self.WINDOW.setProperty"LatestSong.%d.Path" % ( count 1, ), path )
            
# get cache name of path to use for fanart
            
cache_name xbmc.getCacheThumbNamefields] )
            
self.WINDOW.setProperty"LatestSong.%d.Fanart" % ( count 1, ), "special://profile/Thumbnails/Music/%s/%s" % ( "Fanart"cache_name, ) )
            
self.WINDOW.setProperty"LatestSong.%d.Thumb" % ( count 1, ), fields] )

    
def _Play_AlbumselfID ):
        
playlist=xbmc.PlayList(0)
        
playlist.clear()
        
# sql statements
        
sql_song "select * from songview where idAlbum='%s' order by iTrack " % ( ID )
        
# query the databases
        
songs_xml xbmc.executehttpapi"QueryMusicDatabase(%s)" quote_plussql_song ), )
        
# separate the records
        
songs re.findall"<record>(.+?)</record>"songs_xmlre.DOTALL )
        
# enumerate thru our records and set our properties
        
for countmovie in enumeratesongs ):
            
# separate individual fields
            
fields re.findall"<field>(.*?)</field>"moviere.DOTALL )
            
# set album name
            
path fields22 ] + fields]
            
listitem ListItemfields] )
            
xbmc.PlayList(0).add (pathlistitem )
        
xbmc.Player().play(playlist)
        
xbmc.executebuiltin('XBMC.ActivateWindow(10500)'

Thanks.
(This post was last modified: 2010-07-18 00:11 by Hitcher.)
find quote
coppermine Offline
Junior Member
Posts: 4
Joined: Jul 2010
Reputation: 0
Post: #64
I'm getting an error message that the recentlyadded script had failed to run.
This happens every time I reboot. My install is a custom Ubuntu 10.04 64 bit with sources from the SVN PPA (Version XBMC-Pre 10.5 R31718) The problem can be seen in my xbmx.log around line number 359.

http://pastebin.com/grWxHn7C

Thank you in advance.
find quote
kaistian Offline
Member
Posts: 61
Joined: May 2005
Reputation: 0
Location: Norway
Post: #65
This is a problem with the 64-bits svn PPA. It looks like that fore some reason some libraries are 32-bits.
I guess the PPA maintaner(s) have to look into it because the problem isn't their if you compile it yourself.
find quote
.:B:. Offline
Fan
Posts: 424
Joined: Mar 2010
Reputation: 0
Post: #66
Are you using it already as an add-on script? If not, you should drop the script in the add-ons dir. Make sure you have a recent version, too.

If you're using Confluence, you need to point the skin to the location of the script too (although that might have been fixed in more recent versions).

* Netgear WNDR3700, OpenWrt Barrier Breaker 14.07+ git :: HP Procurve V1410-8G switch
* OpenELEC 4: HTPC Zotac Nano AD10 with Pulse-Eight CEC adapter, Sony KDL52-NX800 :: Desktop Phenom II X4 980 BE / AMD HD6950 / 23" Dell Full HD
* Debian Jessie x86_64: Celeron G1610, HTTP/NFS/MySQL/ZFS server
* Blog
find quote
pixdamix Offline
Senior Member
Posts: 211
Joined: Apr 2010
Reputation: 3
Location: France
Post: #67
I have a patch for script.recentlyadded, basically it adds plot informations for movies and tv shows (Like the old version which was bundled with aeon65)

http://trac.xbmc.org/ticket/9583
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,879
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #68
Right I've managed to work out how to get Song Rating working but I really need some help getting CF2009's 'play album' fix working.

This is as far as I can get with the script -

http://pastebin.com/s53NDb3U

and this is the error message I'm getting -

Code:
-->Python Interpreter Initialized<--
NOTICE: DVDPlayer: Opening: XBMC.RunScript(script.recentlyadded,albumid=3108)
WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
NOTICE: Creating InputStream
ERROR: CDVDPlayer::OpenInputStream - error opening [XBMC.RunScript(script.recentlyadded,albumid=3108)]

The trouble is I don't have a clue about Python and I don't know what XBMC is expecting to get.

Thanks.
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,879
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #69
Got a bit further in that I've also added CF2009's 'Random/Recent' option for Movies and TV Shows.

http://pastebin.com/Nd8pujFT

Can't work out how to code it for music though.
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,879
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #70
I originally posted this in the RecentlyAdded.py thread in the Skin Development forum but figured it's not really skinning help so I'm posting it here in the hope someone can help me figure it out.

...


Right I've managed to work out how to get Song Rating working but I really need some help getting CF2009's 'play album' fix working.

This is as far as I can get with the script -

http://pastebin.com/s53NDb3U

and this is the error message I'm getting -

Code:
-->Python Interpreter Initialized<--
NOTICE: DVDPlayer: Opening: XBMC.RunScript(script.recentlyadded,albumid=3108)
WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
NOTICE: Creating InputStream
ERROR: CDVDPlayer::OpenInputStream - error opening [XBMC.RunScript(script.recentlyadded,albumid=3108)]

The trouble is I don't have a clue about Python and I don't know what XBMC is expecting to get.

Thanks.

...

Got a bit further in that I've also added CF2009's 'Random/Recent' option for Movies and TV Shows.

http://pastebin.com/Nd8pujFT

Can't work out how to code it for music though.
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #71
Although Hither I have no idea how to help you, You guys do realize that the more you keep adding to it the slower its going to get at retrieving the information. Its like the whole reason that filemode doesn't just go and get the info if its available because it slows the listings right down having to fetch it. And the python way is worse still
find quote
pixdamix Offline
Senior Member
Posts: 211
Joined: Apr 2010
Reputation: 3
Location: France
Post: #72
My patch shouldn't cause slowdown as the information it adds is already fetched (via a select *)
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #73
Hitcher Wrote:Got a bit further in that I've also added CF2009's 'Random/Recent' option for Movies and TV Shows.

http://pastebin.com/Nd8pujFT

Can't work out how to code it for music though.

How do you call the Random movie or episode?
find quote
jackthegroove Offline
Junior Member
Posts: 49
Joined: Jul 2010
Reputation: 0
Post: #74
I get the following error:
Code:
ERROR: Error Type: exceptions.IndexError
  ERROR: Error Contents: list index out of range
  ERROR: Traceback (most recent call last):
                                              File "/home/xbmc/.xbmc/addons/skin.shade/scripts/RecentlyAdded.py", line 267, in ?
                                                Main()
                                              File "/home/xbmc/.xbmc/addons/skin.shade/scripts/RecentlyAdded.py", line 71, in __init__
                                                self._fetch_totals()
                                              File "/home/xbmc/.xbmc/addons/skin.shade/scripts/RecentlyAdded.py", line 133, in _fetch_totals
                                                self.WINDOW.setProperty( "TVShows.Watched" , tvshows_totals[ 2 ] or "" )
                                            IndexError: list index out of range
This only happens when i set this:
Code:
<onfocus>XBMC.RunScript(special://skin/scripts/RecentlyAdded.py,limit=8&amp;albums=True&amp;unplayed=True&amp;totals=True)</onfocus>
Instead of this:
Code:
<onfocus>XBMC.RunScript(special://skin/scripts/RecentlyAdded.py,limit=8&amp;albums=True)</onfocus>

It seems like "totals" and "unplayed" isn't working for me.

I'm using the XBMC PRE-10.5 R31542 release with an external database.
find quote
mcborzu Offline
Skilled Skinner
Posts: 3,381
Joined: Feb 2009
Reputation: 15
Location: dsf
Post: #75
10.5 should be using:

<onfocus>XBMC.RunScript(script.recentlyadded,limit=5&amp;albums=True)</onfocus>

Try using that and see if it helps...

[Image: widget]

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
find quote
Post Reply