Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    26

    Defining virtual library for music source with lossy and lossless files

    Erland suggested I post here to get help with the following:

    I want to create a way to listen via browse||create playlists||random to music with my SB3/SS 6.5.1 headless ubuntu setup without concern over the file format from my library which contains lossless and lossy songs.

    Why? Because I have some songs that *only* exist in lossy format, most songs that exist in both formats, and some that *only* exist in lossy. I want the highest available quality to play on my husband's fancy stereo system.

    There are many posts about how to setup SS to exclude all lossy files or to use iTunes but neither fits my needs. (ie. http://forums.slimdevices.com/showthread.php?t=30761)

    So Erland suggested that his multilibrary plugin could be used if I could define the appropriate sql statement. I'd then use his other plugins to deal with browse/playlist/etc.

    in layman's terminology, select all lossless + (all lossy that do not exist in lossless). My music is organized into two primary folders, lossless and lossy. All lossless music is also tagged 'lossless'.

    sorry for the long-winded post. But I believe that others must be in a similar situation. Any suggestions?

  2. #2
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    10,887
    Just some clarifications if someone is willing to help bupkes.

    The Multi Library plugin wants a SQL statement that returns the tracks.id of all tracks that should be part of the library. So I think it should be something like this:
    Code:
    select id from tracks where 
    	audio=1 and 
    	lossless=1
    union
    select lossytracks.id from tracks as lossytracks where 
    	lossytracks.audio=1 and 
    	lossytracks.lossless=0 and 
    	not exists (select id from tracks where XXX)
    The problem is the XXX part which needs to be replaced with something smart so the inner SQL only finds a track if there isn't a corresponding lossless track for the current handled row in the result (lossytracks). I don't have time to figure this out myself at the moment, so I asked bupkes to post here in case someone else is up to the challenge.

    The music library is also setup something like this:
    Code:
    C:\My Music\Lossy (Contains all lossy files)
    C:\My Music\Lossless (Contains all lossless files)
    I think it should be possible to either compare the last part of the urls but exclude the file extensions or another alternative would be to somehow compare the track title and album titles to check if there is a corresponding lossless track.
    Erland Isaksson (My homepage)
    (Developer of many plugins/applets (both free and commercial).
    If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)

    Interested in the future of music streaming ? ickStream - A world of music at your fingertips.

  3. #3
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    10,887
    I'm not sure if this is going to work in all situations, but if we can assume that a track title + album title combination is unique if we don't take the file format into account, the SQL statement below should work.
    Code:
    select id from tracks where
    	audio=1 and
    	lossless=1
    union
    select lossytracks.id from tracks as lossytracks,albums as lossyalbums where 
    	audio=1 and 
    	lossless=0 and
    	lossytracks.album=lossyalbums.id and
    	not exists (select tracks.id from tracks,albums where
    			tracks.album=albums.id and
    			tracks.audio=1 and
    			tracks.lossless=1 and
    			tracks.title=lossytracks.title and
    			albums.title=lossyalbums.title);
    If you unzip the bestformat.zip attached with this post into: "Plugins/MulitLibrary/Templates" you should be able to create a new library of type "Best format library". The default values should be fine, so just change the "Library name" parameter in case you want to call it something else. In playlists with SQL Playlist plugin you can now select a library in the "Library" parameter when editing the playlists, that way the playlist will be limited to tracks in the library you have selected.
    If you use Custom Browse, you will also get some browse menus that is limited to the new library. In case you have albums for which both lossy and lossless tracks are included in the library I think these browse menus will contain duplicate album entries, some menu customization will be required to get rid of this problem.

    I don't have a good setup or time to verify that this works correct at the moment, so I would appreciate if you could verify if it works or not and then give me some feedback.

    In case someone can figure out how to make the SQL look at the similarites in the URL instead, I'm still interested in this since I'm not sure the SQL I created will work in all situations, for example I have a feeling "Best of ...." albums might not work correctly.
    Attached Files Attached Files
    Erland Isaksson (My homepage)
    (Developer of many plugins/applets (both free and commercial).
    If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)

    Interested in the future of music streaming ? ickStream - A world of music at your fingertips.

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Posts
    196

    Defining virtual library for music source withlossy and lossless files

    >>>>> erland <erland.2m1axn1171522501 (AT) no-mx (DOT) forums.slimdevices.com> writes:

    > I'm not sure if this is going to work in all situations, but if we can
    > assume that a track title + album title combination is unique if we
    > don't take the file format into account, the SQL statement below should
    > work.


    You should probably also check against the track #. I have a number of
    albums that have multiple versions of the same song as bonus tracks.

    greg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •