a couple of questions from an addon developer newbie
#1
hello,

i've written my first music-addon and it was nice to see how fast plugin development is possible (i've coded some stuff for mythtv before).
The user can search(with paging), play(stream), delete(admin only) and vote mp3s from a private site thru a HTTP-Restful API.

Currently the user must vote from a context-menu dialog (dialog.select(...)) and i post this value to my site.
Can i intercept (callback?) the internal rating function the from playback screen and transfer the new user rating value to my remote-site?
Initially i transfer the user-votings from my site into the infolabel "rating" of each listed song.

The same applies to the advanced library searching (left-sidebar).
Currently it filters/sort only the current folder view, which displays page-based data and contains only 10/20/30/.. entries.
That's not really helpful.
Any suggestions?

regards
nias
Reply
#2
ok, to answer my self

for the rating i've found a practicable workaround:

my play methodSadpseudo code only)
Code:
def play():
#vote last played file
      filename=xbmc.getInfoLabel('Player.Filenameandpath')
      rating=xbmc.getInfoLabel('MusicPlayer.Rating')
      lastPlayedURL = __addon__.getSetting("lastplayedURL").split(", ")
      lastPlayedVote = __addon__.getSetting("lastplayedVote")
      if filename == lastPlayedURL and rating != lastPlayedVote:
        mysite.voteSet(filename, rating)
#play new file
      xbmcplugin.setResolvedUrl(handle=plugin_handle, succeeded=True, listitem=xbmcgui.ListItem(path=urls[0]))
#save new played file to settings
      __addon__.setSetting("lastplayedURL", ", ".join(urls))
      __addon__.setSetting("lastplayedVote", str(params.oldRating))


this works adequate.
Is there a way to get access to the ListItem entry of the currently played file (Player.Filenameandpath) to change the voting for the directory listing too?
Because if you switch back to the current dir-listing (TAB-key) you still get the old-rating displayed.
Reply

Logout Mark Read Team Forum Stats Members Help
a couple of questions from an addon developer newbie0