def inject_recordings(self, meta):
        recording_els = self._inject_recording_ids_internal(True, 'sources' in meta)[0]
        load_releases = False
        load_release_groups = False
        if 'releaseids' in meta or 'releases' in meta:
            load_releases = True
        if 'releasegroupids' in meta or 'releasegroups' in meta:
            load_releases = True
            load_release_groups = True
        metadata = lookup_metadata(self.conn, recording_els.keys(), load_releases=load_releases, load_release_groups=load_release_groups)
        if 'usermeta' in meta and not metadata:
            user_meta_els = self._inject_user_meta_ids_internal(True)[0]
            recording_els.update(user_meta_els)
            user_meta = lookup_meta(self.conn, user_meta_els.keys())
            metadata.extend(user_meta)
        for recording, recording_metadata in self._group_recordings(metadata, 'recordingids' in meta):
            if 'releasegroups' in meta or 'releasegroupids' in meta:
                self._inject_release_groups_internal(meta, recording, recording_metadata)
                if 'compress' in meta:
                    for release_group in recording.get('releasegroups', []):
                        for release in release_group.get('releases', []):
                            for medium in release.get('mediums', []):
                                for track in medium['tracks']:
                                    if 'title' in track and track['title'] == recording.get('title'):
                                        del track['title']
                    if 'artists' in release_group and release_group['artists'] == recording.get('artists'):
                        del release_group['artists']
            elif 'releases' in meta or 'releaseids' in meta:
                self._inject_releases_internal(meta, recording, recording_metadata)
                if 'compress' in meta:
                    for release in recording.get('releases', []):
                        for medium in release.get('mediums', []):
                            for track in medium['tracks']:
                                if 'title' in track and track['title'] == recording.get('title'):
                                    del track['title']
                        if 'artists' in release and release['artists'] == recording.get('artists'):
                            del release['artists']
            for recording_el in recording_els[recording['id']]:
                if 'usermeta' in meta:
                    if isinstance(recording['id'], int):
                        del recording['id']
                        if 'title' in recording and not recording['title']:
                            del recording['title']
                        if 'releasegroups' in recording:
                            releasegroups = []
                            for releasegroup in recording['releasegroups']:
                                del releasegroup['id']
                                if 'title' in releasegroup and not releasegroup['title']:
                                    del releasegroup['title']
                                if releasegroup in 'releases':
                                    releases = []
                                    for release in releasegroup['releases']:
                                        del release['id']
                                        if 'title' in release and not release['title']:
                                            del release['title']
                                        if release:
                                            releases.append(release)
                                    if releases:
                                        releasegroup['releases'] = releases
                                    else:
                                        del releasegroup['releases']
                                if releasegroup:
                                    releasegroups.append(releasegroup)
                            if releasegroups:
                                recording['releasegroups'] = releasegroups
                            else:
                                del recording['releasegroups']
                        if 'releases' in recording:
                            releases = []
                            for release in recording['releases']:
                                del release['id']
                                if 'title' in release and not release['title']:
                                    del release['title']
                                if release:
                                    releases.append(release)
                            if releases:
                                recording['releases'] = releases
                            else:
                                del recording['releases']
                recording_el.update(recording)
dataset/ETHPy150Open lalinsky/acoustid-server/acoustid/api/v2/__init__.py/LookupHandler.inject_recordings/swapped operands of `in`