Skip to content

Commit

Permalink
Show added to playlists on hover of track
Browse files Browse the repository at this point in the history
  • Loading branch information
mgireesha committed Oct 6, 2024
1 parent 6f1c289 commit ba69f29
Show file tree
Hide file tree
Showing 13 changed files with 283 additions and 76 deletions.
6 changes: 0 additions & 6 deletions package-lock.json

This file was deleted.

146 changes: 140 additions & 6 deletions src/g-player-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/g-player-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"axios": "^1.2.1",
"rc-slider": "^10.1.0",
"react": "^18.2.0",
"react-cookie": "^7.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.12.0",
"react-redux": "^8.0.5",
"react-router-dom": "^6.5.0",
"react-scripts": "5.0.1",
"react-tooltip": "^5.28.0",
"react-viewport-list": "^7.1.1",
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
Expand Down
7 changes: 5 additions & 2 deletions src/g-player-react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Provider } from 'react-redux';
import store from './Components/redux/store';
import { AppHeader } from './Components/AppHeading';
import { HashRouter as Router } from 'react-router-dom';
import { CookiesProvider } from 'react-cookie';

function App() {
// useEffect(()=>{
Expand All @@ -20,12 +21,14 @@ function App() {
// },[])
return (
<div className="App app-container">
<Provider store={store}>
<Provider store={store}>
<CookiesProvider>
<AppHeader />
<Router>
<Home />
</Router>
</Provider>
</CookiesProvider>
</Provider>
</div>
);
}
Expand Down
53 changes: 24 additions & 29 deletions src/g-player-react/src/Components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import { CommonPopup } from "./CommnPopup";
import { GPContexMenu } from "./screen/GPContextMenu";
import { StatusMessage } from "./screen/StatusMessage";
import { MetadataPopup } from "./screen/metadata/MetadataPopup";
import { useCookies } from "react-cookie";

export const Home = () => {
const dispatch = useDispatch();
const [cookies] = useCookies();
const showContextMenu = useSelector(state => state.library.showContextMenu);
const showPlaylistSelector = useSelector(state => state.library.showPlaylistSelector);
const showMetadataPopup = useSelector(state => state.library.metadataPopupObj.showMetadataPopup);
Expand Down Expand Up @@ -54,36 +56,29 @@ export const Home = () => {
}

const fetchTracks = () => {
let playedFromCookieValue = getCookieValue("playedFrom");
if(playedFromCookieValue){
playedFromCookieValue = JSON.parse(playedFromCookieValue);
if(playedFromCookieValue.pfKey!==undefined){
switch (playedFromCookieValue.pfKey) {
case ALBUM:
dispatch(fetchAlbumTacks(playedFromCookieValue.pfVal, undefined, true)); // sending true will set tracks to playertracks
break;
case ARTIST:
dispatch(fetchSongsByArtist(playedFromCookieValue.pfVal,true));
break;
case RECENT_PLAYS:
dispatch(fetchAllHistory(true));
break;
case PLAYLIST:
dispatch(fetchSongsInPlaylist(playedFromCookieValue.pfVal,true));
break;
case GENRE:
dispatch(fetchSongsByGenre(playedFromCookieValue.pfVal,true));
break;
case LANGUAGE:
dispatch(fetchSongsByLanguage(playedFromCookieValue.pfVal,true));
break;
default:
dispatch(fetchAllSongs(true));
break;
}
}else{
let playedFrom = cookies.playedFrom;
switch (playedFrom?.pfKey) {
case ALBUM:
dispatch(fetchAlbumTacks(playedFrom.pfVal, undefined, true)); // sending true will set tracks to playertracks
break;
case ARTIST:
dispatch(fetchSongsByArtist(playedFrom.pfVal,true));
break;
case RECENT_PLAYS:
dispatch(fetchAllHistory(true));
break;
case PLAYLIST:
dispatch(fetchSongsInPlaylist(playedFrom.pfVal,true));
break;
case GENRE:
dispatch(fetchSongsByGenre(playedFrom.pfVal,true));
break;
case LANGUAGE:
dispatch(fetchSongsByLanguage(playedFrom.pfVal,true));
break;
default:
dispatch(fetchAllSongs(true));
}
break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/g-player-react/src/Components/library/LibraryV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { setCookies } from "../utilities/util";
import { ArtistImageDownload } from "./ArtistImageDownload";
import { MusicLibraryPath } from "./MusicLibraryPath";
import { BuildLibrary } from "./BuildLibrary";
import { ShowAssignedPlaylists } from "./ShowAssignedPlaylists";

export const Library = () => {

Expand All @@ -29,6 +30,7 @@ export const Library = () => {
<BuildLibrary />
<MusicLibraryPath />
<ArtistImageDownload />
<ShowAssignedPlaylists />
</div>
</div>
);
Expand Down
Loading

0 comments on commit ba69f29

Please sign in to comment.