feat: Add 'times used' translation keys and implement usage-based sorting in the model service.

This commit is contained in:
Will Miao
2025-12-26 22:39:51 +08:00
parent 914d24b8bf
commit d9ce2c56c0
11 changed files with 31 additions and 3 deletions

View File

@@ -84,13 +84,11 @@ class BaseModelService(ABC):
overall_start = time.perf_counter()
sort_params = self.cache_repository.parse_sort(sort_by)
t0 = time.perf_counter()
if sort_params.key == 'usage':
sorted_data = await self._fetch_with_usage_sort(sort_params)
else:
sorted_data = await self.cache_repository.fetch_sorted(sort_params)
t0 = time.perf_counter()
sorted_data = await self.cache_repository.fetch_sorted(sort_params)
fetch_duration = time.perf_counter() - t0
initial_count = len(sorted_data)