From 0e67b6801c2d4fa1071df7661b62cadb060ac5c4 Mon Sep 17 00:00:00 2001 From: Andrea Mistrali Date: Mon, 22 Feb 2021 14:50:30 +0100 Subject: [PATCH] ARGH! Wrong variable --- beetsplug/mpdstats.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py index be543229d..8047a5c94 100644 --- a/beetsplug/mpdstats.py +++ b/beetsplug/mpdstats.py @@ -127,9 +127,10 @@ class MPDClientWrapper(object): entry = self.get('currentsong') if 'file' in entry: if not is_url(entry['file']): - if entry.startswith(self.strip_path): - entry = entry[len(self.strip_path):] - result = os.path.join(self.music_directory, entry) + file = entry['file'] + if file.startswith(self.strip_path): + file = file[len(self.strip_path):] + result = os.path.join(self.music_directory, file) else: result = entry['file'] return result, entry.get('id')