mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -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)
|
@pyqtSlot(str, result = int)
|
||||||
def getTotalNumberOfMaterialPackagesByAuthor(self, author_id: str) -> int:
|
def getTotalNumberOfMaterialPackagesByAuthor(self, author_id: str) -> int:
|
||||||
count = 0
|
count = 0
|
||||||
for package in self._metadata["materials_available"]:
|
for package in self._metadata["packages"]:
|
||||||
if package["author"]["author_id"] == author_id:
|
if package["package_type"] == "material":
|
||||||
count += 1
|
if package["author"]["author_id"] == author_id:
|
||||||
|
count += 1
|
||||||
return count
|
return count
|
||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue