Skip to content

Commit

Permalink
Add multiple track selection options #156
Browse files Browse the repository at this point in the history
  • Loading branch information
mgireesha committed Oct 18, 2024
1 parent 8208f0d commit bdfb431
Show file tree
Hide file tree
Showing 25 changed files with 118 additions and 41 deletions.
4 changes: 3 additions & 1 deletion src/g-player-react/src/Components/CommnPopup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { setCommonPopupObj } from "./redux/library/LibraryActions";
import { ALBUM, ARTIST, COMMON_POPUP_ERROR_MSG, COMPONENT, GENRE, INPUT, LANGUAGE, POPUP_PRIMARY_BTN, TEXT, TRACK } from "./redux/GPActionTypes";
import { ALBUM, ARTIST, COMMON_POPUP_ERROR_MSG, COMPONENT, GENRE, INPUT, LANGUAGE, MULTIPLE_TRACKS, POPUP_PRIMARY_BTN, TEXT, TRACK } from "./redux/GPActionTypes";
import { PLAYLIST_ADD_TO_PLAYLIST_SUCCESS, PLAYLIST_CREATE_PLAYLIST_SUCCESS, PLAYLIST_DELETE_PLAYLIST_SUCCESS } from "./redux/playlist/PlaylistActionTypes";
import { addToPlaylist, setAddedNewPlaylistObj } from "./redux/playlist/PlaylistActions";

Expand Down Expand Up @@ -55,6 +55,8 @@ export const CommonPopup = () => {
reqPLObj["genre"] = contextObj.obj;
}else if(contextObj.type === ARTIST){
reqPLObj["artist"] = contextObj.obj;
}else if(contextObj.type === MULTIPLE_TRACKS){
reqPLObj["songsIds"] = contextObj.obj?.join(",");
}
dispatch(addToPlaylist(reqPLObj));
}
Expand Down
14 changes: 10 additions & 4 deletions src/g-player-react/src/Components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Player } from "./player/Player";
import { Sidebar } from "./Sidebar";
import { Screen } from "./screen/Screen";
import { useDispatch, useSelector } from "react-redux";
import { fetchAlbumTacks, fetchAllAlbums, fetchAllHistory, fetchAllSongs, fetchSongsByArtist, fetchSongsByGenre, fetchSongsByLanguage } from "./redux/library/LibraryActions";
import { fetchAlbumTacks, fetchAllHistory, fetchAllSongs, fetchSongsByArtist, fetchSongsByGenre, fetchSongsByLanguage, setCheckedTrack, setCheckedTracks, setShowTrackCheckBox } from "./redux/library/LibraryActions";
import { fetchCurrentSontAndStatus, playASongSucc, setIsShuffle, setMediaVolumeSucc, setRepeat } from "./redux/player/PlayerActions";
import { getCookieDetails, getCookieValue, setCookies } from "./utilities/util";
import { ALBUM, ARTIST, GENRE, LANGUAGE, MAIN_CONTAINER, PLAYLIST, RECENT_PLAYS, TRACK_LIST } from "./redux/GPActionTypes";
import { Route, Routes } from "react-router-dom";
import { getCookieDetails, setCookies } from "./utilities/util";
import { ALBUM, ARTIST, GENRE, LANGUAGE, MAIN_CONTAINER, PLAYLIST, RECENT_PLAYS, REMOVE_ALL, TRACK_LIST } from "./redux/GPActionTypes";
import { Route, Routes, useLocation } from "react-router-dom";
import { Library } from "./library/LibraryV2";
import { Search } from "./search/Search";
import { RecentPlays } from "./history/RecentPlays";
Expand All @@ -23,6 +23,7 @@ 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 @@ -82,7 +83,12 @@ export const Home = () => {
}
}

const locationL = useLocation();

useEffect(()=>{
dispatch(setCheckedTracks(undefined, REMOVE_ALL));
dispatch(setShowTrackCheckBox(true));
},[locationL])

return(
<div className="main-container" id={MAIN_CONTAINER}>
Expand Down
1 change: 0 additions & 1 deletion src/g-player-react/src/Components/library/BuildLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const BuildLibrary = () => {
"value": RUNNING,
"type": BUILD_STATUS
});
console.log("tempBuildStatus: ",tempBuildStatus)
dispatch(fetchBuildStatusSucc(tempBuildStatus));
setCookies(LIBRARY_BUILD, INITIATED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export const BuildLibraryPopup = () => {
const [isBuildCompleted, setIsBuildCompleted] = useState(false);
const [isBuildInit, setIsBuildInit] = useState(false);

console.log("isBuildRunning:", isBuildRunning)

useEffect(()=>{
if(buildStatusList.length > 0){
const buildStatus = [...buildStatusList].find(bs=>bs.name===BUILD_STATUS);
Expand All @@ -26,7 +24,6 @@ export const BuildLibraryPopup = () => {
setIsBuildInit(buildStatus.value === INIT ? true : false);
}
}
console.log("buildStatusList: ",buildStatusList)
},[buildStatusList])

useEffect(()=>{
Expand Down
5 changes: 5 additions & 0 deletions src/g-player-react/src/Components/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ body{
.FaPauseCircle{
font-size: 1.5em;
}

.song-is-playing{
animation: rotate 2s normal linear infinite;
}


}
Expand Down Expand Up @@ -3820,6 +3824,7 @@ a.disabled-click{
svg{
font-size: 1em;
}

}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/g-player-react/src/Components/player/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ export const Player = () => {
</div>
<div className="play">
<div className="play-button" onClick={playPauseFunc}>
{!isPlayingL && <FaPlay className="faplay" />}
{isPlayingL && <FaPauseCircle className="FaPauseCircle" />}
{!isPlayingL && <FaPlay className="faplay"/>}
{isPlayingL && <FaPauseCircle className="FaPauseCircle song-is-playing" />}
</div>
</div>
<div className="next">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ export const ImportExportPlaylistPopupBtns = () => {
setSelectedFiles(tempSelectedFiles);
}else if(fileType === '.gp'){
tempSelectedFiles = getGPPLPayload(tempSelectedFiles);
console.log("65 tempSelectedFiles: ",tempSelectedFiles)
}

console.log("tempSelectedFiles",tempSelectedFiles)
/*console.log("tempSelectedFiles",tempSelectedFiles);
const tempCommonPopupObj = {...commonPopupObj};
tempCommonPopupObj.payload = tempSelectedFiles;
Expand Down Expand Up @@ -101,7 +99,6 @@ export const ImportExportPlaylistPopupBtns = () => {
}

const submitImportPlaylists = async () => {
//console.log("selectedFiles",{...selectedFiles});
let fileInput = document.getElementById(CSV_IMPORT_INPUT);
const importInpIds = [CSV_IMPORT_INPUT, GP_IMPORT_INPUT];
for(let i=0; i<importInpIds.length;i++){
Expand Down
1 change: 0 additions & 1 deletion src/g-player-react/src/Components/playlist/PlaylistPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const PlaylistPage = () => {
const tracks = document.getElementById(TRACK_LIST);
if(tracks && tracks.childElementCount > 0){
if(isShuffle && playlistSongs && playlistSongs.length > 0){
console.log(Math.floor(Math.random() * playlistSongs.length)-1)
tracks.getElementsByClassName("track")[Math.floor(Math.random() * playlistSongs.length)-1].getElementsByClassName("title")[0].click()
}else{
tracks.getElementsByClassName("track")[0].getElementsByClassName("title")[0].click();
Expand Down
1 change: 0 additions & 1 deletion src/g-player-react/src/Components/playlist/Playlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { getShowDeletePlaylistPopup } from "./PlalistUtil";
export const Playlists = () => {
const dispatch = useDispatch();
const playlists = useSelector(state => state.playlist.playlists);
console.log(playlists)
const playlistAlbums = useSelector(state => state.playlist.playlistAlbums);
const playlistSongsCount = useSelector(state => state.playlist.playlistSongsCount);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { ADD_TO_NEW_PLAYLIST_LABEL, ALBUM, ARTIST, CREATE, CREATE_LABEL, GENRE, GP_CONTEXT_MENU, INPUT, LANGUAGE, MAIN_CONTAINER, NEW_PLAYLIST_BTN_LABEL, PLAYLIST_NAME, PLAYLIST_SELECTOR, TRACK } from "../redux/GPActionTypes";
import { ADD_TO_NEW_PLAYLIST_LABEL, ALBUM, ARTIST, CREATE, CREATE_LABEL, GENRE, GP_CONTEXT_MENU, INPUT, LANGUAGE, MAIN_CONTAINER, MULTIPLE_TRACKS, NEW_PLAYLIST_BTN_LABEL, PLAYLIST_NAME, PLAYLIST_SELECTOR, TRACK } from "../redux/GPActionTypes";
import { addToPlaylist, createPlaylist, fetchAssignedPlaylists, fetchAssignedPlaylistsSucc, removeFromPlaylist } from "../redux/playlist/PlaylistActions";
import { PLAYLIST_ADD_TO_PLAYLIST_FAIL, PLAYLIST_ADD_TO_PLAYLIST_SUCCESS } from "../redux/playlist/PlaylistActionTypes";
import { setCommonPopupObj, setShowContextMenu, setShowPlaylistSelector } from "../redux/library/LibraryActions";
Expand All @@ -25,7 +25,6 @@ export const PlaylistSelector = () => {
if(contextObj.type === TRACK){
dispatch(fetchAssignedPlaylists(contextObj.type, contextObj.obj.songId));
}else if(contextObj.type === ALBUM){
// console.log(contextObj)
dispatch(fetchAssignedPlaylistsSucc([]));
}
setobj(contextObj.obj);
Expand Down Expand Up @@ -79,6 +78,8 @@ export const PlaylistSelector = () => {
reqPLObj["genre"] = contextObj.obj;
}else if(contextObj.type === ARTIST){
reqPLObj["artist"] = contextObj.obj;
}else if(contextObj.type === MULTIPLE_TRACKS){
reqPLObj["songsIds"] = contextObj.obj?.join(",");
}
dispatch(addToPlaylist(reqPLObj));
}
Expand Down
4 changes: 4 additions & 0 deletions src/g-player-react/src/Components/redux/GPActionTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const MULTI_GENRE = 'MULTI_GENRE';
export const MULTI_LINGUAL = 'MULTI_LINGUAL';
export const MULTI_LINGUAL_LABEL = 'Multi lingual';
export const MONO_LINGUAL = 'MONO_LINGUAL';
export const MULTIPLE_TRACKS = 'MULTIPLE_TRACKS';
export const MUSIC = 'MUSIC';
export const MUSIC_LABEL = 'Music';
export const MUSIC_PATH = 'MUSIC_PATH';
Expand Down Expand Up @@ -122,6 +123,7 @@ export const RECENT_PLAYS = 'RECENT_PLAYS';
export const RECENT_PLAYS_LABEL = 'Recent Plays';
export const RECENTLY_PLAYED_LABEL = 'Recently Played';
export const REMOVE = "REMOVE";
export const REMOVE_ALL = "REMOVE_ALL";
export const REMOVE_LABEL = "Remove";
export const RENAME = "RENAME";
export const RENAME_LABEL = "Rename";
Expand All @@ -134,6 +136,8 @@ export const RUNNING = 'RUNNING';

export const SAVE_LABEL = 'Save';
export const SEARCH_RESULTS_LABEL = 'Search Results';
export const SELECT_TRACKS_LABEL = 'Select tracks';
export const UNSELECT_TRACKS_LABEL = 'Unselect tracks';
export const SHOW_ASSIGNED_PLAYLISTS = 'SHOW_ASSIGNED_PLAYLISTS';
export const SOME_PAGE = 'SOME_PAGE';
export const SORT_A_TO_Z = 'SORT_A_TO_Z';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,6 @@ export const SET_PLAYER_TRACKS = 'SET_PLAYER_TRACKS';
export const SET_PLAYLIST_SONGS = 'SET_PLAYLIST_SONGS';
export const SET_METADATA_POPUP_OBJ = 'SET_METADATA_POPUP_OBJ';
export const SET_ARTIST_IMGAE_DOWNLOAD_SUMMARY = 'SET_ARTIST_IMGAE_DOWNLOAD_SUMMARY';
export const SET_GLOBAL_FILTER_TEXT = 'SET_GLOBAL_FILTER_TEXT';
export const SET_GLOBAL_FILTER_TEXT = 'SET_GLOBAL_FILTER_TEXT';
export const SET_SHOW_TRACK_CHECKBOX = 'SET_SHOW_TRACK_CHECKBOX';
export const SET_CHECKED_TRACK = 'SET_CHECKED_TRACK';
25 changes: 23 additions & 2 deletions src/g-player-react/src/Components/redux/library/LibraryActions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SUCCESS } from "../GPActionTypes";
import { ADD, REMOVE, REMOVE_ALL, SUCCESS } from "../GPActionTypes";
import { FETCH_SONGS_START, FETCH_SONGS_SUCCESS,
HISTORY_FETCH_ALL_HISTORY_START, HISTORY_FETCH_ALL_HISTORY_SUCCESS,
HISTORY_UPDATE_HISTORY_START, HISTORY_UPDATE_HISTORY_SUCCESS,
Expand Down Expand Up @@ -38,9 +38,10 @@ import { FETCH_SONGS_START, FETCH_SONGS_SUCCESS,
MESSAGE_FETCH_BY_TYPE_START,
MESSAGE_FETCH_BY_TYPE_SUCCESS,
SET_ARTIST_IMGAE_DOWNLOAD_SUMMARY,
SET_CHECKED_TRACK,
SET_COMMON_POPUP_OBJ, SET_CONTEXT_OBJECT, SET_CURRENT_PAGE, SET_GLOBAL_FILTER_TEXT, SET_IS_CLICKED_ON_CONTEXT_MENU,
SET_METADATA_POPUP_OBJ,
SET_PLAYER_TRACKS, SET_PLAYLIST_SONGS, SET_SHOW_CONTEXT_MENU, SET_SHOW_METADATA_POPUP, SET_SHOW_PLAY_LIST_SELECTOR, SET_STATUS_MESSAGE
SET_PLAYER_TRACKS, SET_PLAYLIST_SONGS, SET_SHOW_CONTEXT_MENU, SET_SHOW_METADATA_POPUP, SET_SHOW_PLAY_LIST_SELECTOR, SET_SHOW_TRACK_CHECKBOX, SET_STATUS_MESSAGE
} from "./LibraryActionTypes";

export const fetchAllSongs = (isSetPlayerTracks) => ({
Expand Down Expand Up @@ -420,6 +421,17 @@ export const setGlobalFilterText = (globalFilterText) => ({
globalFilterText
})

export const setShowTrackCheckBox = (showTrackCheckBox) => ({
type: SET_SHOW_TRACK_CHECKBOX,
showTrackCheckBox:!showTrackCheckBox
})

export const setCheckedTracks = (songId, action) => ({
type: SET_CHECKED_TRACK,
songId,
action
})

export const filterMusicPath = (response, musicPath,musicPaths) => {
if(response.status===SUCCESS){
musicPaths = musicPaths.filter(mPath => {return mPath.messageId!==musicPath.messageId});
Expand Down Expand Up @@ -464,4 +476,13 @@ export const updateTracksPostEditTrack = (state, track, field) => {
}
});
return tracks;
}

export const getCheckedTracks = (checkedTracks, songId, action) => {
if(action===ADD)
return [...checkedTracks, songId]
else if(action===REMOVE)
return checkedTracks.filter(ct=>ct!==songId);
else if(action===REMOVE_ALL)return []
else return checkedTracks;
}
16 changes: 14 additions & 2 deletions src/g-player-react/src/Components/redux/library/LibraryReducer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { INIT, LOADING, SUCCESS, TRACK_LIST } from "../GPActionTypes";
import { filterMusicPath, getPlayerTracks, updateArtistsDetails, updateTracksPostEditTrack } from "./LibraryActions";
import { FETCH_SONGS_START, FETCH_SONGS_SUCCESS, HISTORY_FETCH_ALL_HISTORY_START, HISTORY_FETCH_ALL_HISTORY_SUCCESS, LIBRARY_DELETE_MUSIC_PATH_START, LIBRARY_DELETE_MUSIC_PATH_SUCCESS, LIBRARY_EDIT_ALBUM_INFO_START, LIBRARY_EDIT_ALBUM_INFO_SUCCESS, LIBRARY_EDIT_TRACK_INFO_START, LIBRARY_EDIT_TRACK_INFO_SUCCESS, LIBRARY_FETCH_ALBUMS_BY_GENRE_START, LIBRARY_FETCH_ALBUMS_BY_GENRE_SUCCESS, LIBRARY_FETCH_ALBUMS_DETAILS_START, LIBRARY_FETCH_ALBUMS_DETAILS_SUCCESS, LIBRARY_FETCH_ALBUMS_START, LIBRARY_FETCH_ALBUMS_SUCCESS, LIBRARY_FETCH_ALBUM_ARTIST_LIST_START, LIBRARY_FETCH_ALBUM_ARTIST_LIST_SUCCESS, LIBRARY_FETCH_ALBUM_DETAILS_BY_ALBUM_ARTIST_START, LIBRARY_FETCH_ALBUM_DETAILS_BY_ALBUM_ARTIST_SUCCESS, LIBRARY_FETCH_ALBUM_IMGS_START, LIBRARY_FETCH_ALBUM_IMGS_SUCCESS, LIBRARY_FETCH_ALBUM_LIST_OF_AA_START, LIBRARY_FETCH_ALBUM_LIST_OF_AA_SUCCESS, LIBRARY_FETCH_ALBUM_START, LIBRARY_FETCH_ALBUM_SUCCESS, LIBRARY_FETCH_ALBUM_TRACKS_START, LIBRARY_FETCH_ALBUM_TRACKS_SUCCESS, LIBRARY_FETCH_ARTIST_LIST_START, LIBRARY_FETCH_ARTIST_LIST_SUCCESS, LIBRARY_FETCH_BUILD_STATUS_START, LIBRARY_FETCH_BUILD_STATUS_SUCCESS, LIBRARY_FETCH_GENRE_DETAILS_START, LIBRARY_FETCH_GENRE_DETAILS_SUCCESS, LIBRARY_FETCH_LANGUAGE_DETAILS_START, LIBRARY_FETCH_LANGUAGE_DETAILS_SUCCESS, LIBRARY_FETCH_MOST_PLAYED_DATA_START, LIBRARY_FETCH_MOST_PLAYED_DATA_SUCCESS, LIBRARY_FETCH_MUSIC_PATH_START, LIBRARY_FETCH_MUSIC_PATH_SUCCESS, LIBRARY_FETCH_SONGS_BY_ARTIST_START, LIBRARY_FETCH_SONGS_BY_ARTIST_SUCCESS, LIBRARY_FETCH_SONGS_BY_GENRE_START, LIBRARY_FETCH_SONGS_BY_GENRE_SUCCESS, LIBRARY_FETCH_SONGS_BY_LANGUAGE_START, LIBRARY_FETCH_SONGS_BY_LANGUAGE_SUCCESS, LIBRARY_INIT_BUILD_DELTA_LIBRARY_START, LIBRARY_INIT_BUILD_DELTA_LIBRARY_SUCESS, LIBRARY_INIT_BUILD_LIBRARY_START, LIBRARY_INIT_BUILD_LIBRARY_SUCESS, LIBRARY_SAVE_MUSIC_PATH_START, LIBRARY_SAVE_MUSIC_PATH_SUCCESS, LIBRARY_SEARCH_BY_KEY_START, LIBRARY_SEARCH_BY_KEY_SUCCESS, LIBRARY_UPLOAD_ARTIST_IMG_START, LIBRARY_UPLOAD_ARTIST_IMG_SUCCESS, SET_ARTIST_IMGAE_DOWNLOAD_SUMMARY, SET_COMMON_POPUP_OBJ, SET_CONTEXT_OBJECT, SET_CURRENT_PAGE, SET_GLOBAL_FILTER_TEXT, SET_GROUP_BAND, SET_IS_CLICKED_ON_CONTEXT_MENU, SET_METADATA_POPUP_OBJ, SET_PLAYER_TRACKS, SET_PLAYLIST_SONGS, SET_SHOW_COMMON_POPUP, SET_SHOW_CONTEXT_MENU, SET_SHOW_METADATA_POPUP, SET_SHOW_PLAY_LIST_SELECTOR, SET_STATUS_MESSAGE } from "./LibraryActionTypes";
import { filterMusicPath, getCheckedTracks, getPlayerTracks, updateArtistsDetails, updateTracksPostEditTrack } from "./LibraryActions";
import { FETCH_SONGS_START, FETCH_SONGS_SUCCESS, HISTORY_FETCH_ALL_HISTORY_START, HISTORY_FETCH_ALL_HISTORY_SUCCESS, LIBRARY_DELETE_MUSIC_PATH_START, LIBRARY_DELETE_MUSIC_PATH_SUCCESS, LIBRARY_EDIT_ALBUM_INFO_START, LIBRARY_EDIT_ALBUM_INFO_SUCCESS, LIBRARY_EDIT_TRACK_INFO_START, LIBRARY_EDIT_TRACK_INFO_SUCCESS, LIBRARY_FETCH_ALBUMS_BY_GENRE_START, LIBRARY_FETCH_ALBUMS_BY_GENRE_SUCCESS, LIBRARY_FETCH_ALBUMS_DETAILS_START, LIBRARY_FETCH_ALBUMS_DETAILS_SUCCESS, LIBRARY_FETCH_ALBUMS_START, LIBRARY_FETCH_ALBUMS_SUCCESS, LIBRARY_FETCH_ALBUM_ARTIST_LIST_START, LIBRARY_FETCH_ALBUM_ARTIST_LIST_SUCCESS, LIBRARY_FETCH_ALBUM_DETAILS_BY_ALBUM_ARTIST_START, LIBRARY_FETCH_ALBUM_DETAILS_BY_ALBUM_ARTIST_SUCCESS, LIBRARY_FETCH_ALBUM_IMGS_START, LIBRARY_FETCH_ALBUM_IMGS_SUCCESS, LIBRARY_FETCH_ALBUM_LIST_OF_AA_START, LIBRARY_FETCH_ALBUM_LIST_OF_AA_SUCCESS, LIBRARY_FETCH_ALBUM_START, LIBRARY_FETCH_ALBUM_SUCCESS, LIBRARY_FETCH_ALBUM_TRACKS_START, LIBRARY_FETCH_ALBUM_TRACKS_SUCCESS, LIBRARY_FETCH_ARTIST_LIST_START, LIBRARY_FETCH_ARTIST_LIST_SUCCESS, LIBRARY_FETCH_BUILD_STATUS_START, LIBRARY_FETCH_BUILD_STATUS_SUCCESS, LIBRARY_FETCH_GENRE_DETAILS_START, LIBRARY_FETCH_GENRE_DETAILS_SUCCESS, LIBRARY_FETCH_LANGUAGE_DETAILS_START, LIBRARY_FETCH_LANGUAGE_DETAILS_SUCCESS, LIBRARY_FETCH_MOST_PLAYED_DATA_START, LIBRARY_FETCH_MOST_PLAYED_DATA_SUCCESS, LIBRARY_FETCH_MUSIC_PATH_START, LIBRARY_FETCH_MUSIC_PATH_SUCCESS, LIBRARY_FETCH_SONGS_BY_ARTIST_START, LIBRARY_FETCH_SONGS_BY_ARTIST_SUCCESS, LIBRARY_FETCH_SONGS_BY_GENRE_START, LIBRARY_FETCH_SONGS_BY_GENRE_SUCCESS, LIBRARY_FETCH_SONGS_BY_LANGUAGE_START, LIBRARY_FETCH_SONGS_BY_LANGUAGE_SUCCESS, LIBRARY_INIT_BUILD_DELTA_LIBRARY_START, LIBRARY_INIT_BUILD_DELTA_LIBRARY_SUCESS, LIBRARY_INIT_BUILD_LIBRARY_START, LIBRARY_INIT_BUILD_LIBRARY_SUCESS, LIBRARY_SAVE_MUSIC_PATH_START, LIBRARY_SAVE_MUSIC_PATH_SUCCESS, LIBRARY_SEARCH_BY_KEY_START, LIBRARY_SEARCH_BY_KEY_SUCCESS, LIBRARY_UPLOAD_ARTIST_IMG_START, LIBRARY_UPLOAD_ARTIST_IMG_SUCCESS, SET_ARTIST_IMGAE_DOWNLOAD_SUMMARY, SET_CHECKED_TRACK, SET_COMMON_POPUP_OBJ, SET_CONTEXT_OBJECT, SET_CURRENT_PAGE, SET_GLOBAL_FILTER_TEXT, SET_GROUP_BAND, SET_IS_CLICKED_ON_CONTEXT_MENU, SET_METADATA_POPUP_OBJ, SET_PLAYER_TRACKS, SET_PLAYLIST_SONGS, SET_SHOW_COMMON_POPUP, SET_SHOW_CONTEXT_MENU, SET_SHOW_METADATA_POPUP, SET_SHOW_PLAY_LIST_SELECTOR, SET_SHOW_TRACK_CHECKBOX, SET_STATUS_MESSAGE } from "./LibraryActionTypes";

export const initialState = {
tracks:[],
Expand Down Expand Up @@ -37,6 +37,8 @@ export const initialState = {
metadataPopupObj: {},
artistImageDownloadSummary:[],
globalFilterText:"",
showTrackCheckBox:false,
checkedTracks:[],
phase:INIT
}

Expand Down Expand Up @@ -413,6 +415,16 @@ const libraryReducer = (state = initialState, action) => {
...state,
globalFilterText: action.globalFilterText
}
case SET_SHOW_TRACK_CHECKBOX:
return{
...state,
showTrackCheckBox: action.showTrackCheckBox
}
case SET_CHECKED_TRACK:
return{
...state,
checkedTracks:getCheckedTracks([...state.checkedTracks],action.songId, action.action)
}
default:
return {
...state,
Expand Down
4 changes: 2 additions & 2 deletions src/g-player-react/src/Components/screen/GPContextMenu.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { setCommonPopupObj, setShowContextMenu, setShowPlaylistSelector } from "../redux/library/LibraryActions";
import { ADD_TOPLAYLIST_LABEL, ADD_TO_NEW_PLAYLIST_LABEL, ALBUM, ARTIST, COMPONENT, GP_CONTEXT_MENU, GP_CONTEXT_MENU_ELEM_IDS, MAIN_CONTAINER, TRACK } from "../redux/GPActionTypes";
import { ADD_TOPLAYLIST_LABEL, ALBUM, ARTIST, COMPONENT, GP_CONTEXT_MENU, GP_CONTEXT_MENU_ELEM_IDS, MAIN_CONTAINER, MULTIPLE_TRACKS, TRACK } from "../redux/GPActionTypes";
import { MdKeyboardArrowRight } from 'react-icons/md';
import { Link } from "react-router-dom";
import { checkIfActionAllowed } from "../utilities/util";
Expand Down Expand Up @@ -79,7 +79,7 @@ export const GPContexMenu = () => {
},[]);

const onSetShowPlaylistSelector = (showPlaylistSelector) => {
if(contextObj.type===TRACK){
if(contextObj.type===TRACK || contextObj.type===MULTIPLE_TRACKS){
const commonPopupObj = {
showPopup: true,
title: ADD_TOPLAYLIST_LABEL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const GenrePage = () => {
setGenreAlbums(genreDetails.ALBUMS_BY_GENRE);
}
}
//console.log("genreDetails",genreDetails)
},[genreDetails]);

useEffect(()=>{
Expand Down
Loading

0 comments on commit bdfb431

Please sign in to comment.