Skip to content

Commit

Permalink
add ttl for plex id cache
Browse files Browse the repository at this point in the history
  • Loading branch information
vanchaxy committed Dec 10, 2024
1 parent 3d5215a commit a8b70eb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ app = 'plexio'
primary_region = 'iad'

[build]
image = 'ghcr.io/vanchaxy/plexio:0.1.8'
image = 'ghcr.io/vanchaxy/plexio:0.1.9'

[env]
CACHE_TYPE = 'redis'
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend",
"private": true,
"version": "0.1.8",
"version": "0.1.9",
"type": "module",
"scripts": {
"dev": "vite --host",
Expand Down
2 changes: 1 addition & 1 deletion plexio/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.8'
__version__ = '0.1.9'
4 changes: 3 additions & 1 deletion plexio/plex/media_server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from plexio.plex.utils import get_json
from plexio.settings import settings

PLEX_CACHE_TTL = 24 * 60 * 60

SORT_OPTIONS = {
'Title': 'title',
'Title (desc)': 'title:desc',
Expand Down Expand Up @@ -245,5 +247,5 @@ async def stremio_to_plex_id(
return None

if plex_id:
await cache.set(stremio_id, plex_id)
await cache.set(stremio_id, plex_id, ex=PLEX_CACHE_TTL)
return plex_id

0 comments on commit a8b70eb

Please sign in to comment.