Retrieve and apply info from the autotagger for items matched by query.
(self, lib, query, move, pretend, write)
| 69 | self.albums(lib, args, move, pretend, write) |
| 70 | |
| 71 | def singletons(self, lib, query, move, pretend, write): |
| 72 | """Retrieve and apply info from the autotagger for items matched by |
| 73 | query. |
| 74 | """ |
| 75 | for item in lib.items([*query, "singleton:true"]): |
| 76 | if not (track_id := item.mb_trackid): |
| 77 | self._log.info( |
| 78 | "Skipping singleton with no mb_trackid: {}", item |
| 79 | ) |
| 80 | continue |
| 81 | |
| 82 | if not ( |
| 83 | track_info := metadata_plugins.track_for_id( |
| 84 | track_id, item.get("data_source", "MusicBrainz") |
| 85 | ) |
| 86 | ): |
| 87 | self._log.info( |
| 88 | "Recording ID not found: {} for track {}", track_id, item |
| 89 | ) |
| 90 | continue |
| 91 | |
| 92 | # Apply. |
| 93 | with lib.transaction(): |
| 94 | TrackMatch(Distance(), track_info, item).apply_metadata( |
| 95 | from_scratch=False |
| 96 | ) |
| 97 | apply_item_changes(lib, item, move, pretend, write) |
| 98 | |
| 99 | def albums(self, lib, query, move, pretend, write): |
| 100 | """Retrieve and apply info from the autotagger for albums matched by |
no test coverage detected