You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Retrieves all the quarantined media MXC URIs starting from the given position,
952
+
ordered from oldest quarantined timestamp, then alphabetically by media ID
953
+
(including origin).
954
+
955
+
Note that on established servers the "quarantined timestamp" may be zero due to
956
+
being introduced after the quarantine timestamp field was introduced.
957
+
958
+
Args:
959
+
index_start: The position to start from.
960
+
index_limit: The maximum number of results to return.
961
+
local: When true, only local media will be returned. When false, only remote media will be returned.
962
+
963
+
Returns:
964
+
The quarantined media as a list of media IDs.
965
+
"""
966
+
967
+
def_get_quarantined_media_mxcs_txn(
968
+
txn: LoggingTransaction,
969
+
) ->list[str]:
970
+
# We order by quarantined timestamp *and* media ID (including origin, when
971
+
# known) to ensure the ordering is stable for established servers.
972
+
iflocal:
973
+
sql="SELECT '' as media_origin, media_id FROM local_media_repository WHERE quarantined_by IS NOT NULL ORDER BY quarantined_ts, media_id ASC LIMIT ? OFFSET ?"
974
+
else:
975
+
sql="SELECT media_origin, media_id FROM remote_media_cache WHERE quarantined_by IS NOT NULL ORDER BY quarantined_ts, media_origin, media_id ASC LIMIT ? OFFSET ?"
0 commit comments