Registered Member
|
Greetings!
I was trying to modify an existing script (the vk_search script, to be exact) to show not only people and their tracks, but their albums as well. Thus, I used a 3-layer tree to display everything. While the hierarchy appears to be correct now, I'm having difficulties in understanding how to set pictures to objects. For instance, I have this code:
And when I push the "photo" variable into an alert window, it presents a valid link to a photo. However, Amarok displays the default picture (as I understood, level 2 is for authors, so it displays the default author picture). On the other hand, this code
behaves somewhat erratically, as it sometimes produces an item with a picture on it. Perhaps, there is a certain best practice of setting images, or am I just doing something wrong? I tried downloading the object inspector, but can't figure out how to use it Thanks in advance! |
Registered Member
|
Why don't you set the cover pic here? |
Registered Member
|
Well, that was the idea: level 2 items are users, so I wanted their avatars to show up through coverUrl; level 1 items are albums (which are essentially no more than groups of music created by the users, so they don't require any picture) and level 0 items are records. I explicitly wanted no pictures on the 1 level items.
|
Registered Member
|
Sorry, AFAICS you can't set an image at level 2 with the current API, the levels are hard coded as Genre[3], Artist[2], Album[1], and only the album displays a cover.
Hopefully I can improve things some time next week, though the changes won't make it to a public release until 2.9 . |
Registered Member
|
Uh-huh, I thought that there was at least some special field for level-2 items, but there isn't. Yeah, it'd be good to have something in alternative to the default pictures:)
If some efforts will be done, might I ask for a patch? And also a question about covers suddenly appearing on level 1 items (when I specifically set the links to empty) - is that some sort of glitch, or how is that possible? |
Registered Member
|
You don't have to ask for a patch, it'll be pushed to my gsocScripting2 branch on quickgit.kde.org.
And as for those covers suddenly appearing, try clearing your albumcovers cache. |
Registered Member
|
I'm a bit of a newbie to linux - got openSUSE 12.3 running right now - how would I be able to obtain the changes?
And as for the albums - that worked like a charm, thanks Still had to reboot, since amarok was segmentation faulting on startup, but it's fine now. |
Registered Member
|
I'm assuming you already have the Amarok source.
Add a new remote:
And then pull gsocScripting2 from <remotename>. There's other new scripting API stuff, so please do try it You might find these useful: Check here for a local build: http://blogs.fsfe.org/myriam/2009/09/co ... l-summary/ A detailed information about git can be found here: http://techbase.kde.org/Getting_Started ... t-tutorial [thanks to Mamarok for these] |
Registered Member
|
And segfaulting is not normal. You should generate a backtrace and file a bug report.
|
Registered Member
|
Thanks for details and links - I'll try to straighten it out. Though I don't have the sources (I just dabbled in the js script of one particular... erm, script), I'll be sure to get them - get familiar with git and all that.
Segfaulting happened a lot during my experiments with the aforementioned script. To get rid of it, I usually renamed the scripts/ directory. So I assumed the scripts to be responsible. Last time I lauched amarok, I did observe a heavy CPU increase on its part after some time, but again - no errors. So I again assume it must be the script I modified (and screwed up the search function). |
Registered users: Bing [Bot], Evergrowing, Google [Bot], Sogou [Bot]