Custom Context Browser Sections Patch

Seb Ruiz me at sebruiz.net
Tue Jun 20 06:30:38 UTC 2006


Hi Bradley,

I've been using your patch for about 10 minutes now, and I have some comments.

Excellent concept, and I love the way that you have now shown me what  
a three column css style would look like in the context browser.

There are some points which I would like to address:

** Hardcoding sql / use of querybuilder **
In the Amarok core, we use a QueryBuilder to create the required query  
for database lookups. This is used to ensure correctness of code (to  
an extent), ease of use, and, more imporantly to create statements  
relevant to the database used.  Most of your code _will not_ work with  
postgresql.  there is no way to avoid this until we provide a Plugin  
Api, hopefully for Amarok 2.0, when the databases will be refactored  
as well to a better OO design.

Speaking of databases, the reason most of your stuff is buggy is  
because you are missing semicolons at the end of the sql statements.  
Also, cover issue is solved if you do md5( album - artist ), not md5(  
albumartst ).

** Functionality **
This is an excellent way to provide extensions to our users, but only  
those who require or feel like playing with it. At the same time, we  
shouldn't provide the need for this functionality unless the user  
requests it. ie - keep the compiled code unless a script is used.

We also lose the javascript functionality, but i suppose this is just  
code which you have not added - again, this would mean every script  
would need to use custom headers and javascript methods. Yuck!

** Load Times **
This is the crux of my problems with your patch.  Having selected only  
the three "standard" scripts (current, fave tracks and other albums),  
it took 6 seconds to render the context browser.  Including the  
last.fm tags, wiki and suggestions, add another 10 seconds.


All the best,
seb



Quoting Bradley Pesicka <teknomunk at bluebottle.com>:

> As stated in #amarok, I have been working on adding custom context
> browser sections to Amarok.
>
> The attached tarball contains the patch file, and several scripts I
> wrote while working on this.
>
> To install, patch the svn source (revision 553177) from the multimedia
> directory
> move amarok.rb to ~/.kde/share/apps/amarok/
> move all other directories to ~/.kde/share/apps/amarok/scripts
>
> This patch makes the following changes:
>
> - Disables the internal context browser sections for the tracks.
> - Adds the following dcop commands to contextbrowser:
>    void addCustomSection(QString name)
>    void removeCustomSection(QString name)
>    void setCustomSection(QString section,QString contents)
>    void setCustomSectionTitle(QString section,QString title)
>    void setCustomSectionContext(QString section,QString context)
> - Renders the sections up to 3 per row, in non-collapsable boxes. The
> bottom of the each of the sections in a row all line up.
> - Adds new categories to the script manager:
>    Context Browser
>    |-Home
>    |-Tracks
>    |-Streams
>    |-Podcasts
>
> Known issues:
> - Covers will not be shown for anything - I never got around to
> modifying how the covers are stored in the cache or triggering the
> creation of smaller versions of the cover  from a script.  The song
> info section also does not have an update link because of this, and
> because I didn't get around to that either.
> - It is likely there are still some problems with stability, mostly
> race conditions.  If you have a fix for one of these, please send me a
> patch.
> - Lack of scripts. I have created 7 scripts for use with this, plus the
> library file.  I would really like more scripts to be created.
> - Some sections, expecially the last.fm wiki, can take up large amounts
> of a row.  If there is a good way to set the maximum size that an
> element can be, please let me know. I tried to use max-width in one
> place, but that does not seem to be working.
> - Seperating the sections on the same row is done rather haphazardly at
> the moment.  It works, but it does not look very good.
> - Some of the scripts use a caching mechanism to speed up content
> generation. That cache never expires.
> - I don't know if the scoring/rating works or not. I have the dynamic
> collection patch that may affect it and don't feel like removing it.
>
> Eventually I would like to see all the content in the context browser
> (home, podcast, streams, etc.) generated in scripts.  I find that
> scripts are very flexible and are a large part of what makes Amarok
> wonderful.
>
> I would appreciate any questions, comments, suggestions, bug fixes,
> etc. that you have.



-- 
http://www.sebruiz.net/



More information about the Amarok mailing list