File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,11 @@ def write_link_to_sql_index(link: Link):
34
34
from core .models import Snapshot , ArchiveResult
35
35
info = {k : v for k , v in link ._asdict ().items () if k in Snapshot .keys }
36
36
tags = info .pop ("tags" )
37
- if tags is None :
38
- tags = []
37
+
38
+ tag_set = (
39
+ set (tag .strip () for tag in (link .tags or '' ).split (',' ))
40
+ )
41
+ tag_list = list (tag_set ) or []
39
42
40
43
try :
41
44
info ["timestamp" ] = Snapshot .objects .get (url = link .url ).timestamp
@@ -44,7 +47,7 @@ def write_link_to_sql_index(link: Link):
44
47
info ["timestamp" ] = str (float (info ["timestamp" ]) + 1.0 )
45
48
46
49
snapshot , _ = Snapshot .objects .update_or_create (url = link .url , defaults = info )
47
- snapshot .save_tags (tags )
50
+ snapshot .save_tags (tag_list )
48
51
49
52
for extractor , entries in link .history .items ():
50
53
for entry in entries :
You can’t perform that action at this time.
0 commit comments