diff --git a/CHANGELOG.md b/CHANGELOG.md index 8157f43b..15bea411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A bug where instance testing is not immediately cancelled when the testing page is closed - A bug in the web app where "upcoming" videos show up as "live" +- Search sort filters ## [0.21.2] - 2024-03-10 diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs index 8a194ec1..d12a04d5 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs @@ -87,15 +87,15 @@ function Init() title: Tr(Locale.SearchFilters.Location) value: "location" }] - sort_by: [{ + sort: [{ title: Tr(Locale.SearchFilters.Relevance) value: "" }, { title: Tr(Locale.SearchFilters.UploadDate) - value: "upload_date" + value: "date" }, { title: Tr(Locale.SearchFilters.ViewCount) - value: "view_count" + value: "views" }, { title: Tr(Locale.SearchFilters.Rating) value: "rating" @@ -107,7 +107,7 @@ function Init() type: m.top.findNode("TypeList") duration: m.top.findNode("DurationList") features: m.top.findNode("FeaturesList") - sort_by: m.top.findNode("SortByList") + sort: m.top.findNode("SortList") } for each filterKey in m.controls @@ -120,12 +120,12 @@ function Init() type: m.controls.type.content duration: m.controls.duration.content features: m.controls.features.content - sort_by: m.controls.sort_by.content + sort: m.controls.sort.content } PopulateLists(m.contentNodes, options) - navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort_by] + navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort] for i = 0 to navigationNodes.count() - 2 SetNavigation(navigationNodes[i], "right", navigationNodes[i + 1]) end for @@ -154,7 +154,7 @@ function OnNodeReady() m.controls.type.ObserveField("checkedItem", FuncName(OnListChecked)) m.controls.duration.ObserveField("checkedItem", FuncName(OnListChecked)) m.controls.features.ObserveField("checkedState", FuncName(OnListChecked)) - m.controls.sort_by.ObserveField("checkedItem", FuncName(OnListChecked)) + m.controls.sort.ObserveField("checkedItem", FuncName(OnListChecked)) end function function RefreshUI() diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml index 6a75ef72..45502bb0 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml @@ -108,7 +108,7 @@ width="180" height="1" /> 0 ? ` (${count})` : ""}`; } @@ -146,18 +146,18 @@ value: "location", }, ], - sort_by: [ + sort: [ { title: "Relevance", value: "", }, { title: "Upload date", - value: "upload_date", + value: "date", }, { title: "View count", - value: "view_count", + value: "views", }, { title: "Rating", @@ -223,11 +223,8 @@

{$tr("Sort by")}

- + {#each options.sort as { title, value }} {/each}