Skip to content

Commit

Permalink
Merge pull request #63 from lovegaoshi/dev-noxplayer
Browse files Browse the repository at this point in the history
fix: stuff
  • Loading branch information
lovegaoshi authored Apr 19, 2024
2 parents bc54fa3 + 6b6a4c9 commit 19ebf32
Show file tree
Hide file tree
Showing 34 changed files with 1,226 additions and 1,059 deletions.
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
"compile": "tsc"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.0",
"@types/chrome": "^0.0.262",
"@types/chrome": "^0.0.266",
"@types/md5": "^2.3.5",
"@types/react": "^18.2.62",
"@types/react": "^18.2.78",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^18.2.19",
"@types/react-dom": "^18.2.25",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"babel-loader": "^9.1.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "12.0.2",
"css-loader": "^6.10.0",
"eslint": "^8.57.0",
"css-loader": "^7.1.1",
"eslint": "^9.0.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-alias": "^1.1.2",
Expand All @@ -41,7 +41,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.0",
Expand All @@ -51,33 +51,34 @@
"prettier": "^3.2.5",
"progress-bar-webpack-plugin": "^2.1.0",
"react-refresh": "^0.14.0",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4",
"sass-loader": "^14.2.0",
"style-loader": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.3.3",
"webpack": "^5.90.3",
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.0.1",
"webpack-config-utils": "^2.3.1",
"webpack-dev-server": "^5.0.2"
"webpack-dev-server": "^5.0.4"
},
"browserslist": [
"chrome >= 72",
"not dead"
],
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.6.0",
"@emotion/styled": "^11.11.5",
"@ffmpeg/core-mt": "^0.12.6",
"@ffmpeg/ffmpeg": "^0.12.10",
"@ffmpeg/util": "^0.12.1",
"@fontsource/roboto": "^5.0.12",
"@fortawesome/fontawesome-free": "^6.5.1",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@mui/icons-material": "^5.15.11",
"@mui/lab": "^5.0.0-alpha.166",
"@mui/material": "^5.15.11",
"@mui/styles": "^5.15.11",
"axios": "^1.6.7",
"@fortawesome/fontawesome-free": "^6.5.2",
"@fortawesome/free-brands-svg-icons": "^6.5.2",
"@mui/icons-material": "^5.15.15",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5.15.15",
"@mui/styles": "^5.15.15",
"axios": "^1.6.8",
"base-64": "^1.0.0",
"base64-js": "^1.5.1",
"big-integer": "^1.6.52",
"bottleneck": "^2.19.5",
Expand All @@ -87,17 +88,16 @@
"crypto-browserify": "^3.12.0",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.10",
"dotenv-webpack": "^8.0.1",
"dotenv-webpack": "^8.1.0",
"downloadjs": "^1.4.7",
"dropbox": "^10.34.0",
"fflate": "^0.8.2",
"file-saver": "^2.0.5",
"fs": "^0.0.1-security",
"he": "^1.2.0",
"i18next": "^23.10.0",
"is-mobile": "^4.0.0",
"i18next": "^23.11.2",
"libmuse": "git+https://github.com/lovegaoshi/muse.git#apm-release",
"material-ui-confirm": "^3.0.11",
"material-ui-confirm": "^3.0.12",
"md5": "^2.3.0",
"notistack": "^3.0.1",
"os-browserify": "^0.3.0",
Expand All @@ -109,7 +109,7 @@
"react-contexify": "^6.0.0",
"react-dom": "^18.2.0",
"react-hotkeys-hook": "^4.5.0",
"react-i18next": "^14.0.5",
"react-i18next": "^14.1.0",
"react-jinke-music-player": "file:../react-music-player",
"react-lrc": "^3.1.3",
"react-swipeable": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/azusa-player-mobile
2 changes: 1 addition & 1 deletion src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function Player({ songList }: Props) {
const { appTitle, desktopTheme } = useApp((state) => state.playerStyle);

useHotkeys('space', () => {
if (currentAudioInst === null) return;
if (!currentAudioInst) return;
// i have no idea why currentAudioInst doesnt have play(), but this works
// reactJKPlayer's spaceBar prop only listens when it has focus; this allows spacebar
// listening to pause/play audio at a global level.
Expand Down
4 changes: 2 additions & 2 deletions src/components/Playlist/PlaylistHeader/PlaylistHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';

import { PLAYLIST_ENUMS } from '@enums/Playlist';
import { PlaylistTypes } from '@enums/Playlist';
import useApp from '@stores/useApp';
import { UsePlaylistP } from '../hooks/usePlaylistPaginated';
import RandomGIFIcon from './RandomGIF';
Expand Down Expand Up @@ -46,7 +46,7 @@ export default function FavHeader({ playlist, playlistPaginated }: Props) {
</Grid>
<Grid item xs={5} sx={styles.gridPlaylistSetting}>
<PlaylistSelectButton usePlaylist={playlistPaginated} />
{playlist.type === PLAYLIST_ENUMS.TYPE_TYPICA_PLAYLIST && (
{playlist.type === PlaylistTypes.Typical && (
<FavSettingsButtons
playlist={playlist}
usePlaylist={playlistPaginated}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CropSquareIcon from '@mui/icons-material/CropSquare';
import DeselectIcon from '@mui/icons-material/Deselect';
import SelectAllIcon from '@mui/icons-material/SelectAll';

import { SORT_OPTIONS } from '@enums/Playlist';
import { SortOptions } from '@enums/Playlist';
import PlaylistSortButton from './PlaylistSortButton';

interface UsePlaylist {
Expand All @@ -14,7 +14,7 @@ interface UsePlaylist {
resetSelected: () => void;
toggleSelectedPage: () => void;
sortPlaylist: (
sort: SORT_OPTIONS,
sort: SortOptions,
ascend: boolean,
playlist: NoxMedia.Playlist,
) => void;
Expand Down
8 changes: 4 additions & 4 deletions src/components/Playlist/PlaylistHeader/PlaylistSortButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Checkbox from '@mui/material/Checkbox';
import FormGroup from '@mui/material/FormGroup';

import GenericSelectDialog from '@components/dialogs/GenericSelectDialog';
import { SORT_OPTIONS } from '@enums/Playlist';
import { SortOptions } from '@enums/Playlist';

interface Props {
sortPlaylist: (
sort: SORT_OPTIONS,
sort: SortOptions,
ascend: boolean,
playlist: NoxMedia.Playlist,
) => void;
Expand All @@ -21,9 +21,9 @@ interface Props {
export default function ({ sortPlaylist, playlist }: Props) {
const [showDialog, setShowDialog] = React.useState(false);
const [ascending, setAscending] = React.useState(false);
const sortOptions = Object.values(SORT_OPTIONS);
const sortOptions = Object.values(SortOptions);

const handleSort = (sortOption: SORT_OPTIONS) => {
const handleSort = (sortOption: SortOptions) => {
sortPlaylist(sortOption, ascending, playlist);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/Playlist/hooks/usePlaylistPaginated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
import { useNoxSetting } from '@APM/stores/useApp';
import usePlaylist, { UsePlaylist } from '@APM/hooks/usePlaylist';
import { syncFavlist } from '@utils/Bilibili/bilifavOperate';
import { PLAYLIST_ENUMS } from '@enums/Playlist';
import { PlaylistTypes } from '@enums/Playlist';
import { logger } from '@utils/Logger';

export interface UsePlaylistP extends UsePlaylist {
Expand Down Expand Up @@ -106,7 +106,7 @@ export default (playlist: NoxMedia.Playlist): UsePlaylistP => {
};

const refreshPlaylist = async (subscribeUrls?: string[]) => {
if (playlist.type !== PLAYLIST_ENUMS.TYPE_TYPICA_PLAYLIST) {
if (playlist.type !== PlaylistTypes.Typical) {
return;
}
setRefreshing(true);
Expand Down Expand Up @@ -142,7 +142,7 @@ export default (playlist: NoxMedia.Playlist): UsePlaylistP => {
useEffect(() => {
if (
playerSetting.autoRSSUpdate &&
playlist.type === PLAYLIST_ENUMS.TYPE_TYPICA_PLAYLIST &&
playlist.type === PlaylistTypes.Typical &&
playlist.subscribeUrl.length > 0 &&
playlist.subscribeUrl[0]!.length > 0 &&
new Date().getTime() - playlist.lastSubscribed > 86400000
Expand Down
4 changes: 2 additions & 2 deletions src/components/Playlists/PlaylistsHeader/HelpDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ export default function HelpDialog({ onClose, openState, id }: Props) {
<Button
startIcon={<ForumIcon />}
onClick={() =>
window.open('https://bbs.nga.cn/read.php?tid=31176308')
window.open('https://bbs.nga.cn/read.php?tid=37678803')
}
>
来p综@nga听歌吹水
来P综6@nga听歌吹水
</Button>
<div />
<Button
Expand Down
4 changes: 2 additions & 2 deletions src/components/Playlists/PlaylistsHeader/HelpPanelButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
import { SxProps } from '@mui/material';
import Dialog from './HelpDialog';

interface props {
interface Props {
sx: SxProps;
onClosedDialogFunc?: Function;
}

export default function helpPanelButton({
sx,
onClosedDialogFunc = () => {},
}: props) {
}: Props) {
const [openSettingsDialog, setOpenSettingsDialog] = useState(false);

return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/Playlists/PlaylistsList/PlaylistList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default function PlaylistList({ playlistCRUD }: Props) {
const { onPlayAllFromFav } = usePlayback();
const favoritePlaylist = useNoxSetting((state) => state.favoritePlaylist);

// @ts-ignore
const _ = useNoxSetting((state) => state.playlistShouldReRender);
const {
playlists,
Expand Down Expand Up @@ -100,7 +101,7 @@ export default function PlaylistList({ playlistCRUD }: Props) {
)}
<DragDropContext onDragEnd={onDragEnd}>
<Droppable droppableId='droppable'>
{(provided, snapshot) => (
{(provided, _snapshot) => (
<div {...provided.droppableProps} ref={provided.innerRef}>
{playlistIds.map((item, index) => (
<Draggable
Expand Down
7 changes: 4 additions & 3 deletions src/components/buttons/NewPlaylistButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import IconButton from '@mui/material/IconButton';
import AddIcon from '@mui/icons-material/Add';
import { NewFavDialog } from '../dialogs/AddFavDialog';

interface props {
interface Props {
AddFavIcon: Object;
onClosedDialogFunc: Function;
}
Expand All @@ -17,7 +17,7 @@ interface props {
export default function newPlaylistButton({
AddFavIcon,
onClosedDialogFunc,
}: props) {
}: Props) {
const [openSettingsDialog, setOpenSettingsDialog] = useState(false);

return (
Expand All @@ -28,8 +28,9 @@ export default function newPlaylistButton({
</IconButton>
</Tooltip>
<NewFavDialog
id={'newFavDialogID'}
openState={openSettingsDialog}
onClose={(val: string) => {
onClose={(val?: string) => {
onClosedDialogFunc(val);
setOpenSettingsDialog(false);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons/ThumbsUpButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function thumbsUpButton({ song }: Props) {
function ThumbsUpClickNHold() {
const start = () => {};
const clickNHold = () => sendBVTriple(song.bvid, () => setLiked(1));
const end = (e: any, enough: any) => {
const end = (_e: any, enough: any) => {
if (enough) return;
sendBVLike(song.bvid, () => setLiked(1));
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/buttons/TimerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TimerIcon from '@mui/icons-material/Timer';
import Button from '@mui/material/Button';
import TimerDialog from '../dialogs/TimerDialog';

interface props {
interface Props {
AddFavIcon: Object | undefined;
btnType: string;
}
Expand All @@ -18,7 +18,7 @@ interface props {
export default function TimerButton({
AddFavIcon = undefined,
btnType = 'IconButton',
}: props) {
}: Props) {
const [openSettingsDialog, setOpenSettingsDialog] = useState(false);

const buttonType = (type: string) => {
Expand Down
5 changes: 2 additions & 3 deletions src/components/dialogs/SongRenameDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import { useSnackbar } from 'notistack';
import CircularProgress from '@mui/material/CircularProgress';

import getBiliUser from '@APM/utils/Bilibili/BiliUser';
import { getPlayerSettingKey } from '@utils/ChromeStorage';
import { editBiliVideo } from '@utils/Bilibili/biliEdit';

interface props {
interface Props {
openState: boolean;
song?: NoxMedia.Song;
onClose: () => void;
Expand All @@ -24,7 +23,7 @@ export default function songRenameDialog({
song,
onClose,
updateSong,
}: props) {
}: Props) {
const [songBVID, setSongBVID] = useState('');
const [songBVIndex, setSongBVIndex] = useState('');
const [songName, setSongName] = useState('');
Expand Down
6 changes: 1 addition & 5 deletions src/components/lyric/LyricOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef } from 'react';
import React from 'react';
import Dialog from '@mui/material/Dialog';
import IconButton from '@mui/material/IconButton';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
Expand All @@ -16,10 +16,6 @@ const Transition = React.forwardRef(function Transition(
return <Slide direction='up' ref={ref} {...props} />;
});

const theme = {
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
};

interface Props {
showLyric: boolean;
currentTime: number;
Expand Down
4 changes: 2 additions & 2 deletions src/components/lyric/LyricSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { searchLyricOptions, searchLyric } from '@APM/utils/LyricFetch';
interface Props {
SearchKey: string;
songId: string;
setLyric: (v: any) => void;
setLyric: (v: string) => void;
setLyricOffset: (v: number) => void;
}
export default function LyricSearchBar({
Expand Down Expand Up @@ -62,7 +62,7 @@ export default function LyricSearchBar({
const onOptionSet = (_: any, newValue?: NoxNetwork.NoxFetchedLyric) => {
if (newValue === undefined) return;
setValue(newValue);
searchLyric(newValue.songMid, setLyric);
searchLyric(newValue.songMid).then(setLyric);
setLyricMapping({
songId,
lyricKey: newValue.key,
Expand Down
Loading

0 comments on commit 19ebf32

Please sign in to comment.