Skip to content

Commit f6dbf69

Browse files
committed
feat, rm: plex shows images, jellyfin should raise ConnectionError
1 parent 9cfe261 commit f6dbf69

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
.PHONY: build
22

3-
pip = pip
4-
python = python
3+
PIP = pip
4+
PYTHON = python
55

66
build:
7-
${python} -m build
7+
${PYTHON} -m build
88

99
install:
10-
${pip} install . -U
10+
${PIP} install . -U
1111

1212
install-editable:
13-
${pip} install -e . --config-settings editable_mode=compat -U
13+
${PIP} install -e . --config-settings editable_mode=compat -U
1414

1515
test:
1616
ruff check --target-version=py38 .

mov_cli_jellyplex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
},
1818
}
1919

20-
__version__ = "1.1.0"
20+
__version__ = "1.1.1"

mov_cli_jellyplex/jellyfin/scraper.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def __get_auth(self):
159159
)
160160

161161
if authbyname.is_error:
162-
raise InvalidLogin(self.username)
162+
raise ConnectionError(f"Login failed for user: {self.username}")
163163

164164
r = authbyname.json()
165165

@@ -171,11 +171,3 @@ def __get_auth(self):
171171
self.cache.set_cache("jellyfin_login", cached)
172172

173173
return headers, user_id, token
174-
175-
class InvalidLogin(MovCliException):
176-
"""Raises when the jellyfin scraper fails while auth with server."""
177-
178-
def __init__(self, user: str) -> None:
179-
super().__init__(
180-
f"Invalid Login for user: {user}",
181-
)

mov_cli_jellyplex/plex/scraper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def __init__(
4949

5050
super().__init__(config, http_client, options)
5151

52-
def search(self, query: str, limit: int = 20) -> Generator[PlexMetadata, Any, None]:
52+
def search(self, query: str, limit: Optional[int]) -> Generator[PlexMetadata, Any, None]:
53+
limit = 20 if limit is None else limit
54+
5355
if query in ["all+", "*"]:
5456
videos = self.plex.library.all()
5557
else:
@@ -61,6 +63,7 @@ def search(self, query: str, limit: int = 20) -> Generator[PlexMetadata, Any, No
6163
id = _,
6264
title = video.title,
6365
type = MetadataType.SINGLE if "movie" == video.TYPE else MetadataType.MULTI,
66+
image_url = video.posterUrl,
6467
year = video.year,
6568
video = video
6669
)

0 commit comments

Comments
 (0)