■ ■ ■ ■ ■ ■
changedetectionio/store.py
| skipped 250 lines |
251 | 251 | | |
252 | 252 | | # Clone a watch by UUID |
253 | 253 | | def clone(self, uuid): |
254 | | - | with self.lock: |
255 | | - | new_uuid = str(uuid_builder.uuid4()) |
256 | | - | _clone = deepcopy(self.data['watching'][uuid]) |
257 | | - | _clone.update({'uuid': new_uuid}) |
258 | | - | |
259 | | - | attributes_to_reset = [ |
260 | | - | 'last_checked', |
261 | | - | 'last_changed', |
262 | | - | 'last_viewed', |
263 | | - | 'newest_history_key', |
264 | | - | 'previous_md5', |
265 | | - | 'history' |
266 | | - | ] |
267 | | - | for attribute in attributes_to_reset: |
268 | | - | _clone.update({attribute: self.generic_definition[attribute]}) |
269 | | - | |
270 | | - | self.data['watching'][new_uuid] = _clone |
271 | | - | self.needs_write = True |
| 254 | + | url = self.data['watching'][uuid]['url'] |
| 255 | + | tag = self.data['watching'][uuid]['tag'] |
| 256 | + | new_uuid = self.add_watch(url=url, tag=tag) |
| 257 | + | return new_uuid |
272 | 258 | | |
273 | 259 | | def url_exists(self, url): |
274 | 260 | | |
| skipped 137 lines |