Replies: 5 comments 4 replies
-
Sure! You'll want to use Line 1539 in 50825db For the beets/beetsplug/subsonicplaylist.py Lines 72 to 74 in 018396c |
Beta Was this translation helpful? Give feedback.
-
Thanks @sampsyo. Does it do some sort of "fuzzy" matching? |
Beta Was this translation helpful? Give feedback.
-
@sampsyo So, I tried this function: def _update_recently_played(self, lib):
"""Fetch the Plex track key."""
tracks = self.music.search(
filters={'track.lastViewedAt>>': '7d'}, libtype='track')
with lib.transaction():
for track in tracks:
query = MatchQuery('plex_ratingkey', track.ratingKey)
item = lib.items(query)
self._log.debug('Obtained item: {}', item)
self._fetch_plex_info(item, write=True, force=True) This is to obtain the item with matching
I can confirm that the
|
Beta Was this translation helpful? Give feedback.
-
I also tried a simple |
Beta Was this translation helpful? Give feedback.
-
Ok....looks like I was missing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create a command to import playlists. Several sources (e.g., Spotify, Deezer) provide APIs to obtain the tracks in a given playlist. I can extract the
title
,album
, andyear
for each track in the playlist.For Spotify, we can use
trackid
. However, sometimes the same track can have multiple ids (depending on the number of versions) and we may not get a match with thetrackid
. Thus, my approach will be to match the identifier, if available. Otherwise, use manual text matching (based on album, title, and year information).Now, I am wondering what is the best way to match that information in the beets database to get the
item
. Basically, I will pass the title, album, and year information and I would like to obtain a match (if available). I am assuming there is a function already somewhere that does the matching and returns theitem
.I should add that sometimes there may not be an exact match. For example, the Spotify title could be
Ye Tune Kya Kiya
and the title in the database could beYe Tune Kya Kiya Hai
. So, the closest match above a certain threshold (distance?) should be returned.Beta Was this translation helpful? Give feedback.
All reactions