adapt logging levels for messages
This commit is contained in:
@@ -77,6 +77,8 @@ def get_actor_links(log: logging.Logger, media_file_url: str) -> list:
|
|||||||
link_url = anchor.get('href')
|
link_url = anchor.get('href')
|
||||||
if link_url.endswith('all/countries'):
|
if link_url.endswith('all/countries'):
|
||||||
continue
|
continue
|
||||||
|
if link_url in actor_links:
|
||||||
|
continue
|
||||||
actor_links.append(link_url)
|
actor_links.append(link_url)
|
||||||
log.debug(f"links({len(actor_links)}): {actor_links}")
|
log.debug(f"links({len(actor_links)}): {actor_links}")
|
||||||
return actor_links
|
return actor_links
|
||||||
@@ -123,8 +125,12 @@ if __name__ == '__main__':
|
|||||||
actor_list.append(actors[actor_link])
|
actor_list.append(actors[actor_link])
|
||||||
actor_response = requests.put(f"http://127.0.0.1:8800/api/media/files/{item['id']}/actors", json=actor_list)
|
actor_response = requests.put(f"http://127.0.0.1:8800/api/media/files/{item['id']}/actors", json=actor_list)
|
||||||
actor_data = actor_response.json()
|
actor_data = actor_response.json()
|
||||||
log.warning(f"{len(actor_data)} links persisted, but {len(actor_list)} links are available")
|
persisted_actor_links: int = len(actor_data)
|
||||||
log.debug(f"found {len(actor_data)} actors")
|
found_actor_links: int = len(actor_links)
|
||||||
|
if persisted_actor_links != found_actor_links:
|
||||||
|
log.warning(f"{persisted_actor_links} links persisted, but {found_actor_links} links are available")
|
||||||
|
log.info(f"found actors: {actor_links}")
|
||||||
|
log.debug(f"found {persisted_actor_links} actors")
|
||||||
log.debug(f"found actors: {actor_data}")
|
log.debug(f"found actors: {actor_data}")
|
||||||
item['review'] = False
|
item['review'] = False
|
||||||
update = requests.put(f"http://127.0.0.1:8800/api/media/files/{item['id']}", json=item)
|
update = requests.put(f"http://127.0.0.1:8800/api/media/files/{item['id']}", json=item)
|
||||||
|
|||||||
Reference in New Issue
Block a user