I’m using the Plex Sqlite database to report on my music listening history, and I’m looking for ways to include the media duration in my reporting.
Today I’m getting listens from metadata_item_views, and track information from metadata_items. This works well.
I’ve found a duration column in plex_media_parts and plex_media_items but I haven’t found a common key column to join either one to the corresponding metadata_items records.
Can anyone point me in the right direction here?
I’ll keep exploring, but wanted to ask in case someone else had figured this out already. Thanks in advance!
Edit: adding an example of what I’ve been able to accomplish so far. I’m currently pulling track duration from MusicBrainz, but I’ve recently found many examples of missing durations in their metadata and I’m hoping for something simpler and more reliable…
