How to identify type of Song?
I'd like to filter my library as its being parsed as I have a mixture of music, podcasts, and audiobooks. Is there an attribute to identify which of these a Song is?
Here's all the attributes of the song class:
'name', 'work', 'movement_number', 'movement_count', 'movement_name', 'track_id', 'artist', 'album_artist', 'composer', 'album', 'genre', 'kind', 'size', 'total_time', 'track_number', 'track_count', 'disc_number', 'disc_count', 'year', 'date_modified', 'date_added', 'bit_rate', 'sample_rate', 'comments', 'rating', 'rating_computed', 'play_count', 'album_rating', 'album_rating_computed', 'persistent_id', 'location_escaped', 'location', 'compilation', 'lastplayed', 'skip_count', 'skip_date', 'length', 'track_type', 'grouping', 'podcast', 'movie', 'has_video', 'loved', 'album_loved', 'playlist_only', 'apple_music', 'protected'
I believe podcast is what you're looking for.
Perfect,thank you! Is there an equivalent one for audiobooks?
I don't see one, unfortunately. I don't have any audiobooks on iTunes myself, so I'm not sure what the XML formatting would look like.
You could probably hack it by just checking the length (1hr+ is probably an audiobook, LOL).
According to google bard:
To recognize an audiobook in the iTunes XML library file, you can use the following XPath expression:
/plist/dict/key[@name='Kind']/string[@value='Audiobook']
Kind is one of the attributes in the song class, I don't have any in mine, so I can not confirm. But it would be worth checking out