fix: sha256 check for model deduplication

This commit is contained in:
josc146 2023-05-28 23:45:11 +08:00
parent a16c85b07d
commit 822f2d729c

View File

@ -113,7 +113,7 @@ export async function refreshRemoteModels(cache: { models: ModelSourceItem[] })
cache.models = cache.models.filter((model, index, self) => {
return model.name.endsWith('.pth')
&& index === self.findIndex(
m => m.name === model.name || (m.SHA256 === model.SHA256 && m.size === model.size));
m => m.name === model.name || (m.SHA256 && m.SHA256 === model.SHA256 && m.size === model.size));
});
commonStore.setModelSourceList(cache.models);
await saveCache().catch(() => {