Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions comment_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ def build_comments_list(client, asset_id, comment_list):
Takes an initialized client, recursively builds a list of comments
and returns the list. (Technically, it's a list of dicts)
"""
assets = client.get_asset_children(asset_id)
assets = client.assets.get_children(asset_id)

for asset in assets:
# Recurse through folders but skip the empty ones
if (asset.get('type') == 'folder') and (asset.get('item_count') > 0):
build_comments_list(client, asset['id'], comment_list)

if asset.get('type') == 'file' and asset.get('comment_count') > 0:
comments = client.get_comments(asset['id'])
comments = client.comments.list(asset['id'])
for comment in comments:
# The 'get_comments" call won't return the asset name
# So we'll add it to the dictionary now.
Expand All @@ -42,9 +42,9 @@ def build_comments_list(client, asset_id, comment_list):

if asset.get('type') == 'version_stack':
# Read about version stacks: https://docs.frame.io/docs/managing-version-stacks
versions = client.get_asset_children(asset['id'])
versions = client.assets.get_children(asset['id'])
for v_asset in versions:
comments = client.get_comments(v_asset['id'])
comments = client.comments.list(v_asset['id'])
for comment in comments:
comment['asset'] = { 'name': asset['name'] }
comment_list.append(comment)
Expand Down Expand Up @@ -103,4 +103,4 @@ def write_comments_csv(c_list):
comments_list = build_comments_list(client, ROOT_ASSET_ID, comments)

# Write the comments to comments.csv
write_comments_csv(comments_list)
write_comments_csv(comments_list)