Add torrent streamer, UI overhaul, switch to GPL

Major updates: adds a libtorrent-based streaming service and refactors UI/behaviour.

Key changes:
- Add streaming service (src/kadr/services/streamer.py): HTTP server + sequential download streamer using libtorrent, StreamLog, buffering/ready states and local streaming URL.
- Rework Detail view (src/kadr/views/detail.py): new hero/backdrop layout, poster sizing, metadata chips, tagline, overview, cast placeholder and a "Watch" action that navigates to a Torrents view; loads full TMDB details/credits asynchronously.
- UI styling (src/kadr/data/style.css): many new classes for detail/hero/cast styling.
- Downloads manager improvements (src/kadr/services/downloads.py): temp dir for torrents, cleanup of stale files, history size cap, unified client launch with error handling.
- TMDB client refactor (src/kadr/services/tmdb.py): unified _fetch helper, added movie_credits/tv_credits endpoints.
- Utils improvements (src/kadr/utils.py): thread-safe LRU image cache, image download concurrency, and slight clipboard command ordering tweak.
- Jackett servers list updated (src/kadr/services/jackett.py): reorder/add servers.
- Project metadata & licensing: switch LICENSE to GPL-3.0-or-later, update pyproject.toml and application about dialog to GPL, adjust package/version in pyproject and __init__.
- README revamped (README.md): reorganized, added badges, Russian text, install/usage sections.
- Added new view/widget files (player/torrents/mpv_widget) and other UI tweaks across widgets/window.

These changes add streaming playback capability, tighten resource handling, and refresh the detail UI while changing the project license to GPL-3.0-or-later.
This commit is contained in:
2026-04-01 22:00:37 +10:00
parent 3508a7c5dd
commit 32fe518259
18 changed files with 1807 additions and 354 deletions
+18 -27
View File
@@ -56,47 +56,38 @@ class TMDBService:
return None
return f"{self._proxy['image_url']}/t/p/{size}{path}"
def search_movies(self, query, page=1):
url = self._api_url('/search/movie', query=query, page=page)
resp = self.session.get(url, timeout=15)
def _fetch(self, path, timeout=10, **params):
url = self._api_url(path, **params)
resp = self.session.get(url, timeout=timeout)
resp.raise_for_status()
return resp.json()
def search_movies(self, query, page=1):
return self._fetch('/search/movie', query=query, page=page)
def search_tv(self, query, page=1):
url = self._api_url('/search/tv', query=query, page=page)
resp = self.session.get(url, timeout=15)
resp.raise_for_status()
return resp.json()
return self._fetch('/search/tv', query=query, page=page)
def popular_movies(self, page=1):
url = self._api_url('/movie/popular', page=page)
resp = self.session.get(url, timeout=15)
resp.raise_for_status()
return resp.json()
return self._fetch('/movie/popular', page=page)
def popular_tv(self, page=1):
url = self._api_url('/tv/popular', page=page)
resp = self.session.get(url, timeout=15)
resp.raise_for_status()
return resp.json()
return self._fetch('/tv/popular', page=page)
def movie_details(self, movie_id):
url = self._api_url(f'/movie/{int(movie_id)}')
resp = self.session.get(url, timeout=15)
resp.raise_for_status()
return resp.json()
return self._fetch(f'/movie/{int(movie_id)}')
def tv_details(self, tv_id):
url = self._api_url(f'/tv/{int(tv_id)}')
resp = self.session.get(url, timeout=15)
resp.raise_for_status()
return resp.json()
return self._fetch(f'/tv/{int(tv_id)}')
def movie_credits(self, movie_id):
return self._fetch(f'/movie/{int(movie_id)}/credits')
def tv_credits(self, tv_id):
return self._fetch(f'/tv/{int(tv_id)}/credits')
def genres(self, media_type='movie'):
url = self._api_url(f'/genre/{media_type}/list')
resp = self.session.get(url, timeout=15)
resp.raise_for_status()
return resp.json().get('genres', [])
return self._fetch(f'/genre/{media_type}/list').get('genres', [])
def check_health(self, proxy_id):
proxy = TMDB_PROXIES.get(proxy_id)