From 430a48643803a0bcb5e6ededf4ebab4005fb4ed3 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 7 Aug 2025 20:52:24 -0500 Subject: [PATCH] Add imdb_id to movie api output --- apps/vod/api_views.py | 3 ++- ...003_rename_release_date_episode_air_date.py | 18 ++++++++++++++++++ ...ast_advanced_refresh_to_m3umovierelation.py | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 apps/vod/migrations/0003_rename_release_date_episode_air_date.py create mode 100644 apps/vod/migrations/0004_add_last_advanced_refresh_to_m3umovierelation.py diff --git a/apps/vod/api_views.py b/apps/vod/api_views.py index 7f6f65aa..a03aff1d 100644 --- a/apps/vod/api_views.py +++ b/apps/vod/api_views.py @@ -128,7 +128,7 @@ class MovieViewSet(viewsets.ReadOnlyModelViewSet): 'name': info.get('name', movie.name), 'o_name': info.get('o_name', ''), 'description': info.get('description', info.get('plot', movie.description)), - 'plot':info.get('plot', info.get('description', movie.description)), + 'plot': info.get('plot', info.get('description', movie.description)), 'year': movie.year or info.get('year'), 'release_date': (movie.custom_properties or {}).get('release_date') or info.get('release_date') or info.get('releasedate', ''), 'genre': movie.genre or info.get('genre', ''), @@ -137,6 +137,7 @@ class MovieViewSet(viewsets.ReadOnlyModelViewSet): 'country': (movie.custom_properties or {}).get('country') or info.get('country', ''), 'rating': movie.rating or info.get('rating', movie.rating or 0), 'tmdb_id': movie.tmdb_id or info.get('tmdb_id', ''), + 'imdb_id': movie.imdb_id or info.get('imdb_id', ''), 'youtube_trailer': (movie.custom_properties or {}).get('youtube_trailer') or info.get('youtube_trailer') or info.get('trailer', ''), 'duration': movie.duration or (int(info.get('duration_secs', 0)) // 60 if info.get('duration_secs') else None), 'duration_secs': info.get('duration_secs', (movie.duration or 0) * 60), diff --git a/apps/vod/migrations/0003_rename_release_date_episode_air_date.py b/apps/vod/migrations/0003_rename_release_date_episode_air_date.py new file mode 100644 index 00000000..96d59157 --- /dev/null +++ b/apps/vod/migrations/0003_rename_release_date_episode_air_date.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.4 on 2025-08-07 23:55 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('vod', '0002_movie_series_custom_properties'), + ] + + operations = [ + migrations.RenameField( + model_name='episode', + old_name='release_date', + new_name='air_date', + ), + ] diff --git a/apps/vod/migrations/0004_add_last_advanced_refresh_to_m3umovierelation.py b/apps/vod/migrations/0004_add_last_advanced_refresh_to_m3umovierelation.py new file mode 100644 index 00000000..18642ef9 --- /dev/null +++ b/apps/vod/migrations/0004_add_last_advanced_refresh_to_m3umovierelation.py @@ -0,0 +1,15 @@ +from django.db import migrations, models + +class Migration(migrations.Migration): + + dependencies = [ + ('vod', '0003_rename_release_date_episode_air_date'), + ] + + operations = [ + migrations.AddField( + model_name='m3umovierelation', + name='last_advanced_refresh', + field=models.DateTimeField(blank=True, null=True, help_text="Last time advanced data was fetched from provider"), + ), + ]