mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Count only the material packages by author, not all packages.
Contributes to CURA-5670.
This commit is contained in:
parent
bf1d3b964f
commit
b638b2274a
1 changed files with 4 additions and 3 deletions
|
@ -518,9 +518,10 @@ class Toolbox(QObject, Extension):
|
|||
@pyqtSlot(str, result = int)
|
||||
def getTotalNumberOfMaterialPackagesByAuthor(self, author_id: str) -> int:
|
||||
count = 0
|
||||
for package in self._metadata["materials_available"]:
|
||||
if package["author"]["author_id"] == author_id:
|
||||
count += 1
|
||||
for package in self._metadata["packages"]:
|
||||
if package["package_type"] == "material":
|
||||
if package["author"]["author_id"] == author_id:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
@pyqtSlot(str, result = bool)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue