mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
Review
This commit is contained in:
parent
60b1afd969
commit
da0e05384a
3 changed files with 19 additions and 7 deletions
|
@ -7,6 +7,13 @@ class M3uParseStreams(MongoModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
collection_name = 'm3uparse_streams'
|
collection_name = 'm3uparse_streams'
|
||||||
|
|
||||||
|
def to_dict(self) -> dict:
|
||||||
|
return {'id': str(self.id), 'name': self.name, 'epgid': self.tvg_id, 'logo': self.tvg_logo, 'group': self.group}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def id(self):
|
||||||
|
return self.pk
|
||||||
|
|
||||||
name = fields.CharField(max_length=constants.MAX_STREAM_NAME_LENGTH,
|
name = fields.CharField(max_length=constants.MAX_STREAM_NAME_LENGTH,
|
||||||
min_length=constants.MIN_STREAM_NAME_LENGTH,
|
min_length=constants.MIN_STREAM_NAME_LENGTH,
|
||||||
required=True)
|
required=True)
|
||||||
|
@ -19,6 +26,13 @@ class M3uParseVods(MongoModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
collection_name = 'm3uparse_vods'
|
collection_name = 'm3uparse_vods'
|
||||||
|
|
||||||
|
def to_dict(self) -> dict:
|
||||||
|
return {'id': str(self.id), 'name': self.name, 'logo': self.tvg_logo, 'group': self.group}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def id(self):
|
||||||
|
return self.pk
|
||||||
|
|
||||||
name = fields.CharField(max_length=constants.MAX_STREAM_NAME_LENGTH,
|
name = fields.CharField(max_length=constants.MAX_STREAM_NAME_LENGTH,
|
||||||
min_length=constants.MIN_STREAM_NAME_LENGTH,
|
min_length=constants.MIN_STREAM_NAME_LENGTH,
|
||||||
required=True)
|
required=True)
|
||||||
|
|
|
@ -61,10 +61,9 @@ class M3uParseStreamsView(FlaskView):
|
||||||
|
|
||||||
@route('/search/<sid>', methods=['GET'])
|
@route('/search/<sid>', methods=['GET'])
|
||||||
def search(self, sid):
|
def search(self, sid):
|
||||||
lines = _get_m3u_stream_by_id(sid)
|
line = _get_m3u_stream_by_id(sid)
|
||||||
line = lines.first()
|
|
||||||
if line:
|
if line:
|
||||||
return jsonify(status='ok', line=line), 200
|
return jsonify(status='ok', line=line.to_dict()), 200
|
||||||
|
|
||||||
return jsonify(status='failed', error='Not found'), 404
|
return jsonify(status='failed', error='Not found'), 404
|
||||||
|
|
||||||
|
@ -128,10 +127,9 @@ class M3uParseVodsView(FlaskView):
|
||||||
|
|
||||||
@route('/search/<sid>', methods=['GET'])
|
@route('/search/<sid>', methods=['GET'])
|
||||||
def search(self, sid):
|
def search(self, sid):
|
||||||
lines = _get_m3u_vod_by_id(sid)
|
line = _get_m3u_vod_by_id(sid)
|
||||||
line = lines.first()
|
|
||||||
if line:
|
if line:
|
||||||
return jsonify(status='ok', line=line), 200
|
return jsonify(status='ok', line=line.to_dict()), 200
|
||||||
|
|
||||||
return jsonify(status='failed', error='Not found'), 404
|
return jsonify(status='failed', error='Not found'), 404
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,6 @@ PREFERRED_URL_SCHEME = 'http'
|
||||||
BOOTSTRAP_SERVE_LOCAL = True
|
BOOTSTRAP_SERVE_LOCAL = True
|
||||||
SUBSCRIBERS_SUPPORT = False
|
SUBSCRIBERS_SUPPORT = False
|
||||||
EPG_SUPPORT = False
|
EPG_SUPPORT = False
|
||||||
META_SUPPORT = True
|
META_SUPPORT = False
|
||||||
EPG_IN_DIRECTORY = '~/epg/in'
|
EPG_IN_DIRECTORY = '~/epg/in'
|
||||||
OMDB_KEY = 'd8a1f487'
|
OMDB_KEY = 'd8a1f487'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue