1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-10-18 08:52:17 +00:00

Chat as feature

This commit is contained in:
spl0k 2014-03-15 19:47:44 +01:00
parent c6b197689a
commit 84c1582446
2 changed files with 21 additions and 15 deletions

View File

@ -212,7 +212,12 @@ if config.getbool('features', 'rating', True):
else:
app.add_url_rule('/rest/setRating.view', view_func = disabled_api_feature, methods = [ 'GET', 'POST' ])
from .chat import *
if config.getbool('features', 'chat', True):
from .chat import *
else:
app.add_url_rule('/rest/getChatMessages.view', view_func = disabled_api_feature, methods = [ 'GET', 'POST' ])
app.add_url_rule('/rest/addChatMessage.view', view_func = disabled_api_feature, methods = [ 'GET', 'POST' ])
from .search import *
from .playlists import *

3
db.py
View File

@ -368,7 +368,8 @@ if config.getbool('features', 'rating', True):
user = relationship('User')
rated = relationship('Track')
class ChatMessage(Base):
if config.getbool('features', 'chat', True):
class ChatMessage(Base):
__tablename__ = 'chat_message'
id = UUID.gen_id_column()