slimmer search results formatting

This commit is contained in:
Simon
2018-08-09 21:03:30 -04:00
parent fae9d8e82e
commit 9ffd2c141a
2 changed files with 3 additions and 12 deletions

View File

@@ -107,18 +107,9 @@ class OdDatabase:
else: else:
hl_name = src["name"] hl_name = src["name"]
# Path highlight message += "[" + src["website_url"] + "](https://od-db.the-eye.eu/website/" + str(src["website_id"]) + "/).../"
if "path" in hit["highlight"]:
hl_path = format_highlight(hit["highlight"]["path"][0])
else:
hl_path = src["path"]
hl_path = truncate_path(hl_path, 35)
hl_path += "/" if hl_path else ""
message += "[" + src["website_url"] + "](https://od-db.the-eye.eu/website/" + str(src["website_id"]) + "/)" + hl_path
message += hl_name + ("." if src["ext"] else "") + src["ext"] + " | " message += hl_name + ("." if src["ext"] else "") + src["ext"] + " | "
message += humanfriendly.format_size(src["size"]) + " | " message += humanfriendly.format_size(src["size"]) + " \n"
message += time.strftime("%Y-%m-%d", time.gmtime(src["mtime"])) + " \n"
else: else:
message += "\n" message += "\n"