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

@@ -131,6 +131,9 @@
"badges": {
"update": "Update",
"updateAvailable": "Update verfügbar"
},
"usage": {
"timesUsed": "Verwendungsanzahl"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "Update",
"updateAvailable": "Update available"
},
"usage": {
"timesUsed": "Times used"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "Actualización",
"updateAvailable": "Actualización disponible"
},
"usage": {
"timesUsed": "Veces usado"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "Mise à jour",
"updateAvailable": "Mise à jour disponible"
},
"usage": {
"timesUsed": "Nombre d'utilisations"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "עדכון",
"updateAvailable": "עדכון זמין"
},
"usage": {
"timesUsed": "מספר שימושים"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "アップデート",
"updateAvailable": "アップデートがあります"
},
"usage": {
"timesUsed": "使用回数"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "업데이트",
"updateAvailable": "업데이트 가능"
},
"usage": {
"timesUsed": "사용 횟수"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "Обновление",
"updateAvailable": "Доступно обновление"
},
"usage": {
"timesUsed": "Количество использований"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "更新",
"updateAvailable": "有可用更新"
},
"usage": {
"timesUsed": "使用次数"
}
},
"globalContextMenu": {

View File

@@ -131,6 +131,9 @@
"badges": {
"update": "更新",
"updateAvailable": "有可用更新"
},
"usage": {
"timesUsed": "使用次數"
}
},
"globalContextMenu": {

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)