Browse Source

rename songList settings

- songList -> musicList for consistency with api
- fix miniList settings
- fix font settings
master
jeffvli 3 years ago
parent
commit
544585063b
  1. 6
      src/components/library/AlbumView.tsx
  2. 2
      src/components/player/NowPlayingMiniView.tsx
  3. 8
      src/components/player/NowPlayingView.tsx
  4. 6
      src/components/playlist/PlaylistView.tsx
  5. 8
      src/components/settings/ConfigPanels/LookAndFeelConfig.tsx
  6. 16
      src/components/shared/setDefaultSettings.ts
  7. 6
      src/components/starred/StarredView.tsx
  8. 16
      src/components/viewtypes/ListViewTable.tsx
  9. 6
      src/components/viewtypes/ListViewType.tsx

6
src/components/library/AlbumView.tsx

@ -201,13 +201,13 @@ const AlbumView = ({ ...rest }: any) => {
>
<ListViewType
data={searchQuery !== '' ? filteredData : data.song}
tableColumns={settings.getSync('songListColumns')}
tableColumns={settings.getSync('musicListColumns')}
handleRowClick={handleRowClick}
handleRowDoubleClick={handleRowDoubleClick}
tableHeight={700}
virtualized
rowHeight={Number(settings.getSync('songListRowHeight'))}
fontSize={Number(settings.getSync('songListFontSize'))}
rowHeight={Number(settings.getSync('musicListRowHeight'))}
fontSize={Number(settings.getSync('musicListFontSize'))}
cacheImages={{
enabled: settings.getSync('cacheImages'),
cacheType: 'album',

2
src/components/player/NowPlayingMiniView.tsx

@ -234,8 +234,8 @@ const NowPlayingMiniView = () => {
cacheIdProperty: 'albumId',
}}
listType="music"
nowPlaying
miniView
nowPlaying
dnd
/>
</GenericPage>

8
src/components/player/NowPlayingView.tsx

@ -47,7 +47,7 @@ const NowPlayingView = () => {
useEffect(() => {
if (playQueue.scrollWithCurrentSong) {
setTimeout(() => {
const rowHeight = Number(settings.getSync('songListRowHeight'));
const rowHeight = Number(settings.getSync('musicListRowHeight'));
tableRef?.current.table.current?.scrollTop(
rowHeight * playQueue.currentIndex - rowHeight * 2 > 0
? rowHeight * playQueue.currentIndex - rowHeight * 2
@ -214,15 +214,15 @@ const NowPlayingView = () => {
: playQueue.entry
}
currentIndex={playQueue.currentIndex}
tableColumns={settings.getSync('songListColumns')}
tableColumns={settings.getSync('musicListColumns')}
handleRowClick={handleRowClick}
handleRowDoubleClick={handleRowDoubleClick}
handleUpClick={handleUpClick}
handleDownClick={handleDownClick}
handleDragEnd={handleDragEnd}
virtualized
rowHeight={Number(settings.getSync('songListRowHeight'))}
fontSize={Number(settings.getSync('songListFontSize'))}
rowHeight={Number(settings.getSync('musicListRowHeight'))}
fontSize={Number(settings.getSync('musicListFontSize'))}
cacheImages={{
enabled: settings.getSync('cacheImages'),
cacheType: 'album',

6
src/components/playlist/PlaylistView.tsx

@ -275,13 +275,13 @@ const PlaylistView = ({ ...rest }) => {
>
<ListViewType
data={searchQuery !== '' ? filteredData : localPlaylistData}
tableColumns={settings.getSync('songListColumns')}
tableColumns={settings.getSync('musicListColumns')}
handleRowClick={handleRowClick}
handleRowDoubleClick={handleRowDoubleClick}
handleDragEnd={handleDragEnd}
virtualized
rowHeight={Number(settings.getSync('songListRowHeight'))}
fontSize={Number(settings.getSync('songListFontSize'))}
rowHeight={Number(settings.getSync('musicListRowHeight'))}
fontSize={Number(settings.getSync('musicListFontSize'))}
cacheImages={{
enabled: settings.getSync('cacheImages'),
cacheType: 'album',

8
src/components/settings/ConfigPanels/LookAndFeelConfig.tsx

@ -25,7 +25,7 @@ const LookAndFeelConfig = () => {
const dispatch = useAppDispatch();
const [currentLAFTab, setCurrentLAFTab] = useState('songList');
const songCols: any = settings.getSync('songListColumns');
const songCols: any = settings.getSync('musicListColumns');
const albumCols: any = settings.getSync('albumListColumns');
const playlistCols: any = settings.getSync('playlistListColumns');
const miniCols: any = settings.getSync('miniListColumns');
@ -85,9 +85,9 @@ const LookAndFeelConfig = () => {
columnPicker={songColumnPicker}
columnList={songColumnList}
settingsConfig={{
columnList: 'songListColumns',
rowHeight: 'songListRowHeight',
fontSize: 'songListFontSize',
columnList: 'musicListColumns',
rowHeight: 'musicListRowHeight',
fontSize: 'musicListFontSize',
}}
/>
)}

16
src/components/shared/setDefaultSettings.ts

@ -8,7 +8,7 @@ const setDefaultSettings = (force: boolean) => {
settings.setSync('theme', 'defaultDark');
}
if (force || !settings.hasSync('theme')) {
if (force || !settings.hasSync('font')) {
settings.setSync('font', 'Poppins');
}
@ -87,16 +87,16 @@ const setDefaultSettings = (force: boolean) => {
settings.setSync('albumViewType', 'list');
}
if (force || !settings.hasSync('songListFontSize')) {
settings.setSync('songListFontSize', '14');
if (force || !settings.hasSync('musicListFontSize')) {
settings.setSync('musicListFontSize', '14');
}
if (force || !settings.hasSync('songListRowHeight')) {
settings.setSync('songListRowHeight', '60.0');
if (force || !settings.hasSync('musicListRowHeight')) {
settings.setSync('musicListRowHeight', '60.0');
}
if (force || !settings.hasSync('songListColumns')) {
settings.setSync('songListColumns', [
if (force || !settings.hasSync('musicListColumns')) {
settings.setSync('musicListColumns', [
{
id: '#',
dataKey: 'index',
@ -282,7 +282,7 @@ const setDefaultSettings = (force: boolean) => {
settings.setSync('miniListFontSize', '14');
}
if (force || !settings.hasSync('playlistListRowHeight')) {
if (force || !settings.hasSync('miniListRowHeight')) {
settings.setSync('miniListRowHeight', '50');
}

6
src/components/starred/StarredView.tsx

@ -130,11 +130,11 @@ const StarredView = () => {
{currentPage === 'Tracks' && (
<ListViewType
data={searchQuery !== '' ? filteredData : data.song}
tableColumns={settings.getSync('songListColumns')}
tableColumns={settings.getSync('musicListColumns')}
handleRowClick={handleRowClick}
handleRowDoubleClick={handleRowDoubleClick}
rowHeight={Number(settings.getSync('songListRowHeight'))}
fontSize={settings.getSync('songListFontSize')}
rowHeight={Number(settings.getSync('musicListRowHeight'))}
fontSize={settings.getSync('musicListFontSize')}
cacheImages={{
enabled: settings.getSync('cacheImages'),
cacheType: 'album',

16
src/components/viewtypes/ListViewTable.tsx

@ -58,6 +58,7 @@ const ListViewTable = ({
// onScroll,
nowPlaying,
handleDragEnd,
miniView,
dnd,
}: any) => {
const history = useHistory();
@ -247,10 +248,17 @@ const ListViewTable = ({
(c: any) => c.dataKey === column.dataKey
);
settings.setSync(
`${listType}ListColumns[${resizedColumnIndex}].width`,
width
);
if (!miniView) {
settings.setSync(
`${listType}ListColumns[${resizedColumnIndex}].width`,
width
);
} else {
settings.setSync(
`miniListColumns[${resizedColumnIndex}].width`,
width
);
}
}}
>
<StyledTableHeaderCell>{column.id}</StyledTableHeaderCell>

6
src/components/viewtypes/ListViewType.tsx

@ -35,6 +35,7 @@ const ListViewType = (
isModal,
handleDragEnd,
dnd,
miniView,
...rest
}: any,
ref: any
@ -70,7 +71,7 @@ const ListViewType = (
setHeight(wrapperRef.current ? getHeight(wrapperRef.current) : 200);
}
if (!rest.miniView) {
if (!miniView) {
window.addEventListener('resize', handleResize);
return () => {
@ -78,7 +79,7 @@ const ListViewType = (
};
}
return undefined;
}, [getHeight, rest.miniView]);
}, [getHeight, miniView]);
useEffect(() => {
if (!isModal) {
@ -333,6 +334,7 @@ const ListViewType = (
isModal={isModal}
handleDragEnd={handleDragEnd}
dnd={dnd}
miniView={miniView}
// onScroll={(e) => setScrollY(tableRef.current.scrollY)}
/>
)}

Loading…
Cancel
Save