From fd1fd2182b3ee3af6aa775f3127ade69594ac1d4 Mon Sep 17 00:00:00 2001 From: MrNuggelz Date: Mon, 11 May 2020 20:09:04 +0200 Subject: [PATCH] changed "SubstringQuery" to "MatchQuery" to prevent wrong song selection --- beetsplug/subsonicplaylist.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beetsplug/subsonicplaylist.py b/beetsplug/subsonicplaylist.py index 95bdaa886..c537c4093 100644 --- a/beetsplug/subsonicplaylist.py +++ b/beetsplug/subsonicplaylist.py @@ -24,7 +24,7 @@ from urllib.parse import urlencode import requests from beets.dbcore import AndQuery -from beets.dbcore.query import SubstringQuery +from beets.dbcore.query import MatchQuery from beets.plugins import BeetsPlugin from beets.ui import Subcommand @@ -71,9 +71,9 @@ class SubsonicPlaylistPlugin(BeetsPlugin): def update_tags(self, playlist_dict, lib): with lib.transaction(): for query, playlist_tag in playlist_dict.items(): - query = AndQuery([SubstringQuery("artist", query[0]), - SubstringQuery("album", query[1]), - SubstringQuery("title", query[2])]) + query = AndQuery([MatchQuery("artist", query[0]), + MatchQuery("album", query[1]), + MatchQuery("title", query[2])]) items = lib.items(query) if not items: self._log.warn(u"{} | track not found ({})", playlist_tag,