torrent-downloader-react 1.0.16__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.16 → torrent-downloader-react-1.0.18}/PKG-INFO +1 -1
  2. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/setup.py +1 -1
  3. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader/server.py +39 -1
  4. torrent-downloader-react-1.0.18/torrent_downloader/static/assets/index-BBEH9ldg.js +49 -0
  5. torrent-downloader-react-1.0.16/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.16 → torrent-downloader-react-1.0.18}/torrent_downloader/static/index.html +2 -2
  7. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/PKG-INFO +1 -1
  8. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/SOURCES.txt +2 -2
  9. torrent-downloader-react-1.0.16/torrent_downloader/static/assets/index-BWN4x5dM.js +0 -49
  10. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/setup.cfg +0 -0
  11. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader/__init__.py +0 -0
  12. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader/static/vite.svg +0 -0
  13. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/dependency_links.txt +0 -0
  14. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/entry_points.txt +0 -0
  15. {torrent-downloader-react-1.0.16 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/requires.txt +0 -0
  16. {torrent-downloader-react-1.0.16 → 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.16
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.16",
10
+ version="1.0.18",
11
11
  packages=find_packages(),
12
12
  install_requires=[
13
13
  "fastapi>=0.109.0",
@@ -73,7 +73,9 @@ DOWNLOAD_PATH = get_downloads_dir()
73
73
 
74
74
  # Initialize libtorrent session
75
75
  session = lt.session()
76
- session.listen_on(6881, 6891)
76
+ settings = session.get_settings()
77
+ settings['listen_interfaces'] = '0.0.0.0:6881'
78
+ session.apply_settings(settings)
77
79
 
78
80
  # Store active torrents
79
81
  active_torrents: Dict[str, lt.torrent_handle] = {}
@@ -129,6 +131,8 @@ async def list_torrents() -> List[TorrentInfo]:
129
131
  state_str = "finished"
130
132
  elif status.state == lt.torrent_status.checking_files:
131
133
  state_str = "checking"
134
+ elif status.state == lt.torrent_status.paused:
135
+ state_str = "paused"
132
136
 
133
137
  info = TorrentInfo(
134
138
  id=torrent_id,
@@ -165,6 +169,40 @@ async def open_downloads():
165
169
  raise HTTPException(status_code=500, detail="Failed to open downloads folder")
166
170
  return {"message": "Downloads folder opened successfully"}
167
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
+
168
206
  def main():
169
207
  """Entry point for the application."""
170
208
  import uvicorn