Retrieve and apply info from the autotagger for items matched by query.
(self, lib, query, move, pretend, write)
| 73 | self.albums(lib, args, move, pretend, write) |
| 74 | |
| 75 | def singletons(self, lib, query, move, pretend, write): |
| 76 | """Retrieve and apply info from the autotagger for items matched by |
| 77 | query. |
| 78 | """ |
| 79 | for item in lib.items([*query, "singleton:true"]): |
| 80 | if not item.mb_trackid: |
| 81 | self._log.info( |
| 82 | "Skipping singleton with no mb_trackid: {}", item |
| 83 | ) |
| 84 | continue |
| 85 | |
| 86 | if not self.is_beatport_track(item): |
| 87 | self._log.info( |
| 88 | "Skipping non-{.beatport_plugin.data_source} singleton: {}", |
| 89 | self, |
| 90 | item, |
| 91 | ) |
| 92 | continue |
| 93 | |
| 94 | # Apply. |
| 95 | trackinfo = self.beatport_plugin.track_for_id(item.mb_trackid) |
| 96 | with lib.transaction(): |
| 97 | TrackMatch(Distance(), trackinfo, item).apply_metadata( |
| 98 | from_scratch=False |
| 99 | ) |
| 100 | apply_item_changes(lib, item, move, pretend, write) |
| 101 | |
| 102 | @staticmethod |
| 103 | def is_beatport_track(item): |
no test coverage detected