diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,5 +1,5 @@ swh.core >= 0.0.95 -swh.indexer >= 0.0.171 +swh.indexer >= 0.3.0 swh.model >= 0.5.0 swh.scheduler >= 0.1.1 swh.search >= 0.2.0 diff --git a/swh/web/common/archive.py b/swh/web/common/archive.py --- a/swh/web/common/archive.py +++ b/swh/web/common/archive.py @@ -182,7 +182,7 @@ filetype = _first_element(list(idx_storage.content_mimetype_get([sha1]))) if not filetype: return None - return converters.from_filetype(filetype) + return converters.from_filetype(filetype.to_dict()) def lookup_content_language(q): diff --git a/swh/web/tests/conftest.py b/swh/web/tests/conftest.py --- a/swh/web/tests/conftest.py +++ b/swh/web/tests/conftest.py @@ -330,7 +330,9 @@ self.mimetype_indexer.run([hash_to_bytes(cnt_id)], "update-dups") def content_get_mimetype(self, cnt_id): - mimetype = next(self.idx_storage.content_mimetype_get([hash_to_bytes(cnt_id)])) + mimetype = self.idx_storage.content_mimetype_get([hash_to_bytes(cnt_id)])[ + 0 + ].to_dict() return converters.from_filetype(mimetype) def content_add_language(self, cnt_id):