diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 8e59d5e81..65e033f98 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -17,26 +17,28 @@ runtimes: - python@3.12.2 # This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) lint: + disabled: + - pyright enabled: - markdownlint@0.44.0 - - eslint@9.24.0 + - eslint@9.25.1 - actionlint@1.7.7 - bandit@1.8.3 - black@25.1.0 - - checkov@3.2.404 + - checkov@3.2.408 - git-diff-check - isort@6.0.1 - mypy@1.15.0 - osv-scanner@2.0.1 - oxipng@9.1.4 - prettier@3.5.3 - - ruff@0.11.5 + - ruff@0.11.6 - shellcheck@0.10.0 - shfmt@3.6.0 - svgo@3.3.2 - taplo@0.9.3 - - trivy@0.61.0 - - trufflehog@3.88.23 + - trivy@0.61.1 + - trufflehog@3.88.25 - yamllint@1.37.0 ignore: - linters: [ALL] diff --git a/backend/handler/database/roms_handler.py b/backend/handler/database/roms_handler.py index 9009822dd..e8473ec6b 100644 --- a/backend/handler/database/roms_handler.py +++ b/backend/handler/database/roms_handler.py @@ -7,11 +7,10 @@ from decorators.database import begin_session from models.collection import Collection, VirtualCollection from models.rom import Rom, RomFile, RomMetadata, RomUser from sqlalchemy import ( - BigInteger, Integer, - Numeric, Row, - SmallInteger, + String, + Text, and_, case, cast, @@ -423,9 +422,7 @@ class DBRomsHandler(DBBaseHandler): order_attr = Rom.name # Ignore case when the order attribute is a number - if not isinstance( - order_attr.type, (Integer, BigInteger, SmallInteger, Numeric) - ): + if isinstance(order_attr.type, (String, Text)): # Remove any leading articles order_attr = func.trim( func.lower(order_attr).regexp_replace(r"^(the|a|an)\s+", "", "i") diff --git a/backend/models/rom.py b/backend/models/rom.py index c22662134..9263783bc 100644 --- a/backend/models/rom.py +++ b/backend/models/rom.py @@ -260,10 +260,10 @@ class Rom(BaseModel): # # Metadata fields @property - def youtube_video_id(self) -> str: + def youtube_video_id(self) -> str | None: if self.igdb_metadata: - return self.igdb_metadata.get("youtube_video_id", "") - return "" + return self.igdb_metadata.get("youtube_video_id", None) + return None @property def alternative_names(self) -> list[str]: