Skip to content

Commit

Permalink
Merge pull request #199 from ECN/bugfix-queue-selector-displays-wrong…
Browse files Browse the repository at this point in the history
…-numbers

Fix incorrect item count when getting queue counts
  • Loading branch information
campb303 authored Mar 15, 2021
2 parents dfbc048 + 5e8f703 commit 66b4234
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def getQueueCounts() -> list:
queueInfo = []
for queue in getValidQueues():
possibleItems = os.listdir(queueDirectory + "/" + queue)
validItems = [isValidItemName for file in possibleItems]
validItems = [file for file in possibleItems if isValidItemName(file)]
queueInfo.append( {"name": queue, "number_of_items": len(validItems)} )

# Sorts list of queue info alphabetically
Expand Down Expand Up @@ -1384,4 +1384,9 @@ def loadAllQueues(headersOnly: bool = True) -> list:
for queue in getValidQueues():
queues.append(Queue(queue, headersOnly=headersOnly))

return queues
return queues

if __name__ == "__main__":
abe = Queue("abe")
abeCount = getQueueCounts()
print()

0 comments on commit 66b4234

Please sign in to comment.