Index: src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp
===================================================================
--- src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp	(revision 2231)
+++ src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod.mdp	(working copy)
@@ -12,6 +12,7 @@
     <File name="./IpodDap.cs" subtype="Code" buildaction="Compile" />
     <File name="./IpodDapTrackInfo.cs" subtype="Code" buildaction="Compile" />
     <File name="./UnsupportedDatabaseView.cs" subtype="Code" buildaction="Compile" />
+    <File name="./IPodPlaylistSource.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Banshee.Widgets" />
@@ -19,5 +20,6 @@
     <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
+    <ProjectReference type="Assembly" localcopy="True" refto="../../../../ipod-sharp/src/ipod-sharp.dll" />
   </References>
 </Project>
\ No newline at end of file
Index: src/Dap/Banshee.Dap.Ipod/IPodPlaylistSource.cs
===================================================================
--- src/Dap/Banshee.Dap.Ipod/IPodPlaylistSource.cs	(revision 0)
+++ src/Dap/Banshee.Dap.Ipod/IPodPlaylistSource.cs	(revision 0)
@@ -0,0 +1,45 @@
+
+using System;
+using Banshee.Dap;
+using Banshee.Sources;
+using Banshee.Base;
+using IPod;
+
+
+namespace Banshee.Dap.Ipod
+{
+	
+	public class IPodPlaylistSource : DapPlaylistSource
+	{
+		public IPodPlaylistSource(IpodDap device, string name) : base(device, name)
+        {        
+        }
+        
+        public override void AddTrack(TrackInfo track)
+        {
+            if (track == null) {
+            	return;
+            }
+
+            if (!ContainsTrack(track)) {
+                base.AddTrack(track);
+            }
+        }
+
+        public override void SourceDrop(Banshee.Sources.Source source)
+        {
+            if(source == this || source == null ) {
+                return;
+            }
+            
+            if (source.Tracks == null) {
+            	return;
+            }
+            	
+            foreach(TrackInfo track in source.Tracks) {
+                AddTrack(track);
+            }
+        }
+	}
+}
+
Index: src/Dap/Banshee.Dap.Ipod/IpodDap.cs
===================================================================
--- src/Dap/Banshee.Dap.Ipod/IpodDap.cs	(revision 2231)
+++ src/Dap/Banshee.Dap.Ipod/IpodDap.cs	(working copy)
@@ -35,10 +35,12 @@
 using Gtk;
 using Hal;
 using IPod;
+using System.Collections.Generic;
 
 using Banshee.Base;
 using Banshee.Dap;
 using Banshee.Widgets;
+using Banshee.Sources;
 using Banshee.Metadata;
 
 public static class PluginModuleEntry
@@ -56,12 +58,13 @@
     [DapProperties(DapType = DapType.NonGeneric, PipelineName="Ipod")]
     [SupportedCodec(CodecType.Mp3)]
     [SupportedCodec(CodecType.Mp4)]
-    public sealed class IpodDap : DapDevice
+    public sealed class IpodDap : DapDevice, IPlaylistCapable
     {
         private IPod.Device device;
         private Hal.Device hal_device;
         private bool database_supported;
         private UnsupportedDatabaseView db_unsupported_container;
+    	private System.Collections.Generic.List <IPodPlaylistSource> playlists = new System.Collections.Generic.List<IPodPlaylistSource> ();
         private bool metadata_provider_initialized = false;
     
         public override InitializeResult Initialize(Hal.Device halDevice)
@@ -108,6 +111,17 @@
 
             ReloadDatabase(false);
             
+            foreach (Playlist play in device.TrackDatabase.Playlists) {                
+                IPodPlaylistSource ps = new IPodPlaylistSource(this, play.Name);
+                
+       		    foreach (Track t in play.Tracks) {
+       		        ps.AddTrack(new IpodDapTrackInfo(t));
+       		    }
+       		    
+                this.Source.SourceDrop((AbstractPlaylistSource) ps);
+            }
+            
+            playlists.Clear();
             CanCancelSave = false;
             return InitializeResult.Valid;
         }
@@ -118,6 +132,7 @@
                 device = new IPod.Device(hal_device["block.device"]);
                 if(File.Exists(Path.Combine(device.ControlPath, Path.Combine("iTunes", "iTunesDB")))) { 
                     device.LoadTrackDatabase();
+                   
                 } else {
                     throw new DatabaseReadException("iTunesDB does not exist");
                 }
@@ -165,12 +180,7 @@
         
         public override void AddTrack(TrackInfo track)
         {
-            AddTrack(track, false);
-        }
-
-        private void AddTrack(TrackInfo track, bool loading)
-        {
-            if (track == null || (IsReadOnly && !loading))
+            if (track == null || IsReadOnly)
                 return;
 
             TrackInfo new_track = null;
@@ -211,11 +221,25 @@
                 device.TrackDatabase.Reload();
             }
             
-            if(database_supported || (device.IsNew && device.IsShuffle)) {
+            if(database_supported) {
                 foreach(Track track in device.TrackDatabase.Tracks) {
                     IpodDapTrackInfo ti = new IpodDapTrackInfo(track);
-                    AddTrack(ti, true);
+                    AddTrack(ti);            
                 }
+                
+                device.TrackDatabase.Save();
+                foreach(Playlist play in device.TrackDatabase.Playlists){
+                	PlaylistSource ps = new PlaylistSource( play.Name);
+       				foreach (Track t in play.Tracks){
+       					ps.AddTrack( new IpodDapTrackInfo(t));
+       				}
+                	AddPlaylist(ps);
+                }
+                
+//                foreach (PlaylistSource ps in Banshee.Sources.PlaylistSource.Playlists){
+//					SourceDrop(ps);
+//				}
+                
             } else {
                 BuildDatabaseUnsupportedWidget();
             }
@@ -250,7 +274,15 @@
                     track.Track.Uri = new Uri(track.Uri.AbsoluteUri);
                 }
             }
-            
+//            foreach (Playlist p in (new System.Collections.Generic.List<Playlist> (device.TrackDatabase.Playlists)))
+//            	device.TrackDatabase.RemovePlaylist(p);
+            	
+//            foreach (IPodPlaylistSource ips in playlists){
+//				if( ips != null && ips.iplist != null)
+//					CommitPlaylistToDevice(ips);
+//					
+//			}
+			
             device.TrackDatabase.SaveProgressChanged += delegate(object o, TrackSaveProgressArgs args)
             {
                 double progress = args.CurrentTrack == null ? 0.0 : args.TotalProgress;
@@ -260,7 +292,8 @@
                     
                 UpdateSaveProgress(Catalog.GetString("Synchronizing iPod"), message, progress);
             };
-
+			
+			
             try {
                 device.TrackDatabase.Save();
             } catch(Exception e) {
@@ -374,14 +407,7 @@
                 case DeviceModel.VideoWhite: id = "ipod-video-white"; break;
                 case DeviceModel.VideoBlack: id = "ipod-video-black"; break;
                 default:
-                    if(device.IsShuffle) {
-                        id = "ipod-shuffle";
-                    } else if(device.Model >= DeviceModel.NanoSilver &&
-                        device.Model <= DeviceModel.NanoProductRed) {
-                        id = "ipod-nano-white";
-                    } else {
-                        id = "ipod-standard-monochrome";
-                    }
+                    id = "ipod-standard-monochrome";
                     break;
             }
             
@@ -473,7 +499,28 @@
             }
         }
         
-        internal IPod.Device Device {
+        public DapPlaylistSource AddPlaylist(Source playlist){        	
+       		IPodPlaylistSource iplay = new IPodPlaylistSource(this, playlist.Name);
+       		LogCore.Instance.PushDebug("Adding playlist", "PlaylistSource name: " + playlist.Name);
+       		
+       		foreach (TrackInfo ti in playlist.Tracks) {
+       		    LogCore.Instance.PushDebug("Adding " + ti.ToString(), " to playlist " + iplay.Name);
+                iplay.AddTrack(ti);
+        	}
+       		
+//        	if( playlists.Contains(iplay) )
+//        			playlists.Remove(iplay);
+//        	playlists.Add(iplay);
+        	
+        	return (DapPlaylistSource) iplay;
+        }
+        
+//        private void CommitPlaylistToDevice (IPodPlaylistSource playlist){
+//        	Console.WriteLine(playlist.Name);
+//        	playlist.Commit();
+//        	//device.TrackDatabase.Save();
+//        }
+        public IPod.Device Device {
             get {
                 return device;
             }
Index: src/Dap/Banshee.Dap.Ipod/Makefile.am
===================================================================
--- src/Dap/Banshee.Dap.Ipod/Makefile.am	(revision 2231)
+++ src/Dap/Banshee.Dap.Ipod/Makefile.am	(working copy)
@@ -10,7 +10,8 @@
 	$(srcdir)/IpodQueryJob.cs \
 	$(srcdir)/IpodDapTrackInfo.cs \
 	$(srcdir)/UnsupportedDatabaseView.cs \
-	$(srcdir)/DatabaseRebuilder.cs
+	$(srcdir)/DatabaseRebuilder.cs	\
+	$(srcdir)/IPodPlaylistSource.cs
 
 if ENABLE_IPOD
 bansheedapdir = $(pkglibdir)/Banshee.Dap
Index: src/Dap/Banshee.Dap.Ipod/UnsupportedDatabaseView.cs
===================================================================
--- src/Dap/Banshee.Dap.Ipod/UnsupportedDatabaseView.cs	(revision 2231)
+++ src/Dap/Banshee.Dap.Ipod/UnsupportedDatabaseView.cs	(working copy)
@@ -106,10 +106,6 @@
                 pane.Append(link, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, true);
             }
             
-            if(!dap.Device.CanWrite) {
-                return;
-            }
-            
             LinkLabel rebuild_link = new LinkLabel();
             rebuild_link.Xalign = 0.0f;
             rebuild_link.Markup = String.Format("<u>{0}</u>", GLib.Markup.EscapeText(Catalog.GetString(
Index: src/Core/Banshee.Base/Sources/DapPlaylistSource.cs
===================================================================
--- src/Core/Banshee.Base/Sources/DapPlaylistSource.cs	(revision 2231)
+++ src/Core/Banshee.Base/Sources/DapPlaylistSource.cs	(working copy)
@@ -9,6 +9,7 @@
     public class DapPlaylistSource : AbstractPlaylistSource
     {
         private DapDevice device;
+        
         public DapPlaylistSource(DapDevice device, string name) : base(name)
         {
             this.device = device;
