Compare commits

...

2 Commits

Author SHA1 Message Date
Ventilaar
a7c640a8cf Fix search error, add tombstone 2024-05-04 22:49:50 +02:00
Ventilaar
f6da232164 Rename functions 2024-04-21 00:31:25 +02:00
3 changed files with 13 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ def websub(cap):
@bp.route('/queue/<cap>', methods=['POST'])
def queue(cap):
# if endpoint does not exist
if not get_nosql().poster_isActive(cap):
if not get_nosql().queue_isActive(cap):
return abort(404)
videoId = request.form.get('v')
@@ -60,7 +60,7 @@ def queue(cap):
return abort(409)
# try to insert
if get_nosql().poster_insertQueue(videoId, cap):
if get_nosql().queue_insertQueue(videoId, cap):
return '', 202
else:
return abort(409)

View File

@@ -98,7 +98,7 @@ class Mango:
stats['videos'] = self.info_json.count_documents({})
stats['channels'] = self.channels.count_documents({})
stats['queue'] = self.posters_queue.count_documents({})
stats['queue'] = self.download_queue.count_documents({})
return stats
@@ -195,11 +195,14 @@ class Mango:
def get_orphaned_videos(self):
""" Returns a SET of YouTube video ID's which have info_jsons in the collection but no permanent channel is defined. SLOW OPERATION """
# Ok lemme explain. Perform inner join from channel collection on channel_id key. match only the fields which are empty. return video id
pipeline = [{'$lookup': {'from': 'channels', 'localField': 'channel_id', 'foreignField': 'id', 'as': 'channel'}}, {'$match': {'channel': {'$size': 0}}},{'$project': {'id': 1}}]
pipeline = [{'$match': {'_status': 'available'}},
{'$lookup': {'from': 'channels', 'localField': 'channel_id', 'foreignField': 'id', 'as': 'channel'}},
{'$match': {'channel': {'$size': 0}}},{'$project': {'id': 1}},
{'$project': {'id': 1}}]
results = self.info_json.aggregate(pipeline)
ids = [result['id'] for result in results]
return tuple(ids)
def get_recent_videos(self, count=99):

View File

@@ -43,6 +43,10 @@
<a href="{{ url_for('channel.channel', channelId='UCzGdxkzULCa9RlD-Q2EZPXQ') }}"><span class="title">Kalashnikov Group</span></a>
<p>Reason: This account has been terminated for a violation of YouTube's Terms of Service.</p>
</li>
<li class="collection-item">
<a href="{{ url_for('channel.channel', channelId='UCtfg1tENiu3SgGMZVduFmTg') }}"><span class="title">FiberNinja</span></a>
<p>Reason: This channel was removed because it violated our Community Guidelines.</p>
</li>
</ul>
</div>
</div>