* Fix `ytsearch -n' next page issue (#373)
Fix an issue which caused the `ytsearch' to improperly fill the shortlist when used with `-p' to query the next search page.
* Fix code syntax
Add empty line removed in the previous commit.
In the configuration, `max_duration` can be set to prevent
long song(URL item) being downloaded and added to the
playlist.
This whitelist feature provided a way to override this
duration check: songs being whitelisted will be added to
the playlist no matter how long they are.
Three admin commands are introduced:
- !urlwhitelist (!urlw)
- !urlunwhitelist, (!urlunw)
- !urlwhitelistlist, (!urlwls).
Also, if one song fails due to its length, the bot will
show the length of this song and the max length limit in
the reply message.
Implement #173, #196.
1. 'auth_method' in config, where users can select between
'password' and 'token'.
2. create index for token, avoid iterating the entire user
section when validating tokens.
3. only generate token for a user when there's no token for
him in the db, avoid tokens fill the db.
IMPORTANT NOTE:
The default database path has changed. It was database.db, but
now they ARE settings.db and music.db.
Database migration will detect music table in settings.db, and
move it out of settings.db.
To update from old version, you need to
1. if you use your own db path settings in the command
line or in configuration.ini, you don't have to change
anything;
1. or,if you use default database path, rename database.db
into settings.db.
If the repeat command is invoked without this change, the bot will crash due to the call to format_song_string() on music which is null. All I did is add a check and make the bot say that the playlist is empty if this scenario occurs.