NBLA: Remove year from episodic content
This commit is contained in:
parent
a0dc67f74b
commit
e6e74047ea
@ -112,12 +112,14 @@ class NBLA(Service):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@click.command(name="NBLA", short_help="https://nebula.tv", help=__doc__)
|
@click.command(name="NBLA", short_help="https://nebula.tv", help=__doc__)
|
||||||
@click.argument("title", type=str)
|
@click.argument("title", type=str)
|
||||||
|
@click.option('--force-movie', is_flag=True)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx: Context, **kwargs: Any) -> NBLA:
|
def cli(ctx: Context, **kwargs: Any) -> NBLA:
|
||||||
return NBLA(ctx, **kwargs)
|
return NBLA(ctx, **kwargs)
|
||||||
|
|
||||||
def __init__(self, ctx: Context, title: str):
|
def __init__(self, ctx: Context, title: str, force_movie: bool):
|
||||||
self.title = title
|
self.title = title
|
||||||
|
self.force_movie = force_movie
|
||||||
super().__init__(ctx)
|
super().__init__(ctx)
|
||||||
|
|
||||||
def authenticate(self, cookies: Optional[MozillaCookieJar] = None, credential: Optional[Credential] = None) -> None:
|
def authenticate(self, cookies: Optional[MozillaCookieJar] = None, credential: Optional[Credential] = None) -> None:
|
||||||
@ -149,7 +151,7 @@ class NBLA(Service):
|
|||||||
video = r.json()
|
video = r.json()
|
||||||
|
|
||||||
# Simplest scenario: This is a video on a non-episodic channel, return it as movie
|
# Simplest scenario: This is a video on a non-episodic channel, return it as movie
|
||||||
if video["channel_type"] != "episodic":
|
if self.force_movie or video["channel_type"] != "episodic":
|
||||||
return Movies([
|
return Movies([
|
||||||
Movie(
|
Movie(
|
||||||
id_=video["id"],
|
id_=video["id"],
|
||||||
@ -235,7 +237,6 @@ class NBLA(Service):
|
|||||||
title=channel["title"],
|
title=channel["title"],
|
||||||
name=episode["title"],
|
name=episode["title"],
|
||||||
language="en",
|
language="en",
|
||||||
year=episode["video"]["published_at"][0:4],
|
|
||||||
season=season_number,
|
season=season_number,
|
||||||
number=episode_number,
|
number=episode_number,
|
||||||
)
|
)
|
||||||
@ -283,7 +284,6 @@ class NBLA(Service):
|
|||||||
title=show_title,
|
title=show_title,
|
||||||
name=episode["title"],
|
name=episode["title"],
|
||||||
language="en",
|
language="en",
|
||||||
year=episode["published_at"][0:4],
|
|
||||||
season=1,
|
season=1,
|
||||||
number=episode_number,
|
number=episode_number,
|
||||||
))
|
))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user