diff options
| author | Thongrapee Panyapatiphan <[email protected]> | 2021-10-01 20:48:32 +0700 |
|---|---|---|
| committer | Thongrapee Panyapatiphan <[email protected]> | 2021-10-01 20:48:32 +0700 |
| commit | 96dcc4a5364d934b413b247e7b69ff31606c6183 (patch) | |
| tree | 7d9be813ea28bd84560a1cd408ddf34fdb90268a /src/commands | |
| parent | 296a0a8178fb3c670c924b230a042cc1e6241719 (diff) | |
| download | muse-96dcc4a5364d934b413b247e7b69ff31606c6183.tar.xz muse-96dcc4a5364d934b413b247e7b69ff31606c6183.zip | |
Revert "Add config for song limit per playlist"
This reverts commit 296a0a8178fb3c670c924b230a042cc1e6241719.
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/play.ts | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/commands/play.ts b/src/commands/play.ts index 81a4ae1..a907a40 100644 --- a/src/commands/play.ts +++ b/src/commands/play.ts @@ -10,7 +10,6 @@ import LoadingMessage from '../utils/loading-message.js'; import errorMsg from '../utils/error-msg.js'; import Command from '.'; import GetSongs from '../services/get-songs.js'; -import Config from '../services/config.js'; @injectable() export default class implements Command { @@ -32,16 +31,10 @@ export default class implements Command { private readonly playerManager: PlayerManager; private readonly getSongs: GetSongs; - private readonly playlistLimit: number; - constructor( - @inject(TYPES.Managers.Player) playerManager: PlayerManager, - @inject(TYPES.Services.GetSongs) getSongs: GetSongs, - @inject(TYPES.Config) config: Config, - ) { + constructor(@inject(TYPES.Managers.Player) playerManager: PlayerManager, @inject(TYPES.Services.GetSongs) getSongs: GetSongs) { this.playerManager = playerManager; this.getSongs = getSongs; - this.playlistLimit = config.getPlaylistLimit(); } public async execute(msg: Message, args: string[]): Promise<void> { @@ -110,11 +103,11 @@ export default class implements Command { } else if (url.protocol === 'spotify:' || url.host === 'open.spotify.com') { const [convertedSongs, nSongsNotFound, totalSongs] = await this.getSongs.spotifySource(args[0]); - if (totalSongs > this.playlistLimit) { - extraMsg = `a random sample of ${this.playlistLimit} songs was taken`; + if (totalSongs > 50) { + extraMsg = 'a random sample of 50 songs was taken'; } - if (totalSongs > this.playlistLimit && nSongsNotFound !== 0) { + if (totalSongs > 50 && nSongsNotFound !== 0) { extraMsg += ' and '; } |
