|
|
|
@ -249,6 +249,7 @@ class ChangeDetectionStore:
|
|
|
|
|
|
|
|
|
|
# Incase these are copied across, assume it's a reference and deepcopy()
|
|
|
|
|
apply_extras = deepcopy(extras)
|
|
|
|
|
apply_extras['tags'] = [] if not apply_extras.get('tags') else apply_extras.get('tags')
|
|
|
|
|
|
|
|
|
|
# Was it a share link? try to fetch the data
|
|
|
|
|
if (url.startswith("https://changedetection.io/share/")):
|
|
|
|
@ -298,14 +299,9 @@ class ChangeDetectionStore:
|
|
|
|
|
flash('Watch protocol is not permitted by SAFE_PROTOCOL_REGEX', 'error')
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
if extras.get('tags') and type(extras.get('tags')) == str:
|
|
|
|
|
extras['tags'] = list(extras.get('tags'))
|
|
|
|
|
|
|
|
|
|
if tag:
|
|
|
|
|
apply_extras['tags'] = []
|
|
|
|
|
if tag and type(tag) == str:
|
|
|
|
|
tag = [tag]
|
|
|
|
|
for t in tag:
|
|
|
|
|
if tag and type(tag) == str:
|
|
|
|
|
# Then it's probably a string of the actual tag by name, split and add it
|
|
|
|
|
for t in tag.split(','):
|
|
|
|
|
# for each stripped tag, add tag as UUID
|
|
|
|
|
for a_t in t.split(','):
|
|
|
|
|
tag_uuid = self.add_tag(a_t)
|
|
|
|
@ -315,6 +311,10 @@ class ChangeDetectionStore:
|
|
|
|
|
if tag_uuids:
|
|
|
|
|
apply_extras['tags'] = list(set(apply_extras['tags'] + tag_uuids))
|
|
|
|
|
|
|
|
|
|
# Make any uuids unique
|
|
|
|
|
if apply_extras.get('tags'):
|
|
|
|
|
apply_extras['tags'] = list(set(apply_extras.get('tags')))
|
|
|
|
|
|
|
|
|
|
new_watch = Watch.model(datastore_path=self.datastore_path, url=url)
|
|
|
|
|
|
|
|
|
|
new_uuid = new_watch.get('uuid')
|
|
|
|
|