fix media exists bug
This commit is contained in:
parent
08ae0a434a
commit
5eee0f0221
@ -33,7 +33,7 @@ class EmbyModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if mediainfo.type == MediaType.MOVIE:
|
if mediainfo.type == MediaType.MOVIE:
|
||||||
movies = self.emby.get_movies(title=mediainfo.title, year=mediainfo.year)
|
movies = self.emby.get_movies(title=mediainfo.title, year=mediainfo.year)
|
||||||
if movies:
|
if not movies:
|
||||||
logger.info(f"{mediainfo.get_title_string()} 在媒体库中不存在")
|
logger.info(f"{mediainfo.get_title_string()} 在媒体库中不存在")
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -32,7 +32,7 @@ class JellyfinModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if mediainfo.type == MediaType.MOVIE:
|
if mediainfo.type == MediaType.MOVIE:
|
||||||
movies = self.jellyfin.get_movies(title=mediainfo.title, year=mediainfo.year)
|
movies = self.jellyfin.get_movies(title=mediainfo.title, year=mediainfo.year)
|
||||||
if movies:
|
if not movies:
|
||||||
logger.info(f"{mediainfo.get_title_string()} 在媒体库中不存在")
|
logger.info(f"{mediainfo.get_title_string()} 在媒体库中不存在")
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -33,7 +33,7 @@ class PlexModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if mediainfo.type == MediaType.MOVIE:
|
if mediainfo.type == MediaType.MOVIE:
|
||||||
movies = self.plex.get_movies(title=mediainfo.title, year=mediainfo.year)
|
movies = self.plex.get_movies(title=mediainfo.title, year=mediainfo.year)
|
||||||
if movies:
|
if not movies:
|
||||||
logger.info(f"{mediainfo.get_title_string()} 在媒体库中不存在")
|
logger.info(f"{mediainfo.get_title_string()} 在媒体库中不存在")
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from app.chain.common import CommonChain
|
||||||
from app.chain.identify import IdentifyChain
|
from app.chain.identify import IdentifyChain
|
||||||
|
|
||||||
|
|
||||||
@ -15,3 +16,5 @@ class RecognizeTest(TestCase):
|
|||||||
def test_recognize(self):
|
def test_recognize(self):
|
||||||
result = IdentifyChain().process(title="我和我的祖国 2019")
|
result = IdentifyChain().process(title="我和我的祖国 2019")
|
||||||
self.assertEqual(str(result.media_info.tmdb_id), '612845')
|
self.assertEqual(str(result.media_info.tmdb_id), '612845')
|
||||||
|
exists = CommonChain().get_no_exists_info(result.media_info)
|
||||||
|
self.assertEqual(exists, True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user