diff --git a/.drone.yml b/.drone.yml index c1d66b1..fda18b4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,8 +39,8 @@ steps: - vrobbler collectstatic --noinput - immortalctl restart celery && immortalctl restart vrobbler when: - branch: - - main + ref: + - refs/tags/* - name: build success notification image: parrazam/drone-ntfy:0.3-linux-amd64 when: diff --git a/vrobbler/apps/videos/sources/tmdb.py b/vrobbler/apps/videos/sources/tmdb.py index c386591..e1fb461 100644 --- a/vrobbler/apps/videos/sources/tmdb.py +++ b/vrobbler/apps/videos/sources/tmdb.py @@ -12,7 +12,7 @@ tmdb_direct.api_key = TMDB_KEY tmdb = TMDb(key=TMDB_KEY, language="en-US", region="US") -TMDB_STILL_URL = "https://image.tmdb.org/t/p/original" +TMDB_IMAGE_URL = "https://image.tmdb.org/t/p/original" logger = logging.getLogger(__name__) @@ -44,6 +44,7 @@ def lookup_video_from_tmdb( if len(tmdb_result.movie_results) > 0: media = tmdb_result.movie_results[0] video_metadata.video_type = VideoType.MOVIE.value + video_metadata.cover_url = TMDB_IMAGE_URL + media.poster_path # TODO: enrich this with TMDB url if len(tmdb_result.tv_episode_results) > 0: video_metadata.video_type = VideoType.TV_EPISODE.value media = tmdb_result.tv_episode_results[0] @@ -55,13 +56,13 @@ def lookup_video_from_tmdb( series.name = show_data.name series.save() video_metadata.tv_series_id = series.id + video_metadata.cover_url = TMDB_IMAGE_URL + media.still_path # TODO: enrich this with TMDB url if not media: logger.warning("Video not found on TMDB", extra={"imdb_id":imdb_id}) return video_metadata video_metadata.tmdb_id = media.id - video_metadata.cover_url = TMDB_STILL_URL + media.still_path # TODO: enrich this with TMDB url video_metadata.run_time_seconds = media.runtime * 60 video_metadata.title = media.name video_metadata.episode_number = media.episode_number diff --git a/vrobbler/templates/videos/video_detail.html b/vrobbler/templates/videos/video_detail.html index b44b612..e47285a 100644 --- a/vrobbler/templates/videos/video_detail.html +++ b/vrobbler/templates/videos/video_detail.html @@ -57,6 +57,7 @@ dd {
{% if object.imdb_rating %}
{{object.imdb_rating}}
{% endif %} + {% if object.tmdb_rating %}
{{object.tmdb_rating}}
{% endif %}