Index: plugins/ipod/rb-ipod-source.c
===================================================================
--- plugins/ipod/rb-ipod-source.c	(revision 4986)
+++ plugins/ipod/rb-ipod-source.c	(working copy)
@@ -97,6 +97,7 @@
 
 	GList *playlists;
 	gboolean needs_shuffle_db;
+        RBStaticPlaylistSource *podcast_pl;
 
 	guint load_idle_id;
 
@@ -340,7 +341,10 @@
 	}
 
 	priv->playlists = g_list_prepend (priv->playlists, playlist_source);
-
+        g_object_set_data (G_OBJECT (playlist_source),
+                           "itdb-playlist", playlist);
+        if (itdb_playlist_is_podcasts(playlist))
+                priv->podcast_pl = RB_STATIC_PLAYLIST_SOURCE (playlist_source);
 	rb_shell_append_source (shell, playlist_source, RB_SOURCE (source));
 	g_object_unref (shell);
 }
@@ -368,6 +372,15 @@
 }
 
 #ifdef ENABLE_IPOD_WRITING
+
+/* FIXME:  these should go away once we compile against new-enough libgpod */
+#ifndef ITDB_MEDIATYPE_AUDIO
+#define ITDB_MEDIATYPE_AUDIO         0x0001
+#endif
+#ifndef ITDB_MEDIATYPE_PODCAST
+#define ITDB_MEDIATYPE_PODCAST       0x0004
+#endif
+
 static Itdb_Track *
 create_ipod_song_from_entry (RhythmDBEntry *entry, const char *mimetype)
 {
@@ -393,6 +406,12 @@
 	track->rating = rhythmdb_entry_get_double (entry, RHYTHMDB_PROP_RATING);
 	track->app_rating = track->rating;
 	track->playcount = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_PLAY_COUNT);
+        if (rhythmdb_entry_get_pointer (entry, RHYTHMDB_PROP_TYPE)
+            == RHYTHMDB_ENTRY_TYPE_PODCAST_POST) {
+                track->mediatype = ITDB_MEDIATYPE_PODCAST;
+        } else {
+                track->mediatype = ITDB_MEDIATYPE_AUDIO;
+        }
 
 	return track;
 }
@@ -1043,6 +1062,24 @@
 	}
 }
 
+static void
+add_to_podcasts (RBiPodSourcePrivate *priv, Itdb_Track *song)
+{
+        gchar *filename;
+
+        RBStaticPlaylistSource *rbpl = priv->podcast_pl;
+        if (!rbpl)
+                return;
+        Itdb_Playlist *ipl = g_object_get_data (G_OBJECT (rbpl),
+                                                "itdb-playlist");
+
+        itdb_playlist_add_track (ipl, song, -1);
+        filename = ipod_path_to_uri (priv->ipod_mount_path,
+                                     song->ipod_path);
+        rb_static_playlist_source_add_location (rbpl, filename, -1);
+        g_free (filename);
+}
+
 static gboolean
 impl_track_added (RBRemovableMediaSource *source,
 		  RhythmDBEntry *entry,
@@ -1066,6 +1103,8 @@
 		itdb_track_add (priv->ipod_db, song, -1);
 		itdb_playlist_add_track (itdb_playlist_mpl (priv->ipod_db),
 					 song, -1);
+                if (song->mediatype == ITDB_MEDIATYPE_PODCAST)
+                        add_to_podcasts (priv, song);
 		request_artwork (isource, entry, db, song);
 
 		add_ipod_song_to_db (isource, db, song);
