Skip to content

Commit

Permalink
Optimize catalog generation and improve stability
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Feb 23, 2025
1 parent 3b1a574 commit 0f16063
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spkrepo/views/nas.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def get_catalog(arch, build, major, language, beta):

# Step 4: Construct response with "packages"
packages = []
for b in latest_build.all():
packages.append(build_package_entry(b, language))
for b in latest_build:
packages.append(build_package_entry(b, language, arch, build))

# DSM 5.1
if build >= 5004:
Expand All @@ -152,7 +152,7 @@ def get_catalog(arch, build, major, language, beta):
return packages


def build_package_entry(b, language):
def build_package_entry(b, language, arch, build):
entry = {
"package": b.version.package.name,
"version": b.version.version_string,
Expand All @@ -165,8 +165,8 @@ def build_package_entry(b, language):
"link": url_for(
".data",
path=b.path,
arch=b.architectures[0].code,
build=b.firmware.build,
arch=arch,
build=build,
_external=True,
),
"thumbnail": [
Expand Down Expand Up @@ -247,7 +247,7 @@ def catalog():
if build < 40000:
beta = request.values.get("package_update_channel") == "beta"
else:
beta = False
beta = False # Ensure no beta packages are returned for DSM 7+
# Check if "major" is provided
if "major" in request.values:
try:
Expand Down

0 comments on commit 0f16063

Please sign in to comment.