How does an iPhone know which mp3s are podcasts?

Solution 1:

I think that the way that iTunes separates out podcasts in the Library has to do with how podcasts are synced. Podcast are handled differently than Mp3s.

I just dug into the iTunes Music Library.xml and saw that on podcasts, the following elements appear under podcasts

<key>Podcast</key><true/>

So it has to to with the fact that iTunes flags podcasts as such, and know to handle them differently.

UPDATE: Also, its more than just that key-value pair on the podcast entry, because if you add that key-value pair to any song, it gets removed by iTunes when you close it

UPDATE 2: I also found the entry specifying the Podcast "playlist"

    <dict>
        <key>Name</key><string>Podcasts</string>
        <key>Playlist ID</key><integer>11896</integer>
        <key>Playlist Persistent ID</key><string>6D71FCACB79A978D</string>
        <key>Distinguished Kind</key><integer>10</integer>
        <key>Podcasts</key><true/>
        <key>All Items</key><true/>
        <key>Playlist Items</key>
        <array>
            <dict>
                <key>Track ID</key><integer>7194</integer>
            </dict>
            <dict>
                <key>Track ID</key><integer>7192</integer>
            </dict>
            <dict>
                <key>Track ID</key><integer>7190</integer>
            </dict>
        </array>
    </dict>

Long story short, iTunes is doing a lot of work in the background!!

Solution 2:

There is a handy free Applescript from Doug's Scripts that will re-add the selected tracks as podcasts.

Re-Add Selected Tracks as Podcast v1.2

Solution 3:

A quick look through my iTunes library shows that most Podcasts have the ID3 genre attribute set to... "Podcast"