[WINDOWS] getReleaseDate()
#1
Question 
XBMC 9.04.1 r20672 (Compiled : June 2 2009)
Win XP Pro SP3

I'm new to XBMC and Python (but I'm not a noobie programmer).

I'm writing a script to create smart playlists using the tags of the currently playing audio track. According to the docs, getReleaseDate() returns a string, but despite there being 'Year' tags in my audio files (which display correctly in the Now Playing window) it always returns a zero-length string. The other tags are returned as expected.

I couldn't find anything via a search of the forum. Is there something I'm missing (like a brain!) or is there a problem with getReleaseDate()? Any help would be appreciated.

Code:
[font=Courier New]if xbmc.getCondVisibility('Player.HasAudio'):
    tag = xbmc.Player().getMusicInfoTag()

    artist = tag.getArtist()
    title  = tag.getTitle()
    genre  = tag.getGenre()
    album  = tag.getAlbum()
    yr     = tag.getReleaseDate()[/font]
Reply
#2
Code looks fine in current SVN. Have you tried Camelot?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not 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.


Image
Reply
#3
Thanks jmarshall. I push the pram a lot (or at least I used to in my younger days) but I don't know much about Camelot and its relevance to XBMC in general or my tag problem in particular. I'm always keen to learn though, so any pointers would be welcome.

In the meantime, this is the complete script - it's just an altered version of one of the sample scripts. It all works, including displaying "Year:", except nothing shows up to the right of it where the retrieved tag info should be. It makes no difference whether I play a FLAC or mp3 (id3v1 or id3v2 tags).

Am I right in thinking this script should work?

Thanks


Code:
import xbmc, xbmcgui

#get actioncodes from keymap.xml
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7

class MainClass(xbmcgui.Window):
    def __init__(self):
        self.strActionInfo = xbmcgui.ControlLabel(180, 60, 500, 200, '', 'font14', '0xFFBBBBFF')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Push BACK to quit - A to open another window')
        self.strActionInfo = xbmcgui.ControlLabel(240, 250, 600, 200, '', 'font13', '0xFFFFFFFF')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Artist: ' + artist)
        self.strActionInfo = xbmcgui.ControlLabel(240, 300, 600, 200, '', 'font13', '0xFFFFFFFF')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Title: ' + title)
        self.strActionInfo = xbmcgui.ControlLabel(240, 350, 600, 200, '', 'font13', '0xFFFFFFFF')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Album: ' + album)
        self.strActionInfo = xbmcgui.ControlLabel(240, 400, 600, 200, '', 'font13', '0xFFFFFFFF')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Year: ' + yr)
        self.strActionInfo = xbmcgui.ControlLabel(240, 450, 600, 200, '', 'font13', '0xFFFFFFFF')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Genre: ' + genre)

    def onAction(self, action):
        if action == ACTION_PREVIOUS_MENU:
            self.close()
        if action == ACTION_SELECT_ITEM:
            popup = ChildClass()
            popup .doModal()
            del popup

class ChildClass(xbmcgui.Window):
    def __init__(self):
        self.addControl(xbmcgui.ControlImage(0,0,800,600, 'background.png'))
        self.strActionInfo = xbmcgui.ControlLabel(200, 60, 400, 200, '', 'font14', '0xFFBBFFBB')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('Push BACK to return to the first window')
        self.strActionInfo = xbmcgui.ControlLabel(240, 200, 400, 200, '', 'font13', '0xFFFFFF99')
        self.addControl(self.strActionInfo)
        self.strActionInfo.setLabel('This is the child window')

    def onAction(self, action):
        if action == ACTION_PREVIOUS_MENU:
            self.close()

if xbmc.getCondVisibility('Player.HasAudio'):
    tag = xbmc.Player().getMusicInfoTag()

    artist = tag.getArtist()
    title = tag.getTitle()
    genre = tag.getGenre()
    album = tag.getAlbum()
    yr = tag.getReleaseDate()

    mydisplay = MainClass()
    mydisplay .doModal()
    del mydisplay
Reply
#4
I'm sure google could have given you the info just as quick as you got the other info there if you'd appended "xbmc" to "camelot" in your search.

Will test your script.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not 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.


Image
Reply
#5
And the script works just fine. I suggest updating your build.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not 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.


Image
Reply
#6
Jonathan. Cherry on me! Have installed Camelot and the script now works. Thank you for your help, and your patience with my slow-wittedness Huh

Jess
Reply

Logout Mark Read Team Forum Stats Members Help
[WINDOWS] getReleaseDate()0