mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-05 05:07:34 +08:00
refactor(UrlUtils): Migrate URL-related methods from RequestUtils
This commit is contained in:
@@ -11,10 +11,10 @@ from app.core.config import settings
|
||||
from app.log import logger
|
||||
from app.schemas.types import MediaType
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.url import UrlUtils
|
||||
|
||||
|
||||
class Emby:
|
||||
|
||||
_host: str = None
|
||||
_playhost: str = None
|
||||
_apikey: str = None
|
||||
@@ -26,10 +26,10 @@ class Emby:
|
||||
return
|
||||
self._host = host
|
||||
if self._host:
|
||||
self._host = RequestUtils.standardize_base_url(self._host)
|
||||
self._host = UrlUtils.standardize_base_url(self._host)
|
||||
self._playhost = play_host
|
||||
if self._playhost:
|
||||
self._playhost = RequestUtils.standardize_base_url(self._playhost)
|
||||
self._playhost = UrlUtils.standardize_base_url(self._playhost)
|
||||
self._apikey = apikey
|
||||
self.user = self.get_user(settings.SUPERUSER)
|
||||
self.folders = self.get_emby_folders()
|
||||
|
||||
@@ -8,10 +8,10 @@ from app.core.config import settings
|
||||
from app.log import logger
|
||||
from app.schemas import MediaType
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.url import UrlUtils
|
||||
|
||||
|
||||
class Jellyfin:
|
||||
|
||||
_host: str = None
|
||||
_apikey: str = None
|
||||
_playhost: str = None
|
||||
@@ -23,10 +23,10 @@ class Jellyfin:
|
||||
return
|
||||
self._host = host
|
||||
if self._host:
|
||||
self._host = RequestUtils.standardize_base_url(self._host)
|
||||
self._host = UrlUtils.standardize_base_url(self._host)
|
||||
self._playhost = play_host
|
||||
if self._playhost:
|
||||
self._playhost = RequestUtils.standardize_base_url(self._playhost)
|
||||
self._playhost = UrlUtils.standardize_base_url(self._playhost)
|
||||
self._apikey = apikey
|
||||
self.user = self.get_user(settings.SUPERUSER)
|
||||
self.serverid = self.get_server_id()
|
||||
|
||||
@@ -13,6 +13,7 @@ from app.core.config import settings
|
||||
from app.log import logger
|
||||
from app.schemas import MediaType
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.url import UrlUtils
|
||||
|
||||
|
||||
class Plex:
|
||||
@@ -25,10 +26,10 @@ class Plex:
|
||||
return
|
||||
self._host = host
|
||||
if self._host:
|
||||
self._host = RequestUtils.standardize_base_url(self._host)
|
||||
self._host = UrlUtils.standardize_base_url(self._host)
|
||||
self._playhost = play_host
|
||||
if self._playhost:
|
||||
self._playhost = RequestUtils.standardize_base_url(self._playhost)
|
||||
self._playhost = UrlUtils.standardize_base_url(self._playhost)
|
||||
self._token = token
|
||||
if self._host and self._token:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user