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; + } +};