Browse Source

Merge branch 'main' into feature/query

feature/query
みてるぞ 1 month ago
parent
commit
6185788456
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      update_db.py

+ 8
- 1
update_db.py View File

@@ -9,6 +9,7 @@ import os
import random
import string
import time
import unicodedata
from dataclasses import dataclass
from datetime import date, datetime, timedelta
from typing import Any, Type, TypedDict, cast
@@ -60,7 +61,7 @@ def update_tables (
for video_tag in video_tags:
tag = video_tag.tag
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))):
video_tag.untagged_at = now
video_tag.save ()
for tag_name in tag_names:
@@ -402,5 +403,11 @@ class VideoTagRow (TypedDict):
untagged_at: date | None


def normalise (
s: str
) -> str:
return unicodedata.normalize ('NFKC', s).lower ()


if __name__ == '__main__':
main ()

Loading…
Cancel
Save