|
|
@ -242,6 +242,27 @@ class ChangeDetectionStore:
|
|
|
|
|
|
|
|
|
|
|
|
self.needs_write = True
|
|
|
|
self.needs_write = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Clone a watch by UUID
|
|
|
|
|
|
|
|
def clone(self, uuid):
|
|
|
|
|
|
|
|
with self.lock:
|
|
|
|
|
|
|
|
new_uuid = str(uuid_builder.uuid4())
|
|
|
|
|
|
|
|
_clone = deepcopy(self.data['watching'][uuid])
|
|
|
|
|
|
|
|
_clone.update({'uuid': new_uuid})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attributes_to_reset = [
|
|
|
|
|
|
|
|
'last_checked',
|
|
|
|
|
|
|
|
'last_changed',
|
|
|
|
|
|
|
|
'last_viewed',
|
|
|
|
|
|
|
|
'newest_history_key',
|
|
|
|
|
|
|
|
'previous_md5',
|
|
|
|
|
|
|
|
'history'
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
for attribute in attributes_to_reset:
|
|
|
|
|
|
|
|
_clone.update({attribute: self.generic_definition[attribute]})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.data['watching'][new_uuid] = _clone
|
|
|
|
|
|
|
|
self.needs_write = True
|
|
|
|
|
|
|
|
|
|
|
|
def url_exists(self, url):
|
|
|
|
def url_exists(self, url):
|
|
|
|
|
|
|
|
|
|
|
|
# Probably their should be dict...
|
|
|
|
# Probably their should be dict...
|
|
|
|