From f9fe0aec22958b5fef744b1bdeb7407f122d297c Mon Sep 17 00:00:00 2001 From: Koen De Jaeger Date: Wed, 21 May 2025 09:43:41 +0200 Subject: [PATCH] added 'no singles' as an option removed margin so the tabs fit on the screen --- src/content.js | 2 ++ src/filters/noSingles.js | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 src/filters/noSingles.js diff --git a/src/content.js b/src/content.js index ae83cd3..65dff92 100644 --- a/src/content.js +++ b/src/content.js @@ -39,6 +39,7 @@ class FilterMenu { for (const [i, filter] of filters.entries()) { const li = document.createElement("li"); li.className = "g-tabs-item"; + li.style.margin = "0"; const button = document.createElement("a"); button.className = activeFilterIndex === i ? "g-tabs-link active" : "g-tabs-link"; @@ -61,6 +62,7 @@ const FILTERS = [ new FeedFilter("No reposts", "noReposts"), new FeedFilter("Not following", "notFollowing"), new FeedFilter("Only singles", "onlySingles"), + new FeedFilter("No singles", "noSingles"), new FeedFilter("Deep cuts", "deepCuts"), ]; diff --git a/src/filters/noSingles.js b/src/filters/noSingles.js new file mode 100644 index 0000000..bcae879 --- /dev/null +++ b/src/filters/noSingles.js @@ -0,0 +1,7 @@ +window.activeSCFeedFilter = (data) => (item) => { + if ("track" in item) { + return item.track.full_duration / 1000 / 60 >= 30; + } else { + return false; + } +};