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.
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/PKG-INFO +1 -1
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/setup.py +1 -1
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/server.py +36 -0
- torrent-downloader-react-1.0.18/torrent_downloader/static/assets/index-BBEH9ldg.js +49 -0
- 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
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/static/index.html +2 -2
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/PKG-INFO +1 -1
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/SOURCES.txt +2 -2
- torrent-downloader-react-1.0.17/torrent_downloader/static/assets/index-BWN4x5dM.js +0 -49
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/setup.cfg +0 -0
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/__init__.py +0 -0
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/static/vite.svg +0 -0
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/dependency_links.txt +0 -0
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/entry_points.txt +0 -0
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/requires.txt +0 -0
- {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader_react.egg-info/top_level.txt +0 -0
{torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.18}/torrent_downloader/server.py
RENAMED
@@ -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
|