torrent-downloader-react 1.0.18__tar.gz → 1.0.20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (16) hide show
  1. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/PKG-INFO +1 -1
  2. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/setup.py +1 -1
  3. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/server.py +10 -0
  4. torrent-downloader-react-1.0.20/torrent_downloader/static/assets/index-DFkOG9rp.js +49 -0
  5. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/static/index.html +1 -1
  6. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/PKG-INFO +1 -1
  7. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/SOURCES.txt +1 -1
  8. torrent-downloader-react-1.0.18/torrent_downloader/static/assets/index-BBEH9ldg.js +0 -49
  9. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/setup.cfg +0 -0
  10. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/__init__.py +0 -0
  11. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/static/assets/index-CdUAChFP.css +0 -0
  12. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader/static/vite.svg +0 -0
  13. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/dependency_links.txt +0 -0
  14. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/entry_points.txt +0 -0
  15. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/requires.txt +0 -0
  16. {torrent-downloader-react-1.0.18 → torrent-downloader-react-1.0.20}/torrent_downloader_react.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torrent-downloader-react
3
- Version: 1.0.18
3
+ Version: 1.0.20
4
4
  Summary: A modern, user-friendly torrent downloader application
5
5
  Home-page: https://github.com/yourusername/torrent-downloader
6
6
  Author: Your Name
@@ -7,7 +7,7 @@ with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.md"),
7
7
 
8
8
  setup(
9
9
  name="torrent-downloader-react",
10
- version="1.0.18",
10
+ version="1.0.20",
11
11
  packages=find_packages(),
12
12
  install_requires=[
13
13
  "fastapi>=0.109.0",
@@ -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")