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

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ronie Offline
Team-XBMC Member
Posts: 8,258
Joined: Jan 2009
Reputation: 108
Post: #11
Nuka1195 Wrote:no the script doesn't decide. the script starts an AlarmClock()

you still need to run the script "once". if you pass alarm=30, then the script will run every 30 minutes. so then there is no need to run it everytime you enter the home menu. (which i don't like). you enter movies back out and the script runs again.

as i said in the first post you can set always="false" for you're control so it only runs once. right?

yup, i got that one.

Nuka1195 Wrote:was the example not clear?

it's the 'plus if your in home it will update automatically' bit that got me confused.
i was unsure if the alarmclock kept running once you navigate away from home.

thanx for the explanation Nuka1195, and for all the neat scripts you've been releasing lately.

cheers.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #12
upon re-reading. the first post wasn't very clear.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
emal011 Online
Senior Member
Posts: 195
Joined: Nov 2008
Reputation: 0
Location: Munich
Post: #13
I already made the update, and not works!

Pytho Script Failed:
skin/extras/recentlyadded.py


I just made the update von SVN and Aeon Hitcher...
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,933
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #14
Just to clarify things a bit, some people are getting an error using my mod and the latest added script. Everything works great for me (Windows) so I'm wondering if it's a Linux problem.

All I've done is add the Hide Unwatched and Totals conditions -
Code:
<onfocus>XBMC.RunScript(special://skin/extras/RecentlyAdded.py,limit=6&amp;albums=True&amp;unplayed=True&amp;totals=True)</onfocus>

shassino Wrote:I have the same problem RecentlyAdded.py script failed.
Running on ubuntu 9.04.
I got Aeon Hitched at 1.30pm via git.
I should have latest RecentlyAdded.py.

Code:
#15:06:19 T:2842688400 M:1402363904  NOTICE:   File "/home/xbmc/.xbmc/skin/Aeon_Hitched/extras/RecentlyAdded.py", line 130, in _fetch_totals
#15:06:19 T:2842688400 M:1402363904  NOTICE: self.WINDOW.setProperty( "TVShows.Watched" , tvshows_totals[ 2 ] )
#15:06:19 T:2842688400 M:1402363904  NOTICE: IndexError
#15:06:19 T:2842688400 M:1402363904  NOTICE: :
#15:06:19 T:2842688400 M:1402363904  NOTICE: list index out of range
#15:06:19 T:2842688400 M:1402363904   ERROR: Scriptresult: Error

Full debug log:
http://pastebin.com/f706d8019

[Image: sig_zps3af3b48e.jpg]
find quote
Avigrace Offline
Senior Member
Posts: 132
Joined: Mar 2009
Reputation: 0
Post: #15
With the Hitcher mod xbmc will become unresponsive and I have to forcably kill the process with the following in the log

20:39:28 T:1308 M:1122537472 ERROR: CThread::staticThread : Access violation at 0x1e0ac802: Writing location 0x00000000

Happens within 10 seconds of running up the skin and in that time it looks like the RecentlyAdded part works as I can see added movies and the totals.

However if I rename the 'extras' folder to something else then I don't get the crash, the only file inside the folder is the RecentlyAdded.py file.

XBMC is todays SVN and Hitchers mod is fresh from git today, OS is Windows 7 RC
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #16
avigrace, that's a bug in xbmc.

for the tv shows error. it is now fixed in svn.

you can show the last played video for movies. if skinners want to use this, i can add it to tv shows also.

[Image: lastplayed.jpg]

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,933
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #17
Thanks for the TV Shows fix.

[Image: sig_zps3af3b48e.jpg]
find quote
CF2009 Offline
Alaska Group
Posts: 289
Joined: Mar 2009
Location: UK
Post: #18
hey Nuke
I have added 1 more option to the script i am useing for my aeon mod "random", i use it as i do not add movies/episodes all the time so i get to see a list random unplayed movies/episodes which is nicer then seeing the same movies/episodes all the time. i was just thinking you may like to add it to your script to as a optionSmile

PHP Code:
sql_movies "select * from movieview %sorder by RANDOM() limit %d" % ( unplayedself.LIMIT, ) 
PHP Code:
sql_episodes "select * from episodeview %sorder by RANDOM() limit %d" % ( unplayedself.LIMIT, ) 

[Image: problem_solved.png]
find quote
CF2009 Offline
Alaska Group
Posts: 289
Joined: Mar 2009
Location: UK
Post: #19
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)'

[Image: problem_solved.png]
(This post was last modified: 2009-08-14 15:16 by CF2009.)
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #20
@nuka1195,

i have managed to get the fanart working for recent episodes. but it relies on the fanart being cached. i remember the the thumbs used to be the same (sometimes thumb not showing up, when no cached thumb exists) is there a anything you can you do with your script so it does the same for fanart.


Andy.
find quote
Post Reply