Skip to content

Commit

Permalink
Ensure plex server is accessed with cache disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 5, 2021
1 parent c0aad21 commit e24bcf5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plex_trakt_sync/commands/sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import click

from plex_trakt_sync.requests_cache import requests_cache
from plex_trakt_sync.main import get_plex_server
from plex_trakt_sync.config import CONFIG
from plex_trakt_sync.decorators import measure_time
Expand All @@ -11,7 +12,8 @@


def sync_all():
server = get_plex_server()
with requests_cache.disabled():
server = get_plex_server()
listutil = TraktListUtil()
plex = PlexApi(server)
trakt = TraktApi()
Expand All @@ -30,8 +32,9 @@ def sync_all():
for lst in trakt_liked_lists:
listutil.addList(lst['username'], lst['listname'])

logging.info("Server version {} updated at: {}".format(server.version, server.updatedAt))
logging.info("Recently added: {}".format(server.library.recentlyAdded()[:5]))
with requests_cache.disabled():
logging.info("Server version {} updated at: {}".format(server.version, server.updatedAt))
logging.info("Recently added: {}".format(server.library.recentlyAdded()[:5]))

for section in plex.library_sections:
if PlexApi.is_movie(section):
Expand Down

0 comments on commit e24bcf5

Please sign in to comment.