feat: migrate persistence from JSON to SQLModel (Phase 1)
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled

- Integrated SQLModel with SQLite for robust data persistence
- Refactored UserManager and WatchlistManager to use SQL queries
- Migrated models to SQLModel with relationships and primary keys
- Updated test suite with in-memory database isolation
- Removed deprecated JSON storage files
This commit is contained in:
root
2026-03-24 10:40:36 +00:00
parent d4d8d8a3b6
commit 29c7040b20
13 changed files with 596 additions and 1165 deletions
-92
View File
@@ -1,92 +0,0 @@
{
"testuser": {
"id": "ae5deb822e0d71992900471a7199d0d9",
"username": "testuser",
"email": "test@example.com",
"full_name": "Test User",
"hashed_password": "$2b$12$gDgt6xCBS4y2FgNrCk0JU.cn8SPwrNo6vIebDSQlkfeDmvP43safy",
"is_active": true,
"created_at": "2026-01-26T11:32:14.262592",
"last_login": "2026-01-26T12:18:26.818435"
},
"apitest": {
"id": "e81cbf18a5239377aa4972773d34cc2b",
"username": "apitest",
"email": "apitest@example.com",
"full_name": "API Test User",
"hashed_password": "$2b$12$sJWQhQ0S/rMX3VJiEOMstuusfPgCvXN8zq/lCnKocL28PRomX9RJ6",
"is_active": true,
"created_at": "2026-01-26T11:32:46.943188",
"last_login": "2026-01-26T11:32:47.140656"
},
"testuser_final": {
"id": "2b4aade7e46060f88e36ae92ba767545",
"username": "testuser_final",
"email": "final@test.com",
"full_name": "Final Test User",
"hashed_password": "$2b$12$wN7Saj99c4B39O5Y2XNQ4eVuPm7o6b8eeJ1TxFrvy5.g7ycyh9rKm",
"is_active": true,
"created_at": "2026-01-26T11:33:45.726090",
"last_login": "2026-01-26T11:33:46.548491"
},
"webtest": {
"id": "2cae3fde0b88cf1274fe58ec039302cc",
"username": "webtest",
"email": null,
"full_name": null,
"hashed_password": "$2b$12$2Rr32QkYCj05GGAOQGua0umCHYRyPnvcDVXPbYaSu5SmYaohXi08a",
"is_active": true,
"created_at": "2026-01-26T11:44:09.995999",
"last_login": "2026-01-26T11:44:10.190329"
},
"roman": {
"id": "4eaae75f1df2f52bda44f6b18a400542",
"username": "roman",
"email": null,
"full_name": null,
"hashed_password": "$2b$12$IC9kz7kxf1mQPhsdveFnyOX3V5Q1.pB9/uqCKWI7nhn.SYamtvxCC",
"is_active": true,
"created_at": "2026-01-26T12:15:58.008205",
"last_login": "2026-03-23T13:29:45.076454"
},
"testuser999": {
"id": "f9abf4b8aa96d5116807ac1cf8540418",
"username": "testuser999",
"email": null,
"full_name": null,
"hashed_password": "$2b$12$y2uy62IR0xVmCcUmQ8gL6.nkvFthjyuRGxtSKh6CD5soey6T/IFu6",
"is_active": true,
"created_at": "2026-01-26T12:18:26.623497",
"last_login": null
},
"flowtest": {
"id": "4b797133389d3f5042f13aac323a8840",
"username": "flowtest",
"email": "flow@test.com",
"full_name": null,
"hashed_password": "$2b$12$Dcb7fKZPycLRsW851m9pk.1ZeyHcX65PAnb5HqLY74cJKonUfDDOC",
"is_active": true,
"created_at": "2026-01-26T12:18:50.138613",
"last_login": "2026-01-26T12:18:50.332004"
},
"e2etest": {
"id": "37a97310cedfe6ae001033c2b9832f6c",
"username": "e2etest",
"email": null,
"full_name": null,
"hashed_password": "$2b$12$uV9AW1qrbLC2tOCk1Gs4x.clk1v7jPNteHmn/Nby/Lelopb9Ce60m",
"is_active": true,
"created_at": "2026-02-26T16:01:01.051127",
"last_login": "2026-02-26T16:11:48.431566"
},
"fronttest": {
"id": "059c564b78528d334f5ac4ecce3ea894",
"username": "fronttest",
"email": "front@test.com",
"full_name": null,
"hashed_password": "$2b$12$qkZxcN9peGfWSj59ULm6S.5ROtFlF7fGXJpypD7cQ0N9TzDRl93z.",
"is_active": true,
"created_at": "2026-02-28T09:41:38.411958",
"last_login": "2026-03-01T16:24:30.918490"
}
}
-62
View File
@@ -1,62 +0,0 @@
{
"2293bca2-c1c2-4e4f-8862-c4a6601f2b6f": {
"id": "2293bca2-c1c2-4e4f-8862-c4a6601f2b6f",
"user_id": "test_user_1",
"anime_title": "Test Anime",
"anime_url": "https://anime-sama.si/catalogue/test/vostfr/",
"provider_id": "animesama",
"lang": "vostfr",
"last_checked": "2026-03-24T08:45:18.470468",
"last_episode_downloaded": 0,
"total_episodes": null,
"auto_download": true,
"quality_preference": "auto",
"status": "active",
"poster_image": null,
"cover_image": null,
"synopsis": null,
"genres": [],
"added_at": "2026-01-29T21:53:38.078765",
"updated_at": "2026-03-24T08:45:18.470487"
},
"a5270097-d883-45b9-ad86-538a39c51e91": {
"id": "a5270097-d883-45b9-ad86-538a39c51e91",
"user_id": "059c564b78528d334f5ac4ecce3ea894",
"anime_title": "Frieren",
"anime_url": "https://anime-sama.tv/catalogue/frieren/saison1/vostfr/",
"provider_id": "anime-sama",
"lang": "vostfr",
"last_checked": "2026-03-24T08:45:18.849516",
"last_episode_downloaded": 28,
"total_episodes": 6,
"auto_download": true,
"quality_preference": "auto",
"status": "active",
"poster_image": null,
"cover_image": null,
"synopsis": null,
"genres": [],
"added_at": "2026-02-28T09:42:38.806576",
"updated_at": "2026-03-24T08:45:18.849533"
},
"944b598b-2bc8-4cd8-8a7b-8d84b7342c26": {
"id": "944b598b-2bc8-4cd8-8a7b-8d84b7342c26",
"user_id": "4eaae75f1df2f52bda44f6b18a400542",
"anime_title": "Frieren",
"anime_url": "https://anime-sama.tv/catalogue/frieren/saison1/vostfr/",
"provider_id": "anime-sama",
"lang": "vostfr",
"last_checked": "2026-03-24T08:45:19.136113",
"last_episode_downloaded": 28,
"total_episodes": 6,
"auto_download": true,
"quality_preference": "auto",
"status": "active",
"poster_image": "https://raw.githubusercontent.com/Anime-Sama/IMG/img/contenu/frieren0.jpg",
"cover_image": null,
"synopsis": null,
"genres": [],
"added_at": "2026-02-28T15:47:09.168943",
"updated_at": "2026-03-24T08:45:19.136131"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"check_interval_hours": 6,
"auto_download_enabled": true,
"check_interval_hours": 12,
"auto_download_enabled": false,
"max_concurrent_auto_downloads": 2,
"notify_on_new_episodes": false,
"include_completed_anime": false