* add more ducking command * fix current music command * provide more controls, like pause, resume, clear. * add more controls in the web interface * refactored and improved: 1. move get_music_tag_info to util, and 2. refined logic related to it. 3. now playlist will check for tag info thus update_music_tag_info is useless and was removed 4. add "add folder" feature to !file asked in #65, 5. fix bugs related to !file * truncate file list if too long * fixed several tiny bugs * fixed several tiny bugs continue * fixed several tiny bugs continue continue * fixed several tiny bugs continue**3 * fixed several tiny bugs continue**4 * added !filematch command to add files that match a regex pattern. * truncate long message * fix web interface delete file issue * refresh after delete file * add regex to listfile command * refactored command part, added partial match support for commands * organized * added random command * typo * typo * Fixed many bugs. * Added workaround for azlux/pymumble#44 to fix the memory leak. * changed logging style. * fixed bugs related to random and resume * fix now playing * fixed issue related to download * fixed issue related to download 2 * fixed thumbnail issue * fixed add url problem in web interface * REFACTORED, turned db.ini into sqlite3 database. * fixed remove song problem * fixed radio get title problem. auto download if tmp file is deleted * fixed current index not loaded from database * fixed: order of songs loaded from the database * fixed: some obscure bugs. beautified error of commands * added a workaround for TerryGeng/botamusique#1. * beautified * fixed: channel not loaded in the config * fixed: auto checked for updates * fixed: mysterious bug: sometimes "now playing" string cannot be properly displayed. The real reason is: do use <br />, do not use <br>. I tried hours to find out this. * chore: unified debug messages that refer to music items * feav: fetch ffmpeg stderr mentioned in #72, reformatted logs. * fix: async download not working * fix: async download not working, still * fix: async download not working, finished * feat: queue command: ▶current playing item◀ * feat: support more than one command prefix * chore: added some WARNINGs into default config file to avoid people to touch it. * refactor: packed all string contants into constants.py, just to avoid people messing it around. * refactor: required by azlux. Added a configuration.example.ini to keep people away from configuration.default.ini
33 lines
1.3 KiB
Python
33 lines
1.3 KiB
Python
import variables as var
|
|
|
|
def strings(option, *argv, **kwargs):
|
|
string = ""
|
|
try:
|
|
string = var.config.get("strings", option)
|
|
except KeyError as e:
|
|
raise KeyError("Missed strings in configuration file: '{string}'. ".format(string=option) +
|
|
"Please restore you configuration file back to default if necessary.")
|
|
if argv or kwargs:
|
|
try:
|
|
formatted = string.format(*argv, **kwargs)
|
|
return formatted
|
|
except KeyError as e:
|
|
raise KeyError(
|
|
"Missed placeholder {{{placeholder}}} in string '{string}'. ".format(placeholder=str(e).strip("'"), string=option) +
|
|
"Please restore you configuration file back to default if necessary.")
|
|
except TypeError as e:
|
|
raise KeyError(
|
|
"Missed placeholder in string '{string}'. ".format(string=option) +
|
|
"Please restore you configuration file back to default if necessary.")
|
|
else:
|
|
return string
|
|
|
|
def commands(command):
|
|
string = ""
|
|
try:
|
|
string = var.config.get("commands", command)
|
|
return string
|
|
except KeyError as e:
|
|
raise KeyError("Missed command in configuration file: '{string}'. ".format(string=command) +
|
|
"Please restore you configuration file back to default if necessary.")
|