Closed vitorgomateus closed 7 months ago
This looks pretty good so far. I tested some timings with the following three items- these are some sample items with lots of descendant formats:
item/b2051c02741f (5 descendants) item/b20h8hc2sf44 (6 desscendants) item/b20q4gb3zp83 (27 descendants)
The last one returned in about 1.25 seconds on my dev machine- this seems fast enough to me.
In mlc_ucla_search.py, I would change the sortDictByFormat() function a bit. RIght now, it starts with:
if( type(item) != str):
item = item[0]
I would be explicit and check what the item is:
if isinstance(item, tuple):
item = item[0]
Or even better, I'd use some assertions to make the function catch more errors, like this:
assert type(item) in (str, tuple)
if isinstance(item, tuple):
assert len(item)
assert isinstance(item[0], str)
item = item[0]
Otherwise the changes look pretty good. Please let me know what you think- if you like those changes please add them in a new commit and I'll merge everything right away.
Your code looks better. I committed it along with a typo fix.
(:unav)
populated fields tounknown
orunk
.by request
and when there is nocnet_id
.