#10 Use expected value instead of constants for (UN)HEARD tracks


This is a patch versus mserv 0.35.

Without this patch, constants are used for (UN)HEARD
songs. They default to 75% or 55% for UNHEARD
(depending on the version of mserv), and 50% for HEARD.

With this patch, an expected value is used instead.
The effect is that if somebody rates a couple of songs
of an album SUPERB, chances increase that (s)he'll get
to hear more music from that album. And if somebody
rates a couple of songs of an album AWFUL, less music
will be played from that album.

The expected value is basically an average of the songs
within the same album that the user has actively rated.
If only a few songs have been rated, the average is
pulled towards the previously used constant. Thus,
just because you rate one song SUPERB won't mean all
songs in that album will be counted as being SUPERB;
they just get a small bonus.

Also, if you happen to dislike songs from one album,
you have to rate three or more BAD / AWFUL before your
rating has any effect. This is to prevent one low
rating from making it so that you'll never hear
anything from that album again.

Since the patch traverses the full tracks list to find
all other tracks within one album, it will scale badly
as the number of tracks grow. If there is a better way
of finding all tracks from one album I'd love to know
about it. If not I'll have to add some sort of caching
to improve performance.

I've tested it on a small music collection and it works
as intended. Before testing it on a large one I need
to resolve the scaling issue.

Any feedback regarding either the idea or the
implementation is much appreciated.


  • Johan Walles

    Johan Walles - 2004-01-18

    Expected value patch vs 0.35, works well but doesn't scale

  • James Ponder

    James Ponder - 2004-01-18

    Logged In: YES

    Another cool patch, thanks Johan.

    In answer to your question, see cmd_tracks - is that what
    you are looking for? e.g.:

    album = mserv_getalbum(id);
    for (i = 0; i < album->ntracks; i++) {
    /* album->tracks[i] is track i+1 */

    where id is the album id, which can be found in track->n_album

    How does this patch relate to your other patch? Apply them
    both or is there some overlap?

  • James Ponder

    James Ponder - 2004-01-18
    • assigned_to: nobody --> squish
  • Johan Walles

    Johan Walles - 2004-04-12

    Logged In: YES

    This patch stands by itself.

    If i merge this into the CVS version (after resolving the
    scaling issues), would you like it to be enabled always,
    optional but enabled by default or optional and disabled by

  • Johan Walles

    Johan Walles - 2004-04-24

    Logged In: YES

    Done. Woho!

  • Johan Walles

    Johan Walles - 2004-04-24
    • status: open --> closed

Log in to post a comment.