QtScript service issues

Be be.0 at gmx.com
Fri Dec 19 22:06:44 UTC 2014


I have found what triggers the first bug and figured out a work around.
Level 2 items must have playableUrl set to an empty string. That does
not make sense to me and I think indicates a bug in the scripting API.

Regarding the last issue, it would be helpful if scripts could disable
Amarok's sorting and specify their own sorting mechanisms. With this
script, SoundCloud returns the most relevant search results first and
thus the script inserts the items this way. Having the search results
sorted alphabetically by Amarok is inconvenient.

I've noticed that sometimes SoundCloud returns different results for the
exact same query. I don't know what's going on at their end.

I added a number of features since the previous email. The script now
shows users' favorites, who they follow, who follows them, and what
groups they belong to. Groups can now be searched by putting 'group ' at
the beginning of the search term. I think searching for groups with
'group: ' at the beginning would be more intuitive, but strangely, any
word with a colon in it is not passed to the script. Searching for a
group shows its tracks, members, moderators, and contributors.

I kinda figured out a hack to make the tree interactive and navigate
between users and groups. By making the playableUrl of listed users and
groups the terms that could be used to search for them, they can be
dragged into the search bar. This hack allows invalid "tracks" to be
dragged into Amarok's playlist though. More importantly, when doing
this, the tree will not populate. Clearing the search bar and searching
for the exact same query works though. This happens whether dragging &
dropping an item from the tree or quickly typing a different search term
in the box.

On 12/19/2014 12:06 AM, Be wrote:
> I have been working on the QtScript service for SoundCloud. It now
> searches for artists so the exact SoundCloud name does not have to be
> typed in. I am stuck on some confusing bugs. I can't find anything in
> the script (attached) that could explain any of these and I have been
> looking all day. I think these are bugs in Amarok. This is with 2.8.0
> stable. Since upgrading to Fedora 21, I get the attached error when
> trying to compile from git.
>
> Most importantly, after expanding an artist and a playlist to show
> tracks, trying to expand a different artist does nothing (expanding
> playlists of other artists that have already had their playlists loaded
> works though). After changing the search bar, the tree will be cleared
> and never repopulate (until restarting Amarok). When searching for
> another artist, Amarok tries to populate level 2 (artist list level),
> and the script downloads the data, but Amarok does not load any items.
> Debugging output shows:
> amarok: BEGIN: int ScriptableServiceScript::donePopulating() const
> amarok:   BEGIN: void ScriptableServiceManager::donePopulating(const
> QString&, int)
> amarok:     Service name:  "SoundCloud Integration" , parent id:  -1
> amarok:     BEGIN: void
> Collections::ScriptableServiceCollection::donePopulating(int)
> amarok:       BEGIN: void
> Collections::ScriptableServiceQueryMaker::slotScriptComplete()
> amarok:         [ScriptableServiceQueryMaker] there are  0  artists
> amarok:       END__: void
> Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s]
> amarok:     END__: void
> Collections::ScriptableServiceCollection::donePopulating(int) [Took: 0s]
> amarok:   END__: void ScriptableServiceManager::donePopulating(const
> QString&, int) [Took: 0s]
> amarok: END__: int ScriptableServiceScript::donePopulating() const
> [Took: 0s]
>
> Tracks are only shown in the tree if their callbackData is set to an
> empty string or null.
>
> Trying to drag & drop an artist from the tree pops up an error:
> TypeError: Result of expression 'tracklist[i].user' [undefined] is not
> an object
> This does not happen when dragging a playlist. Trying to drop the artist
> onto the playlist freezes Amarok. If all of the playlists for that
> artist have been expanded, this error does not pop up, but only the
> first playlist shown in the tree is dragged. So, it seems this is
> happening because Amarok does not tell the script to populate all the
> levels below an item that is being dragged.
>
> The string '%20' is automatically appended to the filter string after
> anything is typed into the search bar.
> When typing slowly in the search bar, only the first few characters are
> passed to the script, without '%20' at the end.
>
> The year of playlists is not shown immediately, although the script sets
> it when creating the playlist items. When expanding a playlist, the year
> is loaded for that playlist only and Amarok sorts the tree, causing the
> playlist to jump to a different position.
>
>
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: soundcloud_service-3.tar.xz
Type: application/x-xz
Size: 15216 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20141219/b903a9a6/attachment.bin>


More information about the Amarok-devel mailing list