Commit 44fa091e authored by Luca Braun's avatar Luca Braun

added change types

parent 2c2771d8
......@@ -20,40 +20,48 @@ for video in videosRequest.json():
print(f"Status: {videoRequest.status_code}")
if videoRequest.text != "":
print(f"\n\n{videoUrl}{id}\n{videoRequest.text}")
historyList = sorted(videoRequest.json()[0]["History"], key=lambda k: k['moderationDate'], reversed=True)
i = 0
changeList = []
for eventMap in historyList:
if i == 0:
lastState = videoRequest.json()[0]["History"][0]
lastState = eventMap
print(lastState)
if eventMap["eventName"] == 'r1eabcbdc8f5378b2ba71a1b6fe2038b Created' or eventMap["eventName"] == 'Created':
change = {"changeType": "Created", "changedValue": "video_state", "previousValue": "", "newValue":"Created"}
print(change)
elif eventMap["eventName"] == "Restore":
change = {"changeType": "Restore", "changedValue": "", "previousValue": "", "newValue":""}
print(eventMap)
#change = {"changeType": "Restore", "changedValue": ""}
elif eventMap["eventName"] == "PositionChange":
change = {"changeType": "PositionChange", "changedValue": "position", "previousValue": eventMap["position"], "newValue":""}
print(eventMap)
change = {"changeType": "PositionChange", "changedValue": "position", "previousValue": historyList[i-1]["position"], "newValue": eventMap["position"]}
print(change)
elif eventMap["eventName"] == "Hide":
print(eventMap)
change = {"changeType": "Hide", "changedValue": "video_state", "previousValue": historyList[i-1]["video_state"], "newValue": eventMap["video_state"]}
print(change)
elif eventMap["eventName"] == "Publish":
print(eventMap)
change = {"changeType": "Publish", "changedValue": "video_state", "previousValue": historyList[i-1]["video_state"], "newValue":eventMap["video_state"]}
print(change)
elif eventMap["eventName"] == "CMNote":
print(eventMap)
change = {"changeType": "CMNote", "changedValue": "communityManagerNotes", "previousValue": historyList[i-1]["communityManagerNotes"], "newValue":eventMap["communityManagerNotes"]}
print(change)
elif eventMap["eventName"] == "Move":
print(eventMap)
change = {"changeType": "Move", "changedValue": "position", "previousValue": historyList[i-1]["position"], "newValue":eventMap["position"]}
print(change)
elif eventMap["eventName"] == "VideoType":
print(eventMap)
change = {"changeType": "VideoType", "changedValue": "video_type", "previousValue": historyList[i-1]["video_type"], "newValue":eventMap["video_type"]}
print(change)
elif eventMap["eventName"] == "Delete":
print(eventMap)
change = {"changeType": "Delete", "changedValue": "", "previousValue": "", "newValue": ""}
print(change)
elif eventMap["eventName"] == "Copy":
print(eventMap)
change = {"changeType": "Copy", "changedValue": "", "previousValue": "", "newValue":""}
print(change)
elif eventMap["eventName"] == "CustomLabel":
print(eventMap)
change = {"changeType": "CustomLabel", "changedValue": "label", "previousValue": historyList[i-1]["label"], "newValue":eventMap["label"]}
print(change)
i += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment