|
@@ -9,6 +9,7 @@ import os |
|
|
import random |
|
|
import random |
|
|
import string |
|
|
import string |
|
|
import time |
|
|
import time |
|
|
|
|
|
import unicodedata |
|
|
from dataclasses import dataclass |
|
|
from dataclasses import dataclass |
|
|
from datetime import date, datetime, timedelta |
|
|
from datetime import date, datetime, timedelta |
|
|
from typing import Any, Type, TypedDict, cast |
|
|
from typing import Any, Type, TypedDict, cast |
|
@@ -158,7 +159,7 @@ def update_tables ( |
|
|
for vt in video_tags: |
|
|
for vt in video_tags: |
|
|
tag = tag_dao.find (vt.tag_id) |
|
|
tag = tag_dao.find (vt.tag_id) |
|
|
if (tag is not None |
|
|
if (tag is not None |
|
|
and (tag.name.upper () not in map (str.upper, tag_names)) |
|
|
|
|
|
|
|
|
and (normalise (tag.name) not in map (normalise, tag_names)) |
|
|
and (tag.id_ is not None)): |
|
|
and (tag.id_ is not None)): |
|
|
tag_ids.append (tag.id_) |
|
|
tag_ids.append (tag.id_) |
|
|
video_tag_dao.untag_all (video.id_, tag_ids, now) |
|
|
video_tag_dao.untag_all (video.id_, tag_ids, now) |
|
@@ -1067,5 +1068,11 @@ class UserDto: |
|
|
id_: int | None = None |
|
|
id_: int | None = None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def normalise ( |
|
|
|
|
|
s: str |
|
|
|
|
|
) -> str: |
|
|
|
|
|
return unicodedata.normalize ('NFKC', s).lower () |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
main () |
|
|
main () |