diff --git a/src/components/FeedPage.vue b/src/components/FeedPage.vue
index 8927a16c..06d5fa32 100644
--- a/src/components/FeedPage.vue
+++ b/src/components/FeedPage.vue
@@ -11,6 +11,13 @@
+
+
+
videos.sort(order)" />
@@ -18,7 +25,9 @@
-
+
+
+
@@ -37,6 +46,8 @@ export default {
videoStep: 100,
videosStore: [],
videos: [],
+ availableFilters: ["all", "shorts", "videos"],
+ selectedFilter: "all",
};
},
computed: {
@@ -51,6 +62,8 @@ export default {
this.loadMoreVideos();
this.updateWatched(this.videos);
});
+
+ this.selectedFilter = this.$route.query.filter ?? this.getPreferenceString("feedFilter") ?? "all";
},
activated() {
document.title = this.$t("titles.feed") + " - Piped";
@@ -85,6 +98,19 @@ export default {
this.loadMoreVideos();
}
},
+ shouldShowVideo(video) {
+ switch (this.selectedFilter) {
+ case "all":
+ return true;
+ case "videos":
+ return !video.isShort;
+ default:
+ return video.isShort;
+ }
+ },
+ onFilterChange() {
+ this.setPreference("feedFilter", this.selectedFilter);
+ },
},
};
diff --git a/src/locales/en.json b/src/locales/en.json
index 498199d6..1f9e94d4 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -152,7 +152,8 @@
"ratings_disabled": "Ratings Disabled",
"chapters": "Chapters",
"live": "{0} Live",
- "shorts": "Shorts"
+ "shorts": "Shorts",
+ "all": "All"
},
"search": {
"did_you_mean": "Did you mean: {0}?",