Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    16

    SQL Skip specific album

    I'm using this query to get an Italian Playlist but I want to skip some particular albums with the album name 'Sentimento' and 'Viaggio Italiano'.

    I can't find the right query or string in the forum. Could you give me a little help?

    Thanks in Advance!

    Code:
    -- PlaylistName:Italian
    -- PlaylistGroups:
    -- PlaylistStartAction1:cli:customskip setsecondaryfilter nosintnoxmas.cs.xml
    -- PlaylistStopAction1:cli:customskip clearsecondaryfilter
    select tracks.url from tracks
    	join contributor_track on
    		tracks.id=contributor_track.track
    	join contributors on
    		contributor_track.contributor=contributors.id and contributor_track.role in (1,5)
    	left join dynamicplaylist_history on
    		tracks.id=dynamicplaylist_history.id
    	where
    		audio=1
    		and dynamicplaylist_history.id is null
    		and contributors.name in ('Andrea Bocelli','Eros Ramazotti','Paolo Conte','Laura Pausini')
                    and *** WHAT TO INSERT HERE?*** NOT in ('Sentimento', 'Viaggio Italiano')
    	order by rand()
    	limit 25;
    Last edited by evroekel; 2008-03-22 at 04:46. Reason: added code-style

  2. #2
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    10,313
    Try something like this, note that you will also need to add both the albums join and the where directive for albums.title

    Code:
    -- PlaylistName:Italian
    -- PlaylistGroups:
    -- PlaylistStartAction1:cli:customskip setsecondaryfilter nosintnoxmas.cs.xml
    -- PlaylistStopAction1:cli:customskip clearsecondaryfilter
    select tracks.url from tracks
    	join contributor_track on
    		tracks.id=contributor_track.track
    	join contributors on
    		contributor_track.contributor=contributors.id and contributor_track.role in (1,5)
    	join albums on
    		albums.id=tracks.id
    	left join dynamicplaylist_history on
    		tracks.id=dynamicplaylist_history.id
    	where
    		audio=1
    		and dynamicplaylist_history.id is null
    		and contributors.name in ('Andrea Bocelli','Eros Ramazotti','Paolo Conte','Laura Pausini')
                    and albums.title NOT in ('Sentimento', 'Viaggio Italiano')
    	order by rand()
    	limit 25;
    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)
    You may also want to try my Android apps Squeeze Display and RSS Photo Show
    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,313
    Sorry, there was a small bug in the previous one, this should do it:
    Code:
    -- PlaylistName:Italian
    -- PlaylistGroups:
    -- PlaylistStartAction1:cli:customskip setsecondaryfilter nosintnoxmas.cs.xml
    -- PlaylistStopAction1:cli:customskip clearsecondaryfilter
    select tracks.url from tracks
    	join contributor_track on
    		tracks.id=contributor_track.track
    	join contributors on
    		contributor_track.contributor=contributors.id and contributor_track.role in (1,5)
    	join albums on
    		albums.id=tracks.album
    	left join dynamicplaylist_history on
    		tracks.id=dynamicplaylist_history.id
    	where
    		audio=1
    		and dynamicplaylist_history.id is null
    		and contributors.name in ('Andrea Bocelli','Eros Ramazotti','Paolo Conte','Laura Pausini')
                    and albums.title NOT in ('Sentimento', 'Viaggio Italiano')
    	order by rand()
    	limit 25;
    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)
    You may also want to try my Android apps Squeeze Display and RSS Photo Show
    Interested in the future of music streaming ? ickStream - A world of music at your fingertips.

Posting Permissions

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