Skip to content

Commit

Permalink
v1.4.12.41 beta 1
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdelsol committed Mar 15, 2024
1 parent c46f1e9 commit ef7bbc5
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 65 deletions.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
***Sfvip All*** wraps ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** to add new features:
* Insert an _All_ category when missing so you can easily **search your entire catalog**.
<kbd><img src="resources/readme/all.png"></kbd>
* Update ***[Mpv](https://mpv.io/)*** and ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** so you can enjoy their latest features.
* Translated in all ***Sfvip Player*** languages.
* Update ***[Mpv](https://mpv.io/)*** and **Sfvip Player** so you can enjoy their latest features.
* Translated in all **Sfvip Player** languages.
* Support an **external EPG**[^1].

[^1]: External EPG doesn't work with **local** m3u accounts.
Expand All @@ -17,32 +17,33 @@
[<a href="https://tooomm.github.io/github-release-stats/?username=sebdelsol&repository=sfvip-all"><img src="https://img.shields.io/github/downloads/sebdelsol/sfvip-all/total?color=informational&logo=github&labelColor=informational&style=flat-square" height="25"></a><a href="https://github.com/sebdelsol/sfvip-all/issues?q=is%3Aopen"><img src="https://img.shields.io/github/issues/sebdelsol/sfvip-all?labelColor=success&style=flat-square" height="25"></a>]()

* Check the [***changelog***](build/changelog.md) and ***notes***[^2].
* [***Sfvip Player***](https://github.com/K4L4Uz/SFVIP-Player/tree/master) will be automatically installed if missing.
* Please use [***SfvipUserProxy***](user_proxy_cmd) to add or remove a proxy for ***all users*** in ***Sfvip Player*** database.
* **Sfvip Player** will be automatically installed if missing.
* Please use [***SfvipUserProxy***](user_proxy_cmd) to add or remove a proxy for **all users** in **Sfvip Player** database.

[^2]:_**Sfvip All** will ask for network connection its first run because it relies on local proxies to do its magic._
_On **old systems** you might need to install [**vc redist**](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist) for [**x86**](https://aka.ms/vs/17/release/vc_redist.x86.exe) or [**x64**](https://aka.ms/vs/17/release/vc_redist.x64.exe)._

# Settings
* Hover your mouse over the ***Sfvip All*** logo:
<kbd><img src="resources/readme/logo_arrow.png"></kbd>
Hover your mouse over the ***Sfvip All*** logo:
<kbd><img src="resources/readme/logo_arrow.png"></kbd>

* To open the settings:
<kbd><img src="resources/readme/settings.png"></kbd>
To open the settings:
<kbd><img src="resources/readme/settings.png"></kbd>

* Logo pulse meaning:
Color & pulse | Meaning
:--- | :---
<kbd><img src="resources/readme/logo_green.png" width="25"></kbd> <sub>slow pulse | <sub>Everything is fine
<kbd><img src="resources/readme/logo_red.png" width="25"></kbd> <sub>quick pulse | <sub>_Sfvip All_ needs your attention
Logo color & pulse meaning:
Color & pulse | Meaning
:--- | :---
<kbd><img src="resources/readme/logo_green.png" width="25"></kbd> <sub>Green slow pulse | <sub>Everything is fine
<kbd><img src="resources/readme/logo_red.png" width="25"></kbd> <sub>Red quick pulse | <sub>_Sfvip All_ needs your attention

# Logs
The logs go **in pairs** (one for each process: ***main*** & ***mitmproxy***) and they are in the app folder:
The logs go **in pairs**: one for each process (***main*** & ***mitmproxy***).
You'll find them in the app folder:

<kbd><img src="resources/readme/logs.png"></kbd>

# Build
[![version](https://custom-icon-badges.demolab.com/badge/Build%201.4.12.40-informational?logo=github)](/build_config.py#L27)
[![version](https://custom-icon-badges.demolab.com/badge/Build%201.4.12.41-informational?logo=github)](/build_config.py#L27)
[![Sloc](https://custom-icon-badges.demolab.com/badge/Sloc%208.3k-informational?logo=file-code)](https://api.codetabs.com/v1/loc/?github=sebdelsol/sfvip-all)
[![Ruff](https://custom-icon-badges.demolab.com/badge/Ruff-informational?logo=ruff-color)](https://docs.astral.sh/ruff/)
[![Python](https://custom-icon-badges.demolab.com/badge/Python%203.11.8-linen?logo=python-color)](https://www.python.org/downloads/release/python-3118/)
Expand Down
3 changes: 3 additions & 0 deletions build/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.4.12.41
* Tooltips added.

## 1.4.12.40
* Option to prefer the IPTV provider EPG over external EPG.
* Faster EPG processing and loading that use less memory.
Expand Down
2 changes: 1 addition & 1 deletion build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Build:
main: ClassVar = "sfvip_all.py"
company: ClassVar = "sebdelsol"
name: ClassVar = "Sfvip All"
version: ClassVar = "1.4.12.40"
version: ClassVar = "1.4.12.41"
dir: ClassVar = "build"
enable_console: ClassVar = False
logs_dir: ClassVar = "../logs"
Expand Down
29 changes: 15 additions & 14 deletions resources/README_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
***{name}*** wraps ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** to add new features:
* Insert an _All_ category when missing so you can easily **search your entire catalog**.
<kbd><img src="resources/readme/all.png"></kbd>
* Update ***[Mpv](https://mpv.io/)*** and ***[Sfvip Player](https://github.com/K4L4Uz/SFVIP-Player/tree/master)*** so you can enjoy their latest features.
* Translated in all ***Sfvip Player*** languages.
* Update ***[Mpv](https://mpv.io/)*** and **Sfvip Player** so you can enjoy their latest features.
* Translated in all **Sfvip Player** languages.
* Support an **external EPG**[^1].

[^1]: External EPG doesn't work with **local** m3u accounts.
Expand All @@ -17,27 +17,28 @@
[<a href="https://tooomm.github.io/github-release-stats/?username={github_owner}&repository={github_repo}"><img src="https://img.shields.io/github/downloads/{github_path}/total?color=informational&logo=github&labelColor=informational&style=flat-square" height="{h_github}"></a><a href="https://github.com/{github_path}/issues?q=is%3Aopen"><img src="https://img.shields.io/github/issues/{github_path}?labelColor=success&style=flat-square" height="{h_github}"></a>]()

* Check the [***changelog***](build/changelog.md) and ***notes***[^2].
* [***Sfvip Player***](https://github.com/K4L4Uz/SFVIP-Player/tree/master) will be automatically installed if missing.
* Please use [***SfvipUserProxy***](user_proxy_cmd) to add or remove a proxy for ***all users*** in ***Sfvip Player*** database.
* **Sfvip Player** will be automatically installed if missing.
* Please use [***SfvipUserProxy***](user_proxy_cmd) to add or remove a proxy for **all users** in **Sfvip Player** database.

[^2]:_**{name}** will ask for network connection its first run because it relies on local proxies to do its magic._
_On **old systems** you might need to install [**vc redist**](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist) for [**x86**](https://aka.ms/vs/17/release/vc_redist.x86.exe) or [**x64**](https://aka.ms/vs/17/release/vc_redist.x64.exe)._

# Settings
* Hover your mouse over the ***{name}*** logo:
<kbd><img src="resources/readme/logo_arrow.png"></kbd>
Hover your mouse over the ***{name}*** logo:
<kbd><img src="resources/readme/logo_arrow.png"></kbd>

* To open the settings:
<kbd><img src="resources/readme/settings.png"></kbd>
To open the settings:
<kbd><img src="resources/readme/settings.png"></kbd>

* Logo pulse meaning:
Color & pulse | Meaning
:--- | :---
<kbd><img src="resources/readme/logo_green.png" width="25"></kbd> <sub>slow pulse | <sub>Everything is fine
<kbd><img src="resources/readme/logo_red.png" width="25"></kbd> <sub>quick pulse | <sub>_{name}_ needs your attention
Logo color & pulse meaning:
Color & pulse | Meaning
:--- | :---
<kbd><img src="resources/readme/logo_green.png" width="25"></kbd> <sub>Green slow pulse | <sub>Everything is fine
<kbd><img src="resources/readme/logo_red.png" width="25"></kbd> <sub>Red quick pulse | <sub>_{name}_ needs your attention

# Logs
The logs go **in pairs** (one for each process: ***main*** & ***mitmproxy***) and they are in the app folder:
The logs go **in pairs**: one for each process (***main*** & ***mitmproxy***).
You'll find them in the app folder:

<kbd><img src="resources/readme/logs.png"></kbd>

Expand Down
6 changes: 3 additions & 3 deletions src/mitm/epg/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


class EPGstatus(Enum):
LOADING = auto()
DOWNLOADING = auto()
LOAD_CACHE = auto()
SAVE_CACHE = auto()
PROCESSING = auto()
Expand Down Expand Up @@ -202,7 +202,7 @@ class EPGupdate(NamedTuple):
@contextmanager
@staticmethod
def _load_xml(url: str, epg_process: EPGProcess, timeout: int) -> Iterator[Optional[Path]]:
epg_process.update_status(EPGProgress(EPGstatus.LOADING))
epg_process.update_status(EPGProgress(EPGstatus.DOWNLOADING))
if (xml := Path(url)).is_file(): # for debug purpose
yield xml
return
Expand All @@ -218,7 +218,7 @@ def _load_xml(url: str, epg_process: EPGProcess, timeout: int) -> Iterator[Optio
yield None
return
if progress_step and (progress := progress_step.progress(i * EPGupdate._chunk_size)):
epg_process.update_status(EPGProgress(EPGstatus.LOADING, progress))
epg_process.update_status(EPGProgress(EPGstatus.DOWNLOADING, progress))
f.write(chunk)
yield xml

Expand Down
8 changes: 6 additions & 2 deletions src/sfvip/player/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ def set_version(self, version: Version, text: str) -> None:
self._changelogs = dict(sorted(self._changelogs.items(), reverse=True))
self.save_all()

@staticmethod
def _sanitize(text: str) -> str:
text = re.sub(r"^\s?\-", "", text)
return text.replace("...", ".").strip().capitalize()

def __str__(self) -> str:
return "\n\n".join(
(
LOC.ChangeLog % "Sfvip Player",
*(
f"{PlayerChangelogs._prefix}{version}:\n"
f"{PlayerChangelogs._tab}{text.capitalize().replace('...', '.')}"
f"{PlayerChangelogs._prefix}{version}:\n" f"{PlayerChangelogs._tab}- {self._sanitize(text)}"
for i, (version, text) in enumerate(self._changelogs.items())
if i < self._n_logs_showed
),
Expand Down
16 changes: 13 additions & 3 deletions src/sfvip/ui/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _app_version_tooltip(app_info: AppInfo) -> Style:
break
lines.extend(("", f"{prefix}{text}:"))
case "*":
lines.append(f"{tab}{text}")
lines.append(f"{tab}- {text}")
except ValueError:
if line:
lines.append(f"{tab}{line}")
Expand Down Expand Up @@ -228,7 +228,7 @@ def _epg_confidence_percent() -> Style:

def _epg_status_styles(progress: str) -> dict[EPGstatus | None, Style]:
return {
EPGstatus.LOADING: _InfoStyle.app(f"{LOC.Loading}{progress}").white,
EPGstatus.DOWNLOADING: _InfoStyle.app(f"{LOC.Downloading}{progress}").white,
EPGstatus.PROCESSING: _InfoStyle.app(f"{LOC.Processing}{progress}").white,
EPGstatus.LOAD_CACHE: _InfoStyle.app(f"{LOC.LoadCache}{progress}").white,
EPGstatus.SAVE_CACHE: _InfoStyle.app(f"{LOC.SaveCache}{progress}").white,
Expand All @@ -252,6 +252,14 @@ def _get_epg_prefer_label() -> Style:
return _InfoStyle.app(LOC.EPGPrefer).grey.no_truncate


def _epg_url_tooltip() -> Style:
return _InfoStyle.app(LOC.EPGUrlTip).grey.no_truncate


def _epg_libmpv_tooltip() -> Style:
return _InfoStyle.app(LOC.LibmpvTip).grey.no_truncate


def _epg_prefer_tooltip() -> Style:
msg = "".join((f"\n\n{text}" for text in (LOC.EPGPreferYes, LOC.EPGPreferNo)))
return _InfoStyle.tooltip(f"{LOC.EPGPrefer}:{msg}")
Expand Down Expand Up @@ -508,6 +516,8 @@ def __init__(self, app_info: AppInfo) -> None:
set_tooltip(_app_version_tooltip(app_info), app_version)
set_tooltip(_epg_confidence_tooltip(), epg_confidence_label)
set_tooltip(_epg_prefer_tooltip(), epg_prefer_label)
set_tooltip(_epg_url_tooltip(), epg_label)
set_tooltip(_epg_libmpv_tooltip(), self._libmpv_version)

def get_changelog(self) -> str:
return self._changelog_callback() if self._changelog_callback else ""
Expand All @@ -528,7 +538,7 @@ def _callback(_) -> None:
self._epg_url.bind("<FocusOut>", _callback)

def set_epg_status(self, epg_status: EPGProgress) -> None:
self._epg_url.config(state=tk.DISABLED if epg_status.status is EPGstatus.LOADING else tk.NORMAL)
self._epg_url.config(state=tk.DISABLED if epg_status.status is EPGstatus.DOWNLOADING else tk.NORMAL)
self._epg_status.config(**_epg_status(epg_status).to_tk)

def set_epg_confidence_update(self, confidence: int, callback: Callable[[int], None]) -> None:
Expand Down
10 changes: 6 additions & 4 deletions translations/bulgarian.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"UpgradeFailed": "Обновяването на %s не е успешно. Искате ли да повторите опита ?",
"LoadCache": "Зареждане на кеш",
"SaveCache": "Запазване на кеш",
"Loading": "Зареждане на",
"Processing": "Обработка на",
"Ready": "Готов",
"Downloading": "Изтегляне на",
"Processing": "Обработка",
"Ready": "Готовност",
"Failed": "Неуспешно",
"NoEpg": "Няма EPG",
"EpgUrl": "Външен EPG",
Expand All @@ -55,5 +55,7 @@
"Yes": "Да",
"No": "Не",
"EPGPreferYes": "Да: Първо търсите в EPG на IPTV доставчика. Използвайте външния EPG само когато той не успее.",
"EPGPreferNo": "Не: Търсете първо във външния EPG. Използвайте EPG на доставчика на IPTV само когато той не успее."
"EPGPreferNo": "Не: Търсете първо във външния EPG. Използвайте EPG на доставчика на IPTV само когато той не успее.",
"EPGUrlTip": "Въведете URL адреса на външния EPG, който трябва да завършва с \"xml\" или \"xml.gz\".",
"LibmpvTip": "Libmpv декодира и визуализира аудио и видео. активирайте актуализирането, за да получите последната версия, оптимизирана за вашия компютър."
}
6 changes: 4 additions & 2 deletions translations/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"UpgradeFailed": "%s upgrade failed. Do you want to retry ?",
"LoadCache": "Loading cache",
"SaveCache": "Saving cache",
"Loading": "Loading",
"Downloading": "Downloading",
"Processing": "Processing",
"Ready": "Ready",
"Failed": "Failed",
Expand All @@ -55,5 +55,7 @@
"Yes": "Yes",
"No": "No",
"EPGPreferYes": "Yes: Search the IPTV provider EPG first. Use the external EPG only when it fails.",
"EPGPreferNo": "No: Search the external EPG first. Use the IPTV provider EPG only when it fails."
"EPGPreferNo": "No: Search the external EPG first. Use the IPTV provider EPG only when it fails.",
"EPGUrlTip": "Enter the URL of the external EPG, it should end up with 'xml' or 'xml.gz'",
"LibmpvTip": "Libmpv decodes & renders audio and video.Enable the update to get the last version optimized for your computer."
}
6 changes: 4 additions & 2 deletions translations/french.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"UpgradeFailed": "La mise à jour de %s a échoué. Voulez-vous réessayer ?",
"LoadCache": "Chargement du cache",
"SaveCache": "Sauvegarde du cache",
"Loading": "Chargement",
"Downloading": "Téléchargement",
"Processing": "Traitement",
"Ready": "Prêt",
"Failed": "Échec",
Expand All @@ -55,5 +55,7 @@
"Yes": "Oui",
"No": "Non",
"EPGPreferYes": "Oui : Cherchez d'abord dans l'EPG du fournisseur de télévision par internet. N'utilisez l'EPG externe qu'en cas d'échec.",
"EPGPreferNo": "Non : rechercher d'abord l'EPG externe. Utiliser l'EPG du fournisseur IPTV uniquement en cas d'échec."
"EPGPreferNo": "Non : rechercher d'abord l'EPG externe. Utiliser l'EPG du fournisseur IPTV uniquement en cas d'échec.",
"EPGUrlTip": "Entrez l'URL de l'EPG externe, qui devrait se terminer par 'xml' ou 'xml.gz'.",
"LibmpvTip": "Libmpv décode et rend l'audio et la vidéo. Activez la mise à jour pour obtenir la dernière version optimisée pour votre ordinateur."
}
6 changes: 4 additions & 2 deletions translations/german.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"UpgradeFailed": "%s Upgrade fehlgeschlagen. Möchten Sie es erneut versuchen?",
"LoadCache": "Cache laden",
"SaveCache": "Cache speichern",
"Loading": "Laden von",
"Downloading": "Herunterladen von",
"Processing": "Verarbeiten",
"Ready": "Bereit",
"Failed": "Fehlgeschlagen",
Expand All @@ -55,5 +55,7 @@
"Yes": "Ja",
"No": "Nein",
"EPGPreferYes": "Ja: Suchen Sie zuerst im EPG des IPTV-Anbieters. Verwenden Sie den externen EPG nur, wenn er nicht funktioniert.",
"EPGPreferNo": "Nein: Zuerst im externen EPG suchen. Verwenden Sie den EPG des IPTV-Anbieters nur, wenn dieser nicht funktioniert."
"EPGPreferNo": "Nein: Zuerst im externen EPG suchen. Verwenden Sie den EPG des IPTV-Anbieters nur, wenn er nicht funktioniert.",
"EPGUrlTip": "Geben Sie die URL des externen EPGs ein, sie sollte mit 'xml' oder 'xml.gz' enden.",
"LibmpvTip": "Libmpv dekodiert und rendert Audio und Video. Aktivieren Sie das Update, um die letzte für Ihren Computer optimierte Version zu erhalten."
}
6 changes: 4 additions & 2 deletions translations/greek.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"UpgradeFailed": "Η αναβάθμιση %s απέτυχε. Θέλετε να ξαναπροσπαθήσετε;",
"LoadCache": "Φόρτωση προσωρινής μνήμης",
"SaveCache": "Αποθήκευση προσωρινής μνήμης",
"Loading": "Φόρτωση",
"Downloading": "Λήψη",
"Processing": "Επεξεργασία",
"Ready": "Έτοιμο",
"Failed": "Απέτυχε",
Expand All @@ -55,5 +55,7 @@
"Yes": "Ναι",
"No": "Όχι",
"EPGPreferYes": "Ναι: Αναζητήστε πρώτα το EPG του παρόχου IPTV. Χρησιμοποιείτε το εξωτερικό EPG μόνο όταν αυτό αποτυγχάνει.",
"EPGPreferNo": "Όχι: Αναζητήστε πρώτα το εξωτερικό EPG. Χρησιμοποιήστε το EPG του παρόχου IPTV μόνο όταν αυτό αποτύχει."
"EPGPreferNo": "Όχι: Αναζητήστε πρώτα το εξωτερικό EPG. Χρησιμοποιήστε το EPG του παρόχου IPTV μόνο όταν αυτό αποτύχει.",
"EPGUrlTip": "Εισάγετε τη διεύθυνση URL του εξωτερικού EPG, θα πρέπει να καταλήγει σε 'xml' ή 'xml.gz'.",
"LibmpvTip": "Το Libmpv αποκωδικοποιεί & αποδίδει ήχο και βίντεο. ενεργοποιήστε την ενημέρωση για να λάβετε την τελευταία έκδοση βελτιστοποιημένη για τον υπολογιστή σας."
}
6 changes: 4 additions & 2 deletions translations/italian.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"UpgradeFailed": "L'aggiornamento %s non è riuscito. Si desidera riprovare?",
"LoadCache": "Caricamento della cache",
"SaveCache": "Salvataggio della cache",
"Loading": "Caricamento",
"Downloading": "Scaricare",
"Processing": "Elaborazione",
"Ready": "Pronto",
"Failed": "Non riuscita",
Expand All @@ -55,5 +55,7 @@
"Yes": "Si",
"No": "No",
"EPGPreferYes": "Sì: cercate prima l'EPG del provider IPTV. Utilizzare l'EPG esterno solo in caso di errore.",
"EPGPreferNo": "No: Cerca prima l'EPG esterno. Utilizzare l'EPG del provider IPTV solo in caso di errore."
"EPGPreferNo": "No: Cerca prima l'EPG esterno. Utilizzare l'EPG del provider IPTV solo in caso di errore.",
"EPGUrlTip": "Inserite l'URL dell'EPG esterno, che dovrebbe finire con 'xml' o 'xml.gz'.",
"LibmpvTip": "Libmpv decodifica e rende audio e video. Attivare l'aggiornamento per ottenere l'ultima versione ottimizzata per il proprio computer."
}
Loading

0 comments on commit ef7bbc5

Please sign in to comment.