Add update channel selection and TMDB setup docs

This commit is contained in:
2026-02-20 13:42:24 +01:00
parent b56757f42a
commit 1ee15cd104
3 changed files with 45 additions and 3 deletions

View File

@@ -29,6 +29,20 @@ Es durchsucht Provider und startet Streams.
- Plugins: `addon/plugins/*_plugin.py`
- Settings: `addon/resources/settings.xml`
## TMDB API Key einrichten
- TMDB Account anlegen und API Key (v3) erstellen: `https://www.themoviedb.org/settings/api`
- In Kodi das ViewIT Addon oeffnen: `Einstellungen -> TMDB`
- `TMDB aktivieren` einschalten
- `TMDB API Key` eintragen
- Optional `TMDB Sprache` setzen (z. B. `de-DE`)
- Optional die Anzeige-Optionen aktivieren/deaktivieren:
- `TMDB Beschreibung anzeigen`
- `TMDB Poster und Vorschaubild anzeigen`
- `TMDB Fanart/Backdrop anzeigen`
- `TMDB Bewertung anzeigen`
- `TMDB Stimmen anzeigen`
- `TMDB Besetzung anzeigen`
## Tests
- Dev Pakete installieren: `./.venv/bin/pip install -r requirements-dev.txt`
- Tests starten: `./.venv/bin/pytest`

View File

@@ -1011,6 +1011,32 @@ def _normalize_update_info_url(raw: str) -> str:
return value.rstrip("/") + "/addons.xml"
UPDATE_CHANNEL_MAIN = 0
UPDATE_CHANNEL_NIGHTLY = 1
UPDATE_CHANNEL_CUSTOM = 2
def _selected_update_channel() -> int:
channel = _get_setting_int("update_channel", default=UPDATE_CHANNEL_MAIN)
if channel not in {UPDATE_CHANNEL_MAIN, UPDATE_CHANNEL_NIGHTLY, UPDATE_CHANNEL_CUSTOM}:
return UPDATE_CHANNEL_MAIN
return channel
def _resolve_update_info_url() -> str:
channel = _selected_update_channel()
if channel == UPDATE_CHANNEL_NIGHTLY:
raw = _get_setting_string("update_repo_url_nightly")
elif channel == UPDATE_CHANNEL_CUSTOM:
raw = _get_setting_string("update_repo_url")
else:
raw = _get_setting_string("update_repo_url_main")
info_url = _normalize_update_info_url(raw)
# Legacy-Setting beibehalten, damit bestehende Installationen und alte Builds weiterlaufen.
_set_setting_string("update_repo_url", info_url)
return info_url
def _repo_addon_xml_path() -> str:
if xbmcvfs is None:
return ""
@@ -3062,8 +3088,7 @@ def _run_update_check() -> None:
if xbmc is None: # pragma: no cover - outside Kodi
return
try:
info_url = _normalize_update_info_url(_get_setting_string("update_repo_url"))
_set_setting_string("update_repo_url", info_url)
info_url = _resolve_update_info_url()
_sync_update_version_settings()
_update_repository_source(info_url)
builtin = getattr(xbmc, "executebuiltin", None)

View File

@@ -71,7 +71,10 @@
<setting id="tmdb_log_responses" type="bool" label="TMDB API-Antworten loggen" default="false" />
</category>
<category label="Update">
<setting id="update_repo_url" type="text" label="Update-URL (addons.xml)" default="http://127.0.0.1:8080/repo/addons.xml" />
<setting id="update_channel" type="enum" label="Update-Kanal" default="0" values="Main|Nightly|Custom" />
<setting id="update_repo_url_main" type="text" label="Main URL (addons.xml)" default="https://gitea.it-drui.de/viewit/ViewIT-Kodi-Repo/raw/branch/main/addons.xml" />
<setting id="update_repo_url_nightly" type="text" label="Nightly URL (addons.xml)" default="https://gitea.it-drui.de/viewit/ViewIT-Kodi-Repo/raw/branch/nightly/addons.xml" />
<setting id="update_repo_url" type="text" label="Custom URL (addons.xml)" default="http://127.0.0.1:8080/repo/addons.xml" />
<setting id="run_update_check" type="action" label="Jetzt nach Updates suchen" action="RunPlugin(plugin://plugin.video.viewit/?action=check_updates)" option="close" />
<setting id="update_info" type="text" label="Updates laufen ueber den normalen Kodi-Update-Mechanismus." default="" enable="false" />
<setting id="update_version_addon" type="text" label="ViewIT Version" default="-" enable="false" />