-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LB-1585: Add Syndication Feeds to ListenBrainz #2962
Open
ericd23
wants to merge
40
commits into
metabrainz:master
Choose a base branch
from
ericd23:syndication-feed
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
47753bc
implement playlist feed
ericd23 c737067
typos
ericd23 533ec5b
implement recommendation feed
ericd23 300c3ac
format and add template
ericd23 bcd811f
add test for playlist
ericd23 a5ea863
syndication feed modal component
ericd23 a95b521
add button to subscribe to listen feed
ericd23 2991df7
implement stats art feed
ericd23 ebea01f
add stat art template
ericd23 907a3fe
restyle feed modal
ericd23 19121f4
use feed icon and move it to the bottom
ericd23 81a1cea
feed modal supports numbers, default value and alternative displaying…
ericd23 7c7082f
add feed icon for user stats
ericd23 51346b9
add feed button for fresh releases
ericd23 715268a
fix freshreleases test
ericd23 316dd20
add feed button for stats art
ericd23 06c7330
add feed button for playlist
ericd23 c0d4420
add feed button for recommendation
ericd23 73653d1
use HTMLInputTypeAttribute
ericd23 1558e42
use global context to access current user
ericd23 9c16f77
restyle feed button
ericd23 28d8232
capitalize "Explore" in fresh_releases.html
ericd23 e30400c
add tooltip to explain feed options
ericd23 553a36f
feed for latest activity
ericd23 dd54ea9
feed button for latest activity
ericd23 e1894ce
use baseUrl to construct feed URLs
ericd23 873119c
add tool tips
ericd23 1d7753f
format
ericd23 60d4ea9
remove stale code
ericd23 b9bd566
no trailing ? for feed URL when there's no option
ericd23 d254ca6
load recordings in recommendation feed
ericd23 8ab64ac
commented out latest activity feed for now
ericd23 d49423f
Merge branch 'metabrainz:master' into syndication-feed
ericd23 928f641
rename time range option for stats
ericd23 b64aee6
unifying tooltime for minutes (time range) options
ericd23 e52686b
reposition feed button
ericd23 de9ad29
add lb suffix to playlist feed title
ericd23 e6fae66
avoid using events in title
ericd23 ceff7ac
Merge branch 'master' into syndication-feed
MonkeyDo 7ede901
Lint less file
MonkeyDo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,19 @@ import { toast } from "react-toastify"; | |
import { Helmet } from "react-helmet"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faRss, faSquareRss } from "@fortawesome/free-solid-svg-icons"; | ||
import NiceModal from "@ebay/nice-modal-react"; | ||
import GlobalAppContext from "../../utils/GlobalAppContext"; | ||
import { ToastMsg } from "../../notifications/Notifications"; | ||
import ReleaseFilters from "./components/ReleaseFilters"; | ||
import ReleaseTimeline from "./components/ReleaseTimeline"; | ||
import Pill from "../../components/Pill"; | ||
import ReleaseCardsGrid from "./components/ReleaseCardsGrid"; | ||
import { COLOR_LB_ORANGE } from "../../utils/constants"; | ||
import { useMediaQuery } from "./utils"; | ||
import SyndicationFeedModal from "../../components/SyndicationFeedModal"; | ||
import { getBaseUrl } from "../../utils/utils"; | ||
|
||
export enum DisplaySettingsPropertiesEnum { | ||
releaseTitle = "Release Title", | ||
|
@@ -370,6 +376,53 @@ export default function FreshReleases() { | |
))} | ||
</select> | ||
</div> | ||
<button | ||
type="button" | ||
className="btn btn-icon btn-info btn-sm" | ||
style={{ | ||
width: "24px", | ||
height: "24px", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}} | ||
data-toggle="modal" | ||
data-target="#SyndicationFeedModal" | ||
onClick={() => { | ||
if (pageType === PAGE_TYPE_SITEWIDE) { | ||
NiceModal.show(SyndicationFeedModal, { | ||
feedTitle: `Site-wide Fresh Releases`, | ||
options: [ | ||
{ | ||
label: "Days", | ||
key: "days", | ||
type: "number", | ||
values: [ | ||
{ id: "3", value: "3" }, | ||
{ id: "7", value: "7" }, | ||
{ id: "14", value: "14" }, | ||
{ id: "30", value: "30" }, | ||
], | ||
defaultIndex: 0, | ||
tooltip: | ||
"Select how many days of past releases to include in the feed, starting from today. Only releases that have already been published will be included.", | ||
}, | ||
], | ||
baseUrl: `${getBaseUrl()}/syndication-feed/fresh-releases`, | ||
}); | ||
} else if (pageType === PAGE_TYPE_USER) { | ||
NiceModal.show(SyndicationFeedModal, { | ||
feedTitle: `User-specific Fresh Releases`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be customized?
|
||
options: [], | ||
baseUrl: `${getBaseUrl()}/syndication-feed/user/${ | ||
currentUser.name | ||
}/fresh-releases`, | ||
}); | ||
} | ||
}} | ||
> | ||
<FontAwesomeIcon icon={faRss} size="xs" /> | ||
</button> | ||
</div> | ||
</div> | ||
{isLoading ? ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faSquareRss seems unused here