@@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next'
66import { ConfigContext } from '~/contexts/config'
77import { getApi , getApiNetworkFirst } from '~/utils/api'
88import { urlStream } from '~/utils/url'
9- import { playSong , downloadSong } from '~/utils/player'
10- import { SongDispatchContext } from '~/contexts/song'
9+ import { playSong , downloadSong , addToQueue } from '~/utils/player'
10+ import { SongContext , SongDispatchContext } from '~/contexts/song'
1111import { SettingsContext } from '~/contexts/settings'
1212import OptionsPopup from '~/components/popup/OptionsPopup'
1313
@@ -18,6 +18,7 @@ const OptionsAlbum = ({ album, isOpen, onClose }) => {
1818 const refOption = React . useRef ( )
1919 const settings = React . useContext ( SettingsContext )
2020 const songDispatch = React . useContext ( SongDispatchContext )
21+ const song = React . useContext ( SongContext )
2122
2223 const playSimilarSongs = ( ) => {
2324 getApiNetworkFirst ( config , 'getSimilarSongs' , `id=${ album . id } &count=50` )
@@ -44,6 +45,17 @@ const OptionsAlbum = ({ album, isOpen, onClose }) => {
4445 icon : 'play' ,
4546 onPress : playSimilarSongs
4647 } ,
48+ {
49+ name : t ( 'Add to queue' ) ,
50+ icon : 'list-ul' ,
51+ onPress : ( ) => {
52+ refOption . current . close ( )
53+ for ( const song of album . song ) {
54+ addToQueue ( songDispatch , song )
55+ }
56+ } ,
57+ hidden : ! song . queue ?. length
58+ } ,
4759 {
4860 name : t ( 'Cache all songs' ) ,
4961 icon : 'cloud-download' ,
0 commit comments