beets icon indicating copy to clipboard operation
beets copied to clipboard

Import (and sync) Plex music library details

Open arsaboo opened this issue 4 years ago • 2 comments

Plex is a great tool to manage and play music. Many users use Plex for playing music and manually provide track/album ratings and create playlists. Currently, this information is only available inside Plex. However, I like the idea of using Beets for managing the entire library so that we can use other tools like Subsonic. Thus, it would be great to import all the library details, like play count, ratings, playlists, etc. from Plex.

There are several other plugins that import stats (e.g., LastImport), so I am assuming this is something that Beets would want to do. In addition, we already have the basic infrastructure in terms of Plex connectivity.

Proposed solution

I am not too familiar with the underlying architecture of Beets and would leave this to the experts. But here's what I found.

  1. The table metadata_item_settings has the required information. The play count is available under column view_count and the column rating has the rating information (if the user has explicitly rated a track) on a 10 point scale.
    image
  2. Like other plugins (e.g., MusicBrainz, LastImport), we will need to add some Plex-specific fields like guid to map the tracks.

Objective

https://github.com/beetbox/beets/discussions/4077

Goals

Having play count and user ratings in beets can improve the overall discovery process. Other plugins can leverage this information to generate better recommendations/playlists.

arsaboo avatar Oct 01 '21 13:10 arsaboo

Sounds good! Maybe a good first step would be investigating the Plex API endpoints required to list all the music in a database?

sampsyo avatar Oct 01 '21 22:10 sampsyo

This has everything we need - https://python-plexapi.readthedocs.io/en/latest/modules/audio.html

arsaboo avatar Oct 02 '21 13:10 arsaboo

Added a community plugin beets-plexsync that does this and more. Closed via https://github.com/beetbox/beets/pull/4694

arsaboo avatar Mar 08 '23 13:03 arsaboo