Skip to content

Commit

Permalink
Merge pull request #13 from phirestalker/mb-only
Browse files Browse the repository at this point in the history
Ignores files with a non MusicBrainz data_source during distance check
  • Loading branch information
kernitus authored Oct 29, 2023
2 parents 457084e + 787c6b8 commit 74ea6af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beetsplug/oldestdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ def _import_trackinfo(self, info):

def track_distance(self, session, info):
dist = hooks.Distance()
if info.data_source != 'MusicBrainz':
self._log.debug('Skipping track with non MusicBrainz data source {0.artist} - {0.title}', info)
return dist
if self.config['filter_on_import'] and not self._has_work_id(info.track_id):
dist.add('work_id', 1)

Expand Down Expand Up @@ -276,7 +279,7 @@ def _on_import(self, session, task):
self._process_file(item)

def _process_file(self, item):
if not item.mb_trackid:
if not item.mb_trackid or item.data_source != 'MusicBrainz':
self._log.info('Skipping track with no mb_trackid: {0.artist} - {0.title}', item)
return

Expand Down

0 comments on commit 74ea6af

Please sign in to comment.