Skip to content

Commit c2ef7fe

Browse files
authored
Fix missing imdb response handling (#34)
* Fix omdb response handling * Remove next and prev buttom from pagination * Update screenshots * Remove unused background image * Update Makefile * version bump
1 parent 840802b commit c2ef7fe

9 files changed

Lines changed: 20 additions & 14 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ reqs:
2222

2323
format:
2424
$(ACTIVATE) && black service/
25+
cd frontend && pnpm format
2526

2627
lint:
2728
$(ACTIVATE) && python -m pylint service/
28-
cd frontend && pnpm lint
2929

3030
start-backend:
3131
source .env.sh && $(ACTIVATE) && uvicorn service.main:app --host 0.0.0.0 --port 8000 --reload

doc/images/screenshots/imdb.png

-131 KB
Loading
1.41 KB
Loading

frontend/src/Manage/Imdb/Imdb.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ export const Imdb = () => {
232232
count={searchResults.meta.totalPages}
233233
onChange={submitPageChange}
234234
disabled={isLoading}
235+
hideNextButton
236+
hidePrevButton
235237
/>
236238
</Box>
237239
)}

images/background.xcf

-3.01 MB
Binary file not shown.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "CDMServer"
3-
version = "2.1.0"
3+
version = "2.1.1"
44
description = "A short description of your project"
55
authors = [{name = "Aron Radics", email = "radics.aron.jozsef@gmail.com"}]
66
requires-python = ">=3.13"

service/api/client.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,18 @@ async def add_device(data: StatusData, session: AsyncSession = Depends(get_sessi
6262

6363
torrents_adapter = TorrentsAdapter()
6464
for item in data.data:
65-
torrent = TorrentStatus.model_validate({
66-
"id": item.id,
67-
"name": item.name,
68-
"status": item.status,
69-
"progress": item.progress,
70-
"download_dir": item.download_dir,
71-
"added_date": item.added_date,
72-
"total_size": item.total_size,
73-
"eta": item.eta,
74-
})
65+
torrent = TorrentStatus.model_validate(
66+
{
67+
"id": item.id,
68+
"name": item.name,
69+
"status": item.status,
70+
"progress": item.progress,
71+
"download_dir": item.download_dir,
72+
"added_date": item.added_date,
73+
"total_size": item.total_size,
74+
"eta": item.eta,
75+
}
76+
)
7577
await torrents_adapter.set_torrent(device.id, torrent)
7678

7779
return JSONResponse({"message": "Status updated"}, status_code=200)

service/models/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class OmdbSearchEntityData(OmdbBaseData):
173173

174174
class OmdbSearchData(OmdbBaseData):
175175
search: list[OmdbSearchEntityData] = []
176-
total_results: str
176+
total_results: int = 0
177177
response: str
178178

179179

@@ -186,9 +186,11 @@ class OmdbSearchEntityResponse(BaseData):
186186
title: str
187187
year: str
188188

189+
189190
class OmdbSearchResponseMeta(BaseData):
190191
total_pages: int = 0
191192

193+
192194
class OmdbSearchResponse(BaseData):
193195
data: list[OmdbSearchEntityResponse]
194196
meta: OmdbSearchResponseMeta

service/torrents_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from service.util.configuration import REDIS_HOST, REDIS_PORT
55

66

7-
EXPIRATION_TIME = 60 # 60 seconds
7+
EXPIRATION_TIME = 60 # 60 seconds
88

99

1010
class TorrentStatus(BaseModel):

0 commit comments

Comments
 (0)