Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions backend/beets_flask/database/models/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from __future__ import annotations

from collections.abc import Mapping, Sequence
from datetime import datetime
from datetime import UTC, datetime
from typing import Any, Self
from uuid import uuid4

import pytz
from sqlalchemy import LargeBinary, select
from sqlalchemy.orm import (
DeclarativeBase,
Expand Down Expand Up @@ -115,6 +114,6 @@ def _sqlalchemy_reconstructor(self):
# Seems a bit hacky but is the only way to ensure that
# datetime objects are timezone-aware after deserialization
if self.created_at and self.created_at.tzinfo is None:
self.created_at = self.created_at.replace(tzinfo=pytz.UTC)
self.created_at = self.created_at.replace(tzinfo=UTC)
if self.updated_at and self.updated_at.tzinfo is None:
self.updated_at = self.updated_at.replace(tzinfo=pytz.UTC)
self.updated_at = self.updated_at.replace(tzinfo=UTC)
7 changes: 4 additions & 3 deletions backend/beets_flask/importer/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def get_config_value(self, key: str, type_func: Callable | None = None) -> Any:
"""Get a config value from the overlay or default.

TODO: remove or rework, this is finicky, and we should be able to come up
with something better now that we have our own config class.
with something better now that we have our own config class. This should
allow us to remove the type ignores below too.

Use dots to separate levels.
"""
Expand All @@ -275,8 +276,8 @@ def get_config_value(self, key: str, type_func: Callable | None = None) -> Any:
# the same as dict.get(), but rather resolves the value.
default = get_config().beets_config
for p in path:
default = default[p]
default = default.get(type_func) if type_func else default.get()
default = default[p] # type: ignore[assignment]
default = default.get(type_func) if type_func else default.get() # type: ignore
return default

# -------------------------- State handling helpers -------------------------- #
Expand Down
5 changes: 2 additions & 3 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "beets-flask"
description = "An opinionated web-interface around the music organizer [beets](https://beets.io/)"
version = "2.0.0-rc2"
version = "2.0.0-rc4"
authors = [
{ name = "F. Paul Spitzner", email = "paul.spitzner@gmail.com" },
{ name = "Sebastian B. Mohr", email = "sebastian@mohrenclan.de" },
Expand Down Expand Up @@ -60,7 +60,6 @@ typed = [
"types-cachetools",
"types-Deprecated",
"types-aiofiles",
"types-pytz",
"types-pyyaml",
"pandas-stubs",
]
Expand Down Expand Up @@ -117,7 +116,7 @@ fixable = ["ALL"]
convention = "numpy"

[tool.ruff.lint.isort]
known-first-party = ["beets_flask"]
known-first-party = ["beets_flask", "tests"]

[tool.pytest.ini_options]
# addopts = ["--import-mode=importlib", "--cov=beets_flask"]
Expand Down
6 changes: 2 additions & 4 deletions backend/tests/unit/test_database/test_dates.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import datetime
from pathlib import Path

import pytz

from beets_flask.database.models import SessionStateInDb
from beets_flask.importer.session import SessionState
from tests.mixins.database import IsolatedDBMixin
Expand Down Expand Up @@ -38,8 +36,8 @@ def test_dates(self, db_session_factory, tmpdir_factory):
# Check that the timezone is UTC
assert state_in_db.created_at.tzinfo is not None
assert state_in_db.updated_at.tzinfo is not None
assert state_in_db.created_at.tzinfo == pytz.UTC
assert state_in_db.updated_at.tzinfo == pytz.UTC
assert state_in_db.created_at.tzinfo == datetime.UTC
assert state_in_db.updated_at.tzinfo == datetime.UTC

# Should be approximately equal to current local time
now = datetime.datetime.now().astimezone()
Expand Down
901 changes: 446 additions & 455 deletions backend/uv.lock

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend",
"private": true,
"version": "2.0.0-rc2",
"version": "2.0.0-rc4",
"type": "module",
"scripts": {
"dev": "vite --host --cors",
Expand All @@ -18,48 +18,48 @@
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@lucide/lab": "^0.1.2",
"@mui/material": "^7.3.6",
"@tanstack/react-query": "^5.90.12",
"@tanstack/react-query-devtools": "^5.91.1",
"@tanstack/react-router": "^1.140.0",
"@tanstack/router-cli": "^1.140.0",
"@mui/material": "^7.3.9",
"@tanstack/react-query": "^5.90.21",
"@tanstack/react-query-devtools": "^5.91.3",
"@tanstack/react-router": "^1.167.4",
"@tanstack/router-cli": "^1.166.12",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"diff": "^8.0.2",
"diff": "^8.0.3",
"lucide-react": "^0.546.0",
"react": "^19.2.1",
"react-dom": "^19.2.1",
"react-error-boundary": "^6.0.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-error-boundary": "^6.1.1",
"react-virtualized-auto-sizer": "^1.0.26",
"react-window": "^2.2.3",
"sass": "^1.95.0",
"socket.io-client": "^4.8.1",
"wavesurfer.js": "^7.12.1"
"react-window": "^2.2.7",
"sass": "^1.98.0",
"socket.io-client": "^4.8.3",
"wavesurfer.js": "^7.12.4"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@tanstack/eslint-plugin-query": "^5.91.2",
"@tanstack/router-plugin": "^1.140.0",
"@types/node": "^24.10.2",
"@eslint/js": "^9.39.4",
"@tanstack/eslint-plugin-query": "^5.91.4",
"@tanstack/router-plugin": "^1.166.13",
"@types/node": "^24.12.0",
"@types/react": "19.2.1",
"@types/react-dom": "19.2.1",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"@vitejs/plugin-react": "^5.1.2",
"@vitejs/plugin-react-swc": "^4.2.2",
"@typescript-eslint/eslint-plugin": "^8.57.1",
"@typescript-eslint/parser": "^8.57.1",
"@vitejs/plugin-react": "^5.2.0",
"@vitejs/plugin-react-swc": "^4.3.0",
"babel-plugin-react-compiler": "1.0.0",
"eslint": "^9.39.1",
"eslint": "^9.39.4",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "7.0.0",
"eslint-plugin-react-refresh": "^0.4.24",
"eslint-plugin-react-refresh": "^0.4.26",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^16.5.0",
"postcss": "^8.5.6",
"prettier": "^3.7.4",
"postcss": "^8.5.8",
"prettier": "^3.8.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.49.0",
"vite": "^7.2.7",
"typescript-eslint": "^8.57.1",
"vite": "^7.3.1",
"vite-plugin-svgr": "^4.5.0",
"vite-tsconfig-paths": "^5.1.4"
},
Expand Down
Loading
Loading