Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to identify type of Song? #69

Open
ForsythsGambit opened this issue Mar 16, 2023 · 4 comments
Open

How to identify type of Song? #69

ForsythsGambit opened this issue Mar 16, 2023 · 4 comments

Comments

@ForsythsGambit
Copy link

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?

@brningpyre
Copy link
Contributor

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.

@ForsythsGambit
Copy link
Author

Perfect,thank you! Is there an equivalent one for audiobooks?

@brningpyre
Copy link
Contributor

brningpyre commented Apr 6, 2023

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).

@CAMYR71
Copy link
Contributor

CAMYR71 commented Sep 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants