dev: umfangreiches Refactoring, Trakt-Integration und Code-Review-Fixes (0.1.69-dev)
Core & Architektur: - Neues Verzeichnis addon/core/ mit router.py, trakt.py, metadata.py, gui.py, playstate.py, plugin_manager.py, updater.py - Tests-Verzeichnis hinzugefügt (24 Tests, pytest + Coverage) Trakt-Integration: - OAuth Device Flow, Scrobbling, Watchlist, History, Calendar - Upcoming Episodes, Weiterschauen (Continue Watching) - Watched-Status in Episodenlisten - _trakt_find_in_plugins() mit 5-Min-Cache Serienstream-Suche: - API-Ergebnisse werden immer mit Katalog-Cache ergänzt (serverseitiges 10-Treffer-Limit) - Katalog-Cache wird beim Addon-Start im Daemon-Thread vorgewärmt - Notification nach Cache-Load via xbmc.executebuiltin() (thread-sicher) Bugfixes (Code-Review): - Race Condition auf _TRAKT_WATCHED_CACHE: _TRAKT_WATCHED_CACHE_LOCK hinzugefügt - GUI-Dialog aus Daemon-Thread: xbmcgui -> xbmc.executebuiltin() - ValueError in Trakt-Watchlist-Routen abgesichert - Token expires_at==0 Check korrigiert - get_setting_bool() Kontrollfluss in gui.py bereinigt - topstreamfilm_plugin: try-finally um xbmcvfs.File.close() Cleanup: - default.py.bak und refactor_router.py entfernt - .gitignore: /tests/ Eintrag entfernt - Type-Hints vereinheitlicht (Dict/List/Tuple -> dict/list/tuple)
This commit is contained in:
29
tests/test_serienstream_parser.py
Normal file
29
tests/test_serienstream_parser.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from addon.plugins.serienstream_plugin import _extract_episodes
|
||||
|
||||
|
||||
def test_extract_episodes_skips_upcoming():
|
||||
html = """
|
||||
<table class='episode-table'>
|
||||
<tbody>
|
||||
<tr class='episode-row' onclick="window.location='https://s.to/serie/x/staffel-1/episode-1'">
|
||||
<th class='episode-number-cell'>1</th>
|
||||
<td><strong class='episode-title-ger'>Ep1</strong></td>
|
||||
<td class='episode-watch-cell'><img alt='VOE'></td>
|
||||
</tr>
|
||||
<tr class='episode-row upcoming' onclick="window.location='https://s.to/serie/x/staffel-1/episode-2'">
|
||||
<th class='episode-number-cell'>2</th>
|
||||
<td>
|
||||
<strong class='episode-title-ger'></strong>
|
||||
<span class='badge badge-upcoming'>DEMNÄCHST</span>
|
||||
</td>
|
||||
<td class='episode-watch-cell'>— TBA —</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
"""
|
||||
soup = BeautifulSoup(html, "html.parser")
|
||||
episodes = _extract_episodes(soup)
|
||||
assert [e.number for e in episodes] == [1]
|
||||
Reference in New Issue
Block a user