Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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"),
];

Expand Down
7 changes: 7 additions & 0 deletions src/filters/noSingles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
window.activeSCFeedFilter = (data) => (item) => {
if ("track" in item) {
return item.track.full_duration / 1000 / 60 >= 30;
} else {
return false;
}
};