mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-01 13:40:54 +08:00
feat: include episode group in subscribe source (#5787)
This commit is contained in:
@@ -3157,6 +3157,7 @@ class SubscribeChain(ChainBase):
|
||||
'year': subscribe.year,
|
||||
'type': subscribe.type,
|
||||
'season': subscribe.season,
|
||||
'episode_group': subscribe.episode_group,
|
||||
'tmdbid': subscribe.tmdbid,
|
||||
'imdbid': subscribe.imdbid,
|
||||
'tvdbid': subscribe.tvdbid,
|
||||
|
||||
27
tests/test_subscribe_source_keyword.py
Normal file
27
tests/test_subscribe_source_keyword.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import json
|
||||
from types import SimpleNamespace
|
||||
|
||||
from app.chain.subscribe import SubscribeChain
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
|
||||
def test_subscribe_source_keyword_includes_episode_group():
|
||||
subscribe = SimpleNamespace(
|
||||
id=1,
|
||||
name="Test Show",
|
||||
year="2026",
|
||||
type=MediaType.TV.value,
|
||||
season=1,
|
||||
episode_group="group-season-03",
|
||||
tmdbid=12345,
|
||||
imdbid=None,
|
||||
tvdbid=None,
|
||||
doubanid=None,
|
||||
bangumiid=None,
|
||||
)
|
||||
|
||||
source = SubscribeChain.get_subscribe_source_keyword(subscribe)
|
||||
payload = json.loads(source.split("|", 1)[1])
|
||||
|
||||
assert payload["episode_group"] == "group-season-03"
|
||||
assert SubscribeChain.parse_subscribe_source_keyword(source)["episode_group"] == "group-season-03"
|
||||
Reference in New Issue
Block a user