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: else:
app.add_url_rule('/rest/setRating.view', view_func = disabled_api_feature, methods = [ 'GET', 'POST' ]) app.add_url_rule('/rest/setRating.view', view_func = disabled_api_feature, methods = [ 'GET', 'POST' ])
if config.getbool('features', 'chat', True):
from .chat import * 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 .search import *
from .playlists import * from .playlists import *

1
db.py
View File

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