mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:09:02 +08:00
Count only the material packages by author, not all packages.
Contributes to CURA-5670.
This commit is contained in:
parent
bf1d3b964f
commit
b638b2274a
@ -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…
x
Reference in New Issue
Block a user