All pastes #613802 Raw Edit

Untitled

public text v1 · immutable
·published 2007-07-11 05:31 UTC
rendered paste body
    from xl import library

    where = """
                SELECT 
                    paths.name
                FROM tracks, albums, paths, artists
                WHERE 
                    blacklisted=0 AND
                    (
                        paths.id=tracks.path AND
                        albums.id=tracks.album AND
                        artists.id=tracks.artist 
                    )
                ORDER BY 
        LSTRIP_SPEC(albums.name), disc_id,
        track,
        LSTRIP_SPEC(title)
    """ 

    res = library.search_tracks(APP.window, APP.db, APP.all_songs, None, None, where)
    
    list = []
    prev = ''
    for t in res:
        if t.album == prev:
            continue
        else:
            prev = t.album
            list.append(t.album)

    print list