Skip to content

Commit

Permalink
feat: add more menu options
Browse files Browse the repository at this point in the history
  • Loading branch information
nini22P committed Jun 5, 2024
1 parent ecc1acf commit bd54178
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 250 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "omp",
"description": "OneDrive Media Player",
"private": true,
"version": "1.7.1",
"version": "1.7.2",
"scripts": {
"dev": "lingui extract & lingui compile --typescript & webpack serve",
"build": "lingui extract & lingui compile --typescript & webpack --mode=production --node-env=production",
Expand Down
7 changes: 2 additions & 5 deletions src/components/CommonList/CommonMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import shortUUID from 'short-uuid'
import { Menu, MenuItem, ListItemText, Button, Dialog, DialogActions, DialogTitle, List, ListItem, ListItemButton, ListItemIcon } from '@mui/material'
import PlaylistAddRoundedIcon from '@mui/icons-material/PlaylistAddRounded'
import ListRoundedIcon from '@mui/icons-material/ListRounded'
import { shallow } from 'zustand/shallow'
import usePlayQueueStore from '../../store/usePlayQueueStore'
import usePlaylistsStore from '../../store/usePlaylistsStore'
import useUiStore from '../../store/useUiStore'
Expand Down Expand Up @@ -41,12 +40,10 @@ const CommonMenu = (

const [updateFolderTree] = useUiStore((state) => [state.updateFolderTree])
const [playQueue, currentIndex, updatePlayQueue] = usePlayQueueStore(
(state) => [state.playQueue, state.currentIndex, state.updatePlayQueue],
shallow
(state) => [state.playQueue, state.currentIndex, state.updatePlayQueue]
)
const [playlists, insertPlaylist, insertFilesToPlaylist] = usePlaylistsStore(
(state) => [state.playlists, state.insertPlaylist, state.insertFilesToPlaylist],
shallow
(state) => [state.playlists, state.insertPlaylist, state.insertFilesToPlaylist]
)
const [updateAudioViewIsShow, updateVideoViewIsShow, updatePlayQueueIsShow] = useUiStore(
(state) => [state.updateAudioViewIsShow, state.updateVideoViewIsShow, state.updatePlayQueueIsShow]
Expand Down
47 changes: 34 additions & 13 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ msgstr "About"
msgid "Account"
msgstr "Account"

#: src/components/CommonList/CommonMenu.tsx:174
#: src/components/CommonList/CommonMenu.tsx:171
#: src/pages/Player/Audio/MenuButton.tsx:306
#: src/pages/SideBar/Playlists.tsx:49
msgid "Add playlist"
msgstr "Add playlist"

#: src/components/CommonList/CommonMenu.tsx:114
#: src/components/CommonList/CommonMenu.tsx:111
msgid "Add to play queue"
msgstr "Add to play queue"

#: src/components/CommonList/CommonMenu.tsx:107
#: src/components/CommonList/CommonMenu.tsx:148
#: src/components/CommonList/CommonMenu.tsx:104
#: src/components/CommonList/CommonMenu.tsx:145
#: src/pages/Player/Audio/MenuButton.tsx:194
#: src/pages/Player/Audio/MenuButton.tsx:280
msgid "Add to playlist"
msgstr "Add to playlist"

Expand All @@ -43,12 +46,17 @@ msgstr "Ascending"
msgid "Auto"
msgstr "Auto"

#: src/components/CommonList/CommonMenu.tsx:179
#: src/components/CommonList/CommonMenu.tsx:176
#: src/pages/Player/Audio/MenuButton.tsx:311
#: src/pages/Playlist/Playlist.tsx:168
#: src/pages/Playlist/Playlist.tsx:191
msgid "Cancel"
msgstr "Cancel"

#: src/pages/Player/Audio/MenuButton.tsx:238
msgid "Classic"
msgstr "Classic"

#: src/pages/Setting.tsx:66
msgid "Clear"
msgstr "Clear"
Expand Down Expand Up @@ -121,6 +129,10 @@ msgstr "Local metaData cache"
msgid "Media only"
msgstr "Media only"

#: src/pages/Player/Audio/MenuButton.tsx:226
msgid "Modern"
msgstr "Modern"

#: src/components/CommonList/CommonListItem.tsx:32
#: src/components/CommonList/CommonListItemCard.tsx:76
#: src/pages/Playlist/Playlist.tsx:101
Expand All @@ -135,7 +147,8 @@ msgstr "Multicolumn list"
msgid "Name"
msgstr "Name"

#: src/components/CommonList/CommonMenu.tsx:63
#: src/components/CommonList/CommonMenu.tsx:60
#: src/pages/Player/Audio/MenuButton.tsx:112
#: src/pages/SideBar/Playlists.tsx:16
msgid "New playlist"
msgstr "New playlist"
Expand All @@ -145,7 +158,8 @@ msgstr "New playlist"
msgid "OK"
msgstr "OK"

#: src/components/CommonList/CommonMenu.tsx:121
#: src/components/CommonList/CommonMenu.tsx:118
#: src/pages/Player/Audio/MenuButton.tsx:184
msgid "Open in folder"
msgstr "Open in folder"

Expand All @@ -157,10 +171,12 @@ msgstr "Open source dependencies"
msgid "Play all"
msgstr "Play all"

#: src/pages/Player/Audio/MenuButton.tsx:72
#: src/pages/Player/Audio/MenuButton.tsx:88
#: src/pages/Player/PlayerControl.tsx:377
#: src/pages/Player/PlayerControl.tsx:391
#: src/pages/Player/Audio/MenuButton.tsx:177
msgid "Play queue"
msgstr "Play queue"

#: src/pages/Player/Audio/MenuButton.tsx:166
#: src/pages/Player/Audio/MenuButton.tsx:251
msgid "Playback rate"
msgstr "Playback rate"

Expand All @@ -169,7 +185,7 @@ msgstr "Playback rate"
msgid "Please use Microsoft account authorization to log in"
msgstr "Please use Microsoft account authorization to log in"

#: src/components/CommonList/CommonMenu.tsx:137
#: src/components/CommonList/CommonMenu.tsx:134
msgid "Remove"
msgstr "Remove"

Expand Down Expand Up @@ -206,7 +222,12 @@ msgstr "Sign out"
msgid "Size"
msgstr "Size"

#: src/pages/Player/Audio/MenuButton.tsx:65
#: src/pages/Player/Audio/MenuButton.tsx:201
msgid "Switch fullscreen"
msgstr "Switch fullscreen"

#: src/pages/Player/Audio/MenuButton.tsx:157
#: src/pages/Player/Audio/MenuButton.tsx:214
msgid "Switch theme"
msgstr "Switch theme"

Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/messages.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages:Messages=JSON.parse("{\"uyJsf6\":\"About\",\"AeXO77\":\"Account\",\"uQ+CWJ\":\"Add playlist\",\"Vmuxgj\":\"Add to play queue\",\"gLfZlz\":\"Add to playlist\",\"nYD/Cq\":\"Ascending\",\"R9Khdg\":\"Auto\",\"dEgA5A\":\"Cancel\",\"xCJdfg\":\"Clear\",\"yz7wBu\":\"Close\",\"YDWhuY\":\"Color mode\",\"srRMnJ\":\"Customize\",\"pvnfJD\":\"Dark\",\"HKH+W+\":\"Data\",\"cnGeoo\":\"Delete\",\"Cko536\":\"Descending\",\"sER+bs\":\"Files\",\"rvhCbi\":\"Folders first\",\"CXDHcv\":\"Grid\",\"t3SPBU\":\"HD thumbnails\",\"0caMy7\":\"History\",\"x5DnMs\":\"Last modified\",\"1njn7W\":\"Light\",\"2BBAbc\":\"List\",\"2QFkSI\":\"Local metaData cache\",\"eK4SL/\":\"Media only\",\"2FYpfJ\":\"More\",\"/u/nsV\":\"Multicolumn list\",\"6YtxFj\":\"Name\",\"dMizp8\":\"New playlist\",\"zga9sT\":\"OK\",\"zAd2xF\":\"Open in folder\",\"OZNIzM\":\"Open source dependencies\",\"tVR7Hf\":\"Play all\",\"W7OEzk\":\"Playback rate\",\"2t5KJY\":\"Please use Microsoft account authorization to log in\",\"t/YqKh\":\"Remove\",\"2wxgft\":\"Rename\",\"A1taO8\":\"Search\",\"EFKJQT\":\"Setting\",\"ML96zX\":\"Shuffle all\",\"5lWFkC\":\"Sign in\",\"fcWrnU\":\"Sign out\",\"Cj2Gtd\":\"Size\",\"dGrFyD\":\"Switch theme\",\"DLu3TH\":\"The playlist will be deleted\",\"lRkLr5\":\"Use album cover theme color\"}");
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages:Messages=JSON.parse("{\"uyJsf6\":\"About\",\"AeXO77\":\"Account\",\"uQ+CWJ\":\"Add playlist\",\"Vmuxgj\":\"Add to play queue\",\"gLfZlz\":\"Add to playlist\",\"nYD/Cq\":\"Ascending\",\"R9Khdg\":\"Auto\",\"dEgA5A\":\"Cancel\",\"1gUYFw\":\"Classic\",\"xCJdfg\":\"Clear\",\"yz7wBu\":\"Close\",\"YDWhuY\":\"Color mode\",\"srRMnJ\":\"Customize\",\"pvnfJD\":\"Dark\",\"HKH+W+\":\"Data\",\"cnGeoo\":\"Delete\",\"Cko536\":\"Descending\",\"sER+bs\":\"Files\",\"rvhCbi\":\"Folders first\",\"CXDHcv\":\"Grid\",\"t3SPBU\":\"HD thumbnails\",\"0caMy7\":\"History\",\"x5DnMs\":\"Last modified\",\"1njn7W\":\"Light\",\"2BBAbc\":\"List\",\"2QFkSI\":\"Local metaData cache\",\"eK4SL/\":\"Media only\",\"IU7sBy\":\"Modern\",\"2FYpfJ\":\"More\",\"/u/nsV\":\"Multicolumn list\",\"6YtxFj\":\"Name\",\"dMizp8\":\"New playlist\",\"zga9sT\":\"OK\",\"zAd2xF\":\"Open in folder\",\"OZNIzM\":\"Open source dependencies\",\"tVR7Hf\":\"Play all\",\"2ckL2r\":\"Play queue\",\"W7OEzk\":\"Playback rate\",\"2t5KJY\":\"Please use Microsoft account authorization to log in\",\"t/YqKh\":\"Remove\",\"2wxgft\":\"Rename\",\"A1taO8\":\"Search\",\"EFKJQT\":\"Setting\",\"ML96zX\":\"Shuffle all\",\"5lWFkC\":\"Sign in\",\"fcWrnU\":\"Sign out\",\"Cj2Gtd\":\"Size\",\"NG9Ghl\":\"Switch fullscreen\",\"dGrFyD\":\"Switch theme\",\"DLu3TH\":\"The playlist will be deleted\",\"lRkLr5\":\"Use album cover theme color\"}");
47 changes: 34 additions & 13 deletions src/locales/zh-CN/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ msgstr "关于"
msgid "Account"
msgstr "账户"

#: src/components/CommonList/CommonMenu.tsx:174
#: src/components/CommonList/CommonMenu.tsx:171
#: src/pages/Player/Audio/MenuButton.tsx:306
#: src/pages/SideBar/Playlists.tsx:49
msgid "Add playlist"
msgstr "新建播放列表"

#: src/components/CommonList/CommonMenu.tsx:114
#: src/components/CommonList/CommonMenu.tsx:111
msgid "Add to play queue"
msgstr "添加到播放队列"

#: src/components/CommonList/CommonMenu.tsx:107
#: src/components/CommonList/CommonMenu.tsx:148
#: src/components/CommonList/CommonMenu.tsx:104
#: src/components/CommonList/CommonMenu.tsx:145
#: src/pages/Player/Audio/MenuButton.tsx:194
#: src/pages/Player/Audio/MenuButton.tsx:280
msgid "Add to playlist"
msgstr "添加到播放列表"

Expand All @@ -43,12 +46,17 @@ msgstr "正序"
msgid "Auto"
msgstr "自动"

#: src/components/CommonList/CommonMenu.tsx:179
#: src/components/CommonList/CommonMenu.tsx:176
#: src/pages/Player/Audio/MenuButton.tsx:311
#: src/pages/Playlist/Playlist.tsx:168
#: src/pages/Playlist/Playlist.tsx:191
msgid "Cancel"
msgstr "取消"

#: src/pages/Player/Audio/MenuButton.tsx:238
msgid "Classic"
msgstr "经典"

#: src/pages/Setting.tsx:66
msgid "Clear"
msgstr "清除"
Expand Down Expand Up @@ -121,6 +129,10 @@ msgstr "本地元数据缓存"
msgid "Media only"
msgstr "仅限媒体"

#: src/pages/Player/Audio/MenuButton.tsx:226
msgid "Modern"
msgstr "现代"

#: src/components/CommonList/CommonListItem.tsx:32
#: src/components/CommonList/CommonListItemCard.tsx:76
#: src/pages/Playlist/Playlist.tsx:101
Expand All @@ -135,7 +147,8 @@ msgstr "多列列表"
msgid "Name"
msgstr "名称"

#: src/components/CommonList/CommonMenu.tsx:63
#: src/components/CommonList/CommonMenu.tsx:60
#: src/pages/Player/Audio/MenuButton.tsx:112
#: src/pages/SideBar/Playlists.tsx:16
msgid "New playlist"
msgstr "新播放列表"
Expand All @@ -145,7 +158,8 @@ msgstr "新播放列表"
msgid "OK"
msgstr "确定"

#: src/components/CommonList/CommonMenu.tsx:121
#: src/components/CommonList/CommonMenu.tsx:118
#: src/pages/Player/Audio/MenuButton.tsx:184
msgid "Open in folder"
msgstr "打开所在文件夹"

Expand All @@ -157,10 +171,12 @@ msgstr "开源库"
msgid "Play all"
msgstr "全部播放"

#: src/pages/Player/Audio/MenuButton.tsx:72
#: src/pages/Player/Audio/MenuButton.tsx:88
#: src/pages/Player/PlayerControl.tsx:377
#: src/pages/Player/PlayerControl.tsx:391
#: src/pages/Player/Audio/MenuButton.tsx:177
msgid "Play queue"
msgstr "播放队列"

#: src/pages/Player/Audio/MenuButton.tsx:166
#: src/pages/Player/Audio/MenuButton.tsx:251
msgid "Playback rate"
msgstr "播放速度"

Expand All @@ -169,7 +185,7 @@ msgstr "播放速度"
msgid "Please use Microsoft account authorization to log in"
msgstr "请使用微软账户授权登录"

#: src/components/CommonList/CommonMenu.tsx:137
#: src/components/CommonList/CommonMenu.tsx:134
msgid "Remove"
msgstr "移除"

Expand Down Expand Up @@ -206,7 +222,12 @@ msgstr "注销"
msgid "Size"
msgstr "大小"

#: src/pages/Player/Audio/MenuButton.tsx:65
#: src/pages/Player/Audio/MenuButton.tsx:201
msgid "Switch fullscreen"
msgstr "切换全屏"

#: src/pages/Player/Audio/MenuButton.tsx:157
#: src/pages/Player/Audio/MenuButton.tsx:214
msgid "Switch theme"
msgstr "切换主题"

Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh-CN/messages.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages:Messages=JSON.parse("{\"uyJsf6\":\"关于\",\"AeXO77\":\"账户\",\"uQ+CWJ\":\"新建播放列表\",\"Vmuxgj\":\"添加到播放队列\",\"gLfZlz\":\"添加到播放列表\",\"nYD/Cq\":\"正序\",\"R9Khdg\":\"自动\",\"dEgA5A\":\"取消\",\"xCJdfg\":\"清除\",\"yz7wBu\":\"关闭\",\"YDWhuY\":\"颜色模式\",\"srRMnJ\":\"定制\",\"pvnfJD\":\"深色\",\"HKH+W+\":\"数据\",\"cnGeoo\":\"删除\",\"Cko536\":\"倒序\",\"sER+bs\":\"文件\",\"rvhCbi\":\"文件夹优先\",\"CXDHcv\":\"网格\",\"t3SPBU\":\"高清缩略图\",\"0caMy7\":\"历史\",\"x5DnMs\":\"最后修改\",\"1njn7W\":\"浅色\",\"2BBAbc\":\"列表\",\"2QFkSI\":\"本地元数据缓存\",\"eK4SL/\":\"仅限媒体\",\"2FYpfJ\":\"更多\",\"/u/nsV\":\"多列列表\",\"6YtxFj\":\"名称\",\"dMizp8\":\"新播放列表\",\"zga9sT\":\"确定\",\"zAd2xF\":\"打开所在文件夹\",\"OZNIzM\":\"开源库\",\"tVR7Hf\":\"全部播放\",\"W7OEzk\":\"播放速度\",\"2t5KJY\":\"请使用微软账户授权登录\",\"t/YqKh\":\"移除\",\"2wxgft\":\"重命名\",\"A1taO8\":\"搜索\",\"EFKJQT\":\"设置\",\"ML96zX\":\"全部随机播放\",\"5lWFkC\":\"登录\",\"fcWrnU\":\"注销\",\"Cj2Gtd\":\"大小\",\"dGrFyD\":\"切换主题\",\"DLu3TH\":\"播放列表将会被删除\",\"lRkLr5\":\"使用专辑封面主题色\"}");
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages:Messages=JSON.parse("{\"uyJsf6\":\"关于\",\"AeXO77\":\"账户\",\"uQ+CWJ\":\"新建播放列表\",\"Vmuxgj\":\"添加到播放队列\",\"gLfZlz\":\"添加到播放列表\",\"nYD/Cq\":\"正序\",\"R9Khdg\":\"自动\",\"dEgA5A\":\"取消\",\"1gUYFw\":\"经典\",\"xCJdfg\":\"清除\",\"yz7wBu\":\"关闭\",\"YDWhuY\":\"颜色模式\",\"srRMnJ\":\"定制\",\"pvnfJD\":\"深色\",\"HKH+W+\":\"数据\",\"cnGeoo\":\"删除\",\"Cko536\":\"倒序\",\"sER+bs\":\"文件\",\"rvhCbi\":\"文件夹优先\",\"CXDHcv\":\"网格\",\"t3SPBU\":\"高清缩略图\",\"0caMy7\":\"历史\",\"x5DnMs\":\"最后修改\",\"1njn7W\":\"浅色\",\"2BBAbc\":\"列表\",\"2QFkSI\":\"本地元数据缓存\",\"eK4SL/\":\"仅限媒体\",\"IU7sBy\":\"现代\",\"2FYpfJ\":\"更多\",\"/u/nsV\":\"多列列表\",\"6YtxFj\":\"名称\",\"dMizp8\":\"新播放列表\",\"zga9sT\":\"确定\",\"zAd2xF\":\"打开所在文件夹\",\"OZNIzM\":\"开源库\",\"tVR7Hf\":\"全部播放\",\"2ckL2r\":\"播放队列\",\"W7OEzk\":\"播放速度\",\"2t5KJY\":\"请使用微软账户授权登录\",\"t/YqKh\":\"移除\",\"2wxgft\":\"重命名\",\"A1taO8\":\"搜索\",\"EFKJQT\":\"设置\",\"ML96zX\":\"全部随机播放\",\"5lWFkC\":\"登录\",\"fcWrnU\":\"注销\",\"Cj2Gtd\":\"大小\",\"NG9Ghl\":\"切换全屏\",\"dGrFyD\":\"切换主题\",\"DLu3TH\":\"播放列表将会被删除\",\"lRkLr5\":\"使用专辑封面主题色\"}");
Loading

0 comments on commit bd54178

Please sign in to comment.