weed-cli 1.6.8__tar.gz → 1.7.0__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.
- {weed_cli-1.6.8/weed_cli.egg-info → weed_cli-1.7.0}/PKG-INFO +1 -1
- {weed_cli-1.6.8 → weed_cli-1.7.0}/pyproject.toml +1 -1
- {weed_cli-1.6.8 → weed_cli-1.7.0}/web_ui.py +20 -15
- {weed_cli-1.6.8 → weed_cli-1.7.0/weed_cli.egg-info}/PKG-INFO +1 -1
- {weed_cli-1.6.8 → weed_cli-1.7.0}/LICENSE +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/README.md +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/dht.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/discovery_relay.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/lightning_settle.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/node.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/poc_reputation.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/setup.cfg +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/shell.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/tunnel_relay.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/weed.py +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/weed_cli.egg-info/SOURCES.txt +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/weed_cli.egg-info/dependency_links.txt +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/weed_cli.egg-info/entry_points.txt +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/weed_cli.egg-info/requires.txt +0 -0
- {weed_cli-1.6.8 → weed_cli-1.7.0}/weed_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: weed-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Censorship-resistant video PoC — discovery/hosting/download over signed relay events, a real Kademlia DHT, or a TLS-capable NAT-traversal tunnel
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: p2p,video,censorship-resistant,discovery,dht,kademlia,nat-traversal
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "weed-cli"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.7.0"
|
|
8
8
|
description = "Censorship-resistant video PoC — discovery/hosting/download over signed relay events, a real Kademlia DHT, or a TLS-capable NAT-traversal tunnel"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -565,7 +565,7 @@ class Handler(BaseHTTPRequestHandler):
|
|
|
565
565
|
'/api/playlists/delete': self._handle_playlist_delete,
|
|
566
566
|
'/api/playlists/add': self._handle_playlist_add,
|
|
567
567
|
'/api/playlists/remove': self._handle_playlist_remove,
|
|
568
|
-
'/api/playlists/
|
|
568
|
+
'/api/playlists/reorder': self._handle_playlist_reorder,
|
|
569
569
|
}
|
|
570
570
|
handler = handlers.get(path)
|
|
571
571
|
if not handler:
|
|
@@ -711,25 +711,30 @@ class Handler(BaseHTTPRequestHandler):
|
|
|
711
711
|
_save_library()
|
|
712
712
|
self._json({'playlist': playlist})
|
|
713
713
|
|
|
714
|
-
def
|
|
714
|
+
def _handle_playlist_reorder(self, body):
|
|
715
|
+
"""Whole-list reorder (drag-and-drop's own natural shape) rather
|
|
716
|
+
than one-step-at-a-time move -- a real drag can jump an item
|
|
717
|
+
several positions in one gesture, and doing that as N sequential
|
|
718
|
+
up/down calls (the earlier arrow-button UI's own approach) is both
|
|
719
|
+
chattier and racier under Vue's own optimistic local reorder than
|
|
720
|
+
just telling the server the whole new order in one call."""
|
|
715
721
|
playlist_id = body.get('playlist_id')
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
return self._json({'error': "playlist_id, content_hash, and direction ('up'|'down') required"},
|
|
720
|
-
status=400)
|
|
722
|
+
order = body.get('order')
|
|
723
|
+
if not playlist_id or not isinstance(order, list):
|
|
724
|
+
return self._json({'error': 'playlist_id and order (list of content_hash) required'}, status=400)
|
|
721
725
|
with _lock:
|
|
722
726
|
playlist = next((p for p in _library['playlists'] if p['id'] == playlist_id), None)
|
|
723
727
|
if not playlist:
|
|
724
728
|
return self._json({'error': 'no such playlist'}, status=404)
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
729
|
+
by_hash = {it['content_hash']: it for it in playlist['items']}
|
|
730
|
+
# order is trusted for *sequence* only, not as the source of
|
|
731
|
+
# truth for membership -- an item order somehow omits (a stale
|
|
732
|
+
# client, a concurrent add from another tab) stays in the
|
|
733
|
+
# playlist, just at the end, rather than silently vanishing
|
|
734
|
+
reordered = [by_hash.pop(h) for h in order if h in by_hash]
|
|
735
|
+
reordered.extend(by_hash.values())
|
|
736
|
+
playlist['items'] = reordered
|
|
737
|
+
_save_library()
|
|
733
738
|
self._json({'playlist': playlist})
|
|
734
739
|
|
|
735
740
|
def _handle_verify(self, body):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: weed-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Censorship-resistant video PoC — discovery/hosting/download over signed relay events, a real Kademlia DHT, or a TLS-capable NAT-traversal tunnel
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: p2p,video,censorship-resistant,discovery,dht,kademlia,nat-traversal
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|