Support tagging unwanted representations for deletion.

This commit is contained in:
Toke Jepsen 2019-07-23 12:41:43 +01:00
parent 5547cec38c
commit ca2baae479
2 changed files with 11 additions and 2 deletions

View file

@ -82,10 +82,19 @@ class ExtractBurnin(pype.api.Extractor):
if os.path.exists(full_burnin_path):
repre_update = {
"files": movieFileBurnin,
"name": repre["name"]
"name": repre["name"],
"tags": [x for x in repre["tags"] if x != "delete"]
}
instance.data["representations"][i].update(repre_update)
# removing the source mov file
os.remove(full_movie_path)
self.log.debug("Removed: `{}`".format(full_movie_path))
# Remove any representations tagged for deletion.
for repre in instance.data["representations"]:
if "delete" in repre.get("tags", []):
self.log.debug("Removing representation: {}".format(repre))
instance.data["representations"].remove(repre)
self.log.debug(instance.data["representations"])