Playlist based on albums not played or not played recently

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

palmernet
Posts: 12
Joined: Sat Feb 24, 2007 10:58 am

Playlist based on albums not played or not played recently

Post by palmernet »

I would like to create a playlist contains songs from albums I haven't listed to in my collection since I migrated to Media Monkey.

I can obtain a list fairly easily using Microsoft Access and ODBC with this query:
SELECT TOP 100 Albums.Artist, Albums.Album, Songs.ID, Songs.TrackNumber, Songs.SongTitle, Songs.SongPath, Songs.Year
FROM Songs INNER JOIN Albums ON Songs.IDAlbum = Albums.ID
WHERE (((Exists (SELECT 'X' FROM Songs WHERE Albums.ID=Songs.IDAlbum and LastTimePlayed>0))=False));


Is there are way to create a playlist from an SQL query?
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Playlist based on albums not played or not played recently

Post by nynaevelan »

You can use Bex's SQL Viewer script for this. Here are some examples he gave me for something else, but they should get you started on your way.

Code: Select all

SELECT IDPlaylist, PlaylistName FROM Playlists WHERE PlaylistName = 'playlistname goes here'
Note the id for future use.

Construct your sql which finds the songs you want to put in the playlists.
When you then want to add the songs to your playlist you need to construct the SELECT-statement like this:

Code: Select all

SELECT ThePlaylistIdHere, Songs.ID FROM songs WHERE bla bla bla
To actually add the songs do like this:

Code: Select all

INSERT INTO Playlists (IDPlaylist, IDSong) SELECT ThePlaylistIdHere, Songs.ID FROM songs WHERE bla bla bla
To remove the songs from your playlist before you add new ones, either do it manually in MM or run this sql:

Code: Select all

DELETE FROM Playlists WHERE IDPlaylist = ThePlaylistIdHere
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
palmernet
Posts: 12
Joined: Sat Feb 24, 2007 10:58 am

Re: Playlist based on albums not played or not played recently

Post by palmernet »

This script is good - but how do I turn it into a auto-playlist?
Post Reply