mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-18 08:26:15 +00:00
fix: [retro hunt] fix object to resume
This commit is contained in:
parent
4d5c3f002b
commit
e0a8f4cc37
4 changed files with 36 additions and 23 deletions
|
@ -454,16 +454,19 @@ def get_all_decodeds_objects(filters={}):
|
||||||
mimetypes = sorted(mimetypes)
|
mimetypes = sorted(mimetypes)
|
||||||
|
|
||||||
if filters.get('start'):
|
if filters.get('start'):
|
||||||
_, start_id = filters['start'].split(':', 1)
|
if filters['start']['type'] == 'decoded':
|
||||||
decoded = Decoded(start_id)
|
_, start_id = filters['start'].split(':', 1)
|
||||||
# remove sources
|
decoded = Decoded(start_id)
|
||||||
start_mimetype = decoded.get_mimetype()
|
# remove sources
|
||||||
i = 0
|
start_mimetype = decoded.get_mimetype()
|
||||||
while start_mimetype and len(mimetypes) > i:
|
i = 0
|
||||||
if mimetypes[i] == start_mimetype:
|
while start_mimetype and len(mimetypes) > i:
|
||||||
mimetypes = mimetypes[i:]
|
if mimetypes[i] == start_mimetype:
|
||||||
start_mimetype = None
|
mimetypes = mimetypes[i:]
|
||||||
i += 1
|
start_mimetype = None
|
||||||
|
i += 1
|
||||||
|
else:
|
||||||
|
start_id = None
|
||||||
else:
|
else:
|
||||||
start_id = None
|
start_id = None
|
||||||
|
|
||||||
|
|
|
@ -464,17 +464,24 @@ def get_all_items_objects(filters={}):
|
||||||
sources = get_all_sources()
|
sources = get_all_sources()
|
||||||
sources = sorted(sources)
|
sources = sorted(sources)
|
||||||
if filters.get('start'):
|
if filters.get('start'):
|
||||||
_, start_id = filters['start'].split(':', 1)
|
if filters['start']['type'] == 'item':
|
||||||
item = Item(start_id)
|
_, start_id = filters['start'].split(':', 1)
|
||||||
# remove sources
|
item = Item(start_id)
|
||||||
start_source = item.get_source()
|
if not item.exists():
|
||||||
i = 0
|
start_id = None
|
||||||
while start_source and len(sources) > i:
|
start_date = None
|
||||||
if sources[i] == start_source:
|
# remove sources
|
||||||
sources = sources[i:]
|
start_source = item.get_source()
|
||||||
start_source = None
|
i = 0
|
||||||
i += 1
|
while start_source and len(sources) > i:
|
||||||
start_date = item.get_date()
|
if sources[i] == start_source:
|
||||||
|
sources = sources[i:]
|
||||||
|
start_source = None
|
||||||
|
i += 1
|
||||||
|
start_date = item.get_date()
|
||||||
|
else:
|
||||||
|
start_id = None
|
||||||
|
start_date = None
|
||||||
else:
|
else:
|
||||||
start_id = None
|
start_id = None
|
||||||
start_date = None
|
start_date = None
|
||||||
|
|
|
@ -375,6 +375,8 @@ def obj_iterator(obj_type, filters):
|
||||||
return chats_viewer.get_ocrs_iterator(filters=filters)
|
return chats_viewer.get_ocrs_iterator(filters=filters)
|
||||||
elif obj_type == 'title':
|
elif obj_type == 'title':
|
||||||
return Titles.Titles().get_iterator()
|
return Titles.Titles().get_iterator()
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
def card_objs_iterators(filters):
|
def card_objs_iterators(filters):
|
||||||
|
|
|
@ -72,6 +72,8 @@ class Retro_Hunt_Module(AbstractModule):
|
||||||
last_obj = self.retro_hunt.get_last_analyzed()
|
last_obj = self.retro_hunt.get_last_analyzed()
|
||||||
if last_obj:
|
if last_obj:
|
||||||
last_obj_type, last_obj_subtype, last_obj_id = last_obj.split(':', 2)
|
last_obj_type, last_obj_subtype, last_obj_id = last_obj.split(':', 2)
|
||||||
|
if last_obj_subtype is None:
|
||||||
|
last_obj_subtype = ''
|
||||||
else:
|
else:
|
||||||
last_obj_type = None
|
last_obj_type = None
|
||||||
last_obj_subtype = None
|
last_obj_subtype = None
|
||||||
|
@ -81,8 +83,7 @@ class Retro_Hunt_Module(AbstractModule):
|
||||||
self.update_progress()
|
self.update_progress()
|
||||||
|
|
||||||
if last_obj_type:
|
if last_obj_type:
|
||||||
filters['start'] = f'{last_obj_subtype}:{last_obj_id}'
|
filters['start'] = {'type': last_obj_type, 'subtype': last_obj_subtype, 'id': last_obj_id}
|
||||||
last_obj_type = None
|
|
||||||
|
|
||||||
for obj_type in filters:
|
for obj_type in filters:
|
||||||
for obj in ail_objects.obj_iterator(obj_type, filters):
|
for obj in ail_objects.obj_iterator(obj_type, filters):
|
||||||
|
|
Loading…
Add table
Reference in a new issue