fix: provider-aware collection count labels in tracker list
"1 album(s)" now shows "1 device(s)" for NUT, "1 repo(s)" for Gitea, "1 board(s)" for Planka instead of hardcoded album label.
This commit is contained in:
@@ -277,6 +277,17 @@
|
||||
return p?.name || `#${id}`;
|
||||
}
|
||||
|
||||
const collectionCountLabel: Record<string, string> = {
|
||||
immich: 'notificationTracker.albums_count',
|
||||
gitea: 'notificationTracker.repos_count',
|
||||
planka: 'notificationTracker.boards_count',
|
||||
nut: 'notificationTracker.devices_count',
|
||||
};
|
||||
function getCollectionLabel(tracker: Tracker): string {
|
||||
const pt = getProviderType(tracker);
|
||||
return t(collectionCountLabel[pt] || 'notificationTracker.albums_count');
|
||||
}
|
||||
|
||||
function configsForTracker(tracker: Tracker, configs: (TrackingConfig | TemplateConfig)[]): (TrackingConfig | TemplateConfig)[] {
|
||||
const pt = getProviderType(tracker);
|
||||
return pt ? configs.filter((c) => c.provider_type === pt) : configs;
|
||||
@@ -423,7 +434,7 @@
|
||||
<CrossLink href="/providers" icon="mdiServer" label={getProviderName(tracker.provider_id)} entityId={tracker.provider_id} />
|
||||
</div>
|
||||
<p class="text-sm text-[var(--color-muted-foreground)]">
|
||||
{(tracker.collection_ids || []).length} {t('notificationTracker.albums_count')} · {t('notificationTracker.every')} {tracker.scan_interval}s · {(tracker.tracker_targets || []).length} {t('notificationTracker.linkedTargets')}
|
||||
{(tracker.collection_ids || []).length} {getCollectionLabel(tracker)} · {t('notificationTracker.every')} {tracker.scan_interval}s · {(tracker.tracker_targets || []).length} {t('notificationTracker.linkedTargets')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-1 flex-wrap justify-end">
|
||||
|
||||
Reference in New Issue
Block a user