torrent-downloader-react 1.0.18__tar.gz → 1.0.20__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/PKG-INFO +1 -1
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/setup.py +1 -1
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/server.py +10 -0
- torrent-downloader-react-1.0.20/torrent_downloader/static/assets/index-DFkOG9rp.js +49 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/static/index.html +1 -1
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/PKG-INFO +1 -1
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/SOURCES.txt +1 -1
- torrent-downloader-react-1.0.18/torrent_downloader/static/assets/index-BBEH9ldg.js +0 -49
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/setup.cfg +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/__init__.py +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/static/assets/index-CdUAChFP.css +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/static/vite.svg +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/dependency_links.txt +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/entry_points.txt +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/requires.txt +0 -0
- {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/top_level.txt +0 -0
{torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/server.py
RENAMED
@@ -88,6 +88,7 @@ class TorrentInfo(BaseModel):
|
|
88
88
|
name: str
|
89
89
|
progress: float
|
90
90
|
download_speed: float
|
91
|
+
upload_speed: float
|
91
92
|
state: str
|
92
93
|
total_size: int
|
93
94
|
downloaded: int
|
@@ -134,11 +135,14 @@ async def list_torrents() -> List[TorrentInfo]:
|
|
134
135
|
elif status.state == lt.torrent_status.paused:
|
135
136
|
state_str = "paused"
|
136
137
|
|
138
|
+
logging.debug(f"Torrent {torrent_id} state: {state_str} (raw state: {status.state})")
|
139
|
+
|
137
140
|
info = TorrentInfo(
|
138
141
|
id=torrent_id,
|
139
142
|
name=handle.name(),
|
140
143
|
progress=status.progress * 100,
|
141
144
|
download_speed=status.download_rate / 1024, # Convert to KB/s
|
145
|
+
upload_speed=status.upload_rate / 1024, # Convert to KB/s
|
142
146
|
state=state_str,
|
143
147
|
total_size=status.total_wanted,
|
144
148
|
downloaded=status.total_wanted_done
|
@@ -176,7 +180,11 @@ async def pause_torrent(torrent_id: str):
|
|
176
180
|
raise HTTPException(status_code=404, detail="Torrent not found")
|
177
181
|
|
178
182
|
handle = active_torrents[torrent_id]
|
183
|
+
logging.info(f"Pausing torrent {torrent_id}, current state: {handle.status().state}")
|
179
184
|
handle.pause()
|
185
|
+
# Force an immediate pause
|
186
|
+
handle.flush_cache()
|
187
|
+
logging.info(f"Torrent {torrent_id} paused, new state: {handle.status().state}")
|
180
188
|
return {"message": "Torrent paused successfully"}
|
181
189
|
|
182
190
|
@app.post("/api/torrent/{torrent_id}/resume")
|
@@ -186,7 +194,9 @@ async def resume_torrent(torrent_id: str):
|
|
186
194
|
raise HTTPException(status_code=404, detail="Torrent not found")
|
187
195
|
|
188
196
|
handle = active_torrents[torrent_id]
|
197
|
+
logging.info(f"Resuming torrent {torrent_id}, current state: {handle.status().state}")
|
189
198
|
handle.resume()
|
199
|
+
logging.info(f"Torrent {torrent_id} resumed, new state: {handle.status().state}")
|
190
200
|
return {"message": "Torrent resumed successfully"}
|
191
201
|
|
192
202
|
@app.post("/api/torrent/pause-all")
|