Merge pull request #124 from developer-wlj/wlj0807
This commit is contained in:
commit
b1308501be
@ -112,11 +112,11 @@ def get_logging(token: str):
|
|||||||
def log_generator():
|
def log_generator():
|
||||||
log_path = settings.LOG_PATH / 'moviepilot.log'
|
log_path = settings.LOG_PATH / 'moviepilot.log'
|
||||||
# 读取文件末尾50行,不使用tailer模块
|
# 读取文件末尾50行,不使用tailer模块
|
||||||
with open(log_path, 'r') as f:
|
with open(log_path, 'r', encoding='utf-8') as f:
|
||||||
for line in f.readlines()[-50:]:
|
for line in f.readlines()[-50:]:
|
||||||
yield 'data: %s\n\n' % line
|
yield 'data: %s\n\n' % line
|
||||||
while True:
|
while True:
|
||||||
for text in tailer.follow(open(log_path, 'r')):
|
for text in tailer.follow(open(log_path, 'r', encoding='utf-8')):
|
||||||
yield 'data: %s\n\n' % (text or '')
|
yield 'data: %s\n\n' % (text or '')
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
@ -159,7 +159,10 @@ class Plex(metaclass=Singleton):
|
|||||||
videos = self._plex.library.search(title=title, year=year, libtype="show")
|
videos = self._plex.library.search(title=title, year=year, libtype="show")
|
||||||
if not videos:
|
if not videos:
|
||||||
return {}
|
return {}
|
||||||
|
if isinstance(videos, list):
|
||||||
episodes = videos[0].episodes()
|
episodes = videos[0].episodes()
|
||||||
|
else:
|
||||||
|
episodes = videos.episodes()
|
||||||
season_episodes = {}
|
season_episodes = {}
|
||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
if season and episode.seasonNumber != int(season):
|
if season and episode.seasonNumber != int(season):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user