Fetching a list of songs from my old Plex library after a hard drive failure...
- Title
- Performing Artist
- Album
- Release Date
- Track #
- Covert Art
- Genre
Plex songs (inspecting metadata_items
)...
artists - (metadata_type=8
, found via: parent_id is null
)
title, title_sort, summary, tags_genre, tags_country
albums - (metadata_type=9
, found via: parent_id is not null and media_item_count = 0
)
parent_id (artist), title, title_sort, studio, summary, tags_genre
songs - (metadata_type=10
, found via: parent_id is not null and media_item_count > 0
)
parent_id (album), title, title_sort, index (track #), year
SELECT
song.title AS song_title,
song.title_sort AS song_title_sort,
song.`index` AS song_track_no,
song.year AS song_year,
album.title AS album_title,
album.title_sort AS album_title_sort,
album.studio AS album_studio,
album.summary AS album_summary,
album.tags_genre AS album_genre,
artist.title AS artist_title,
artist.title_sort AS artist_title_sort,
artist.summary AS artist_summary,
artist.tags_genre AS artist_genre,
artist.tags_country AS artist_country
FROM
(select * from metadata_items where metadata_type=10) AS song
LEFT JOIN
(select * from metadata_items where metadata_type=9) AS album
ON song.parent_id = album.id
LEFT JOIN
(select * from metadata_items where metadata_type=8) AS artist
ON album.parent_id = artist.id
Album art should be possible too, but didn't look too closely into it.