-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Keroosha/web-scrobbler-metadata
feat: Add current track at store
- Loading branch information
Showing
8 changed files
with
87 additions
and
8 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { FC } from "react"; | ||
import { TrackInfo } from "webamp"; | ||
|
||
interface HiddenMetadataProps { | ||
track?: TrackInfo; | ||
} | ||
|
||
/*** | ||
* Metadata used in web-scrobbler plugin. | ||
* Web-scrobbler connectors use DOM elements to figure out what's playing now | ||
* @see https://github.com/web-scrobbler/web-scrobbler/wiki/Connectors-development | ||
*/ | ||
export const HiddenMetadata: FC<HiddenMetadataProps> = ({ track }) => ( | ||
<div id="winamp-meta" style={{ display: "none" }}> | ||
{track && ( | ||
<> | ||
<p id="winamp-meta-artist">{track.metaData.artist}</p> | ||
<p id="winamp-meta-title">{track.metaData.title}</p> | ||
<p id="winamp-meta-album">{track.metaData.album}</p> | ||
</> | ||
)} | ||
</div> | ||
); |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import { useSelector } from "react-redux"; | ||
import { AppState } from "../../reducers"; | ||
import { HiddenMetadata } from "./WinampHiddenMetadata"; | ||
|
||
export const MetaServices = () => { | ||
const trackInfo = useSelector((x: AppState) => x.webamp.currentTrack); | ||
return ( | ||
<> | ||
<HiddenMetadata track={trackInfo} /> | ||
</> | ||
); | ||
}; |
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
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
00bb0a2
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.
Successfully deployed to the following URLs: