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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (16) hide show
  1. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/PKG-INFO +1 -1
  2. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/setup.py +1 -1
  3. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/server.py +36 -0
  4. torrent-downloader-react-1.0.18/torrent_downloader/static/assets/index-BBEH9ldg.js +49 -0
  5. torrent-downloader-react-1.0.17/torrent_downloader/static/assets/index-DVy8AvwL.css → torrent-downloader-react-1.0.18/torrent_downloader/static/assets/index-CdUAChFP.css +1 -1
  6. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/static/index.html +2 -2
  7. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/PKG-INFO +1 -1
  8. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/SOURCES.txt +2 -2
  9. torrent-downloader-react-1.0.17/torrent_downloader/static/assets/index-BWN4x5dM.js +0 -49
  10. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/setup.cfg +0 -0
  11. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/__init__.py +0 -0
  12. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/static/vite.svg +0 -0
  13. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/dependency_links.txt +0 -0
  14. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/entry_points.txt +0 -0
  15. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/requires.txt +0 -0
  16. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/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.17
3
+ Version: 1.0.18
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.17",
10
+ version="1.0.18",
11
11
  packages=find_packages(),
12
12
  install_requires=[
13
13
  "fastapi>=0.109.0",
@@ -131,6 +131,8 @@ async def list_torrents() -> List[TorrentInfo]:
131
131
  state_str = "finished"
132
132
  elif status.state == lt.torrent_status.checking_files:
133
133
  state_str = "checking"
134
+ elif status.state == lt.torrent_status.paused:
135
+ state_str = "paused"
134
136
 
135
137
  info = TorrentInfo(
136
138
  id=torrent_id,
@@ -167,6 +169,40 @@ async def open_downloads():
167
169
  raise HTTPException(status_code=500, detail="Failed to open downloads folder")
168
170
  return {"message": "Downloads folder opened successfully"}
169
171
 
172
+ @app.post("/api/torrent/{torrent_id}/pause")
173
+ async def pause_torrent(torrent_id: str):
174
+ """Pause a specific torrent."""
175
+ if torrent_id not in active_torrents:
176
+ raise HTTPException(status_code=404, detail="Torrent not found")
177
+
178
+ handle = active_torrents[torrent_id]
179
+ handle.pause()
180
+ return {"message": "Torrent paused successfully"}
181
+
182
+ @app.post("/api/torrent/{torrent_id}/resume")
183
+ async def resume_torrent(torrent_id: str):
184
+ """Resume a specific torrent."""
185
+ if torrent_id not in active_torrents:
186
+ raise HTTPException(status_code=404, detail="Torrent not found")
187
+
188
+ handle = active_torrents[torrent_id]
189
+ handle.resume()
190
+ return {"message": "Torrent resumed successfully"}
191
+
192
+ @app.post("/api/torrent/pause-all")
193
+ async def pause_all_torrents():
194
+ """Pause all active torrents."""
195
+ for handle in active_torrents.values():
196
+ handle.pause()
197
+ return {"message": "All torrents paused successfully"}
198
+
199
+ @app.post("/api/torrent/resume-all")
200
+ async def resume_all_torrents():
201
+ """Resume all active torrents."""
202
+ for handle in active_torrents.values():
203
+ handle.resume()
204
+ return {"message": "All torrents resumed successfully"}
205
+
170
206
  def main():
171
207
  """Entry point for the application."""
172
208
  import uvicorn