Skip to content

Commit

Permalink
Merge pull request #1062 from UweTrottmann/link-movie-release-dates
Browse files Browse the repository at this point in the history
Link to movie release dates
  • Loading branch information
UweTrottmann authored Nov 1, 2024
2 parents 9936315 + 8a42b71 commit 27e0c60
Show file tree
Hide file tree
Showing 47 changed files with 92 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Releases marked with 🧪 (or previously with the "beta" suffix) were released o

## Unreleased

* 🌟 Movies: add link to all release dates.
* 🔧 Overview: use local number format for absolute episode number.

## Version 2024.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
}
isEnabled = false
}
// release dates button
buttonMovieReleaseDates.setOnClickListener {
WebTools.openInCustomTab(
requireContext(),
TmdbTools.buildMovieReleaseDatesUrl(tmdbId)
)
}
// similar movies button
buttonMovieSimilar.setOnClickListener {
movieDetails?.tmdbMovie()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,32 @@ object TmdbTools {
}
}

private const val BASE_URL = "https://www.themoviedb.org/"
private const val PATH_TV = "tv/"
private const val PATH_MOVIES = "movie/"
private const val PATH_PERSON = "person/"
private const val BASE_URL = "https://www.themoviedb.org"
private const val PATH_TV = "tv"
private const val PATH_MOVIES = "movie"
private const val PATH_PERSON = "person"

@JvmStatic
fun buildEpisodeUrl(showTmdbId: Int, season: Int, episode: Int): String {
return "$BASE_URL$PATH_TV$showTmdbId/season/$season/episode/$episode"
return "$BASE_URL/$PATH_TV/$showTmdbId/season/$season/episode/$episode"
}

@JvmStatic
fun buildShowUrl(showTmdbId: Int): String {
return BASE_URL + PATH_TV + showTmdbId
return "$BASE_URL/$PATH_TV/$showTmdbId"
}

@JvmStatic
fun buildMovieUrl(movieTmdbId: Int): String {
return BASE_URL + PATH_MOVIES + movieTmdbId
return "$BASE_URL/$PATH_MOVIES/$movieTmdbId"
}

fun buildPersonUrl(personTmdbId: Int): String {
return BASE_URL + PATH_PERSON + personTmdbId
return "$BASE_URL/$PATH_PERSON/$personTmdbId"
}

fun buildMovieReleaseDatesUrl(movieTmdbId: Int): String {
return "${buildMovieUrl(movieTmdbId)}/releases"
}

/**
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_calendar_month_control_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M200,880Q167,880 143.5,856.5Q120,833 120,800L120,240Q120,207 143.5,183.5Q167,160 200,160L240,160L240,120Q240,103 251.5,91.5Q263,80 280,80Q297,80 308.5,91.5Q320,103 320,120L320,160L640,160L640,120Q640,103 651.5,91.5Q663,80 680,80Q697,80 708.5,91.5Q720,103 720,120L720,160L760,160Q793,160 816.5,183.5Q840,207 840,240L840,800Q840,833 816.5,856.5Q793,880 760,880L200,880ZM200,800L760,800Q760,800 760,800Q760,800 760,800L760,400L200,400L200,800Q200,800 200,800Q200,800 200,800ZM200,320L760,320L760,240Q760,240 760,240Q760,240 760,240L200,240Q200,240 200,240Q200,240 200,240L200,320ZM200,320L200,240Q200,240 200,240Q200,240 200,240L200,240Q200,240 200,240Q200,240 200,240L200,320ZM480,560Q463,560 451.5,548.5Q440,537 440,520Q440,503 451.5,491.5Q463,480 480,480Q497,480 508.5,491.5Q520,503 520,520Q520,537 508.5,548.5Q497,560 480,560ZM320,560Q303,560 291.5,548.5Q280,537 280,520Q280,503 291.5,491.5Q303,480 320,480Q337,480 348.5,491.5Q360,503 360,520Q360,537 348.5,548.5Q337,560 320,560ZM640,560Q623,560 611.5,548.5Q600,537 600,520Q600,503 611.5,491.5Q623,480 640,480Q657,480 668.5,491.5Q680,503 680,520Q680,537 668.5,548.5Q657,560 640,560ZM480,720Q463,720 451.5,708.5Q440,697 440,680Q440,663 451.5,651.5Q463,640 480,640Q497,640 508.5,651.5Q520,663 520,680Q520,697 508.5,708.5Q497,720 480,720ZM320,720Q303,720 291.5,708.5Q280,697 280,680Q280,663 291.5,651.5Q303,640 320,640Q337,640 348.5,651.5Q360,663 360,680Q360,697 348.5,708.5Q337,720 320,720ZM640,720Q623,720 611.5,708.5Q600,697 600,680Q600,663 611.5,651.5Q623,640 640,640Q657,640 668.5,651.5Q680,663 680,680Q680,697 668.5,708.5Q657,720 640,720Z" />
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_event_control_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M580,720Q538,720 509,691Q480,662 480,620Q480,578 509,549Q538,520 580,520Q622,520 651,549Q680,578 680,620Q680,662 651,691Q622,720 580,720ZM200,880Q167,880 143.5,856.5Q120,833 120,800L120,240Q120,207 143.5,183.5Q167,160 200,160L240,160L240,120Q240,103 251.5,91.5Q263,80 280,80Q297,80 308.5,91.5Q320,103 320,120L320,160L640,160L640,120Q640,103 651.5,91.5Q663,80 680,80Q697,80 708.5,91.5Q720,103 720,120L720,160L760,160Q793,160 816.5,183.5Q840,207 840,240L840,800Q840,833 816.5,856.5Q793,880 760,880L200,880ZM200,800L760,800Q760,800 760,800Q760,800 760,800L760,400L200,400L200,800Q200,800 200,800Q200,800 200,800ZM200,320L760,320L760,240Q760,240 760,240Q760,240 760,240L200,240Q200,240 200,240Q200,240 200,240L200,320ZM200,320L200,240Q200,240 200,240Q200,240 200,240L200,240Q200,240 200,240Q200,240 200,240L200,320Z" />
</vector>
10 changes: 0 additions & 10 deletions app/src/main/res/drawable/ic_event_white_24dp.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/buttons_episode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/addtocalendar"
app:icon="@drawable/ic_event_white_24dp"
app:icon="@drawable/ic_event_control_24dp"
app:iconGravity="start" />

<Button
Expand Down
15 changes: 12 additions & 3 deletions app/src/main/res/layout/buttons_movie.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- SPDX-License-Identifier: Apache-2.0 -->
<!-- Copyright 2014-2018, 2020, 2021, 2023 Uwe Trottmann -->
<!-- Copyright 2014-2024 Uwe Trottmann -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand Down Expand Up @@ -57,7 +57,7 @@
<androidx.constraintlayout.helper.widget.Flow
android:layout_width="0dp"
android:layout_height="wrap_content"
app:constraint_referenced_ids="buttonMovieCheckIn,buttonMovieTrailer,buttonMovieCollection,buttonMovieSimilar,buttonMovieShare,buttonMovieCalendar,buttonMovieComments,buttonMovieStreamingSearch,buttonMovieStreamingSearchInfo"
app:constraint_referenced_ids="buttonMovieCheckIn,buttonMovieTrailer,buttonMovieCollection,buttonMovieSimilar,buttonMovieShare,buttonMovieCalendar,buttonMovieReleaseDates,buttonMovieComments,buttonMovieStreamingSearch,buttonMovieStreamingSearchInfo"
app:flow_horizontalBias="0"
app:flow_horizontalGap="4dp"
app:flow_horizontalStyle="packed"
Expand Down Expand Up @@ -121,7 +121,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/addtocalendar"
app:icon="@drawable/ic_event_white_24dp"
app:icon="@drawable/ic_event_control_24dp"
app:iconGravity="start" />

<Button
android:id="@+id/buttonMovieReleaseDates"
style="@style/Widget.SeriesGuide.Button.Outlined.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_release_dates"
app:icon="@drawable/ic_calendar_month_control_24dp"
app:iconGravity="start" />

<Button
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
<string name="action_movies_sort_release">تاريخ الإصدار</string>
<string name="action_movies_filter">تصفية الأفلام</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">خطأ في الإحصائيات.</string>
<string name="shows_finished">%s انتهى مشاهدة</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Дата на издаване</string>
<string name="action_movies_filter">Филтриране</string>
<string name="title_similar_movies">Подобни филми</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Не може да се изчисли статистиката.</string>
<string name="shows_finished">%s изгледани и приключени</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Data de llançament</string>
<string name="action_movies_filter">Filtre de pel·lícules</string>
<string name="title_similar_movies">Pel·lícules similars</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">No s\'han pogut calcular les estadístiques.</string>
<string name="shows_finished">%s acabat de veure</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
<string name="action_movies_sort_release">Datum vysílání</string>
<string name="action_movies_filter">Filtrovat filmy</string>
<string name="title_similar_movies">Podobné filmy</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Nelze přepočítat statistiky.</string>
<string name="shows_finished">%s dokončených zhlédnutí</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-cy/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
<string name="action_movies_sort_release">Dyddiad rhyddhau</string>
<string name="action_movies_filter">hidlo ffilmiau</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Methu cyfrifo ystadegau</string>
<string name="shows_finished">%s gorffen gwylio</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Udgivelsesdato</string>
<string name="action_movies_filter">Filtrer film</string>
<string name="title_similar_movies">Lignende film</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Kunne ikke beregne statistik.</string>
<string name="shows_finished">%s set færdig</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Erscheinungsdatum</string>
<string name="action_movies_filter">Filme filtern</string>
<string name="title_similar_movies">Ähnliche Filme</string>
<string name="title_release_dates">Veröffentlichungen</string>
<!-- Statistics -->
<string name="statistics_failed">Statistik konnte nicht berechnet werden</string>
<string name="shows_finished">%s komplett angesehen</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Ημερομηνία προβολής</string>
<string name="action_movies_filter">Φιλτράρισμα ταινιών</string>
<string name="title_similar_movies">Παρόμοιες ταινίες</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Δε μπορέσαμε να υπολογίσουμε στατιστικά.</string>
<string name="shows_finished">%s τελείωσε την προβολή</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-eo/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Eldondato</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Ne povas kalkuli statistikaĵojn</string>
<string name="shows_finished">%s finis spektadi</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Fecha de estreno</string>
<string name="action_movies_filter">Filtrar películas</string>
<string name="title_similar_movies">Películas similares</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">No se pudieron calcular las estadísticas.</string>
<string name="shows_finished">%s vistos completamente</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">تاریخ انتشار</string>
<string name="action_movies_filter">پالایش فیلم‌ها</string>
<string name="title_similar_movies">فیلم‌های مشابه</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">نمی‌توان آمار را محاسبه کرد.</string>
<string name="shows_finished">%s تماشا پایان یافته</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Julkaisupäivä</string>
<string name="action_movies_filter">Suodata elokuvat</string>
<string name="title_similar_movies">Samankaltaisia elokuvia</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Tilastojen laskeminen ei onnistunut.</string>
<string name="shows_finished">%s katsottu loppuun</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Date de parution</string>
<string name="action_movies_filter">Filtrer les films</string>
<string name="title_similar_movies">Films similaires</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Impossible de calculer les statistiques.</string>
<string name="shows_finished">%s visionnées en entier</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-gl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Data de estrea</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Non se puideron calcular as estatísticas</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@
<string name="action_movies_sort_release">Datum emitiranja</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Nije moguće izračunati statistike.</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Első adás</string>
<string name="action_movies_filter">Filmek szűrése</string>
<string name="title_similar_movies">Hasonló filmek</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Nem sikerült kiszámítani a statisztikát.</string>
<string name="shows_finished">%s teljesen megnézve</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
<string name="action_movies_sort_release">Tanggal rilis</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Tidak dapat menghitung statistik.</string>
<string name="shows_finished">%s selesai ditonton</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Data di uscita</string>
<string name="action_movies_filter">Filtra i film</string>
<string name="title_similar_movies">Film simili</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Impossibile calcolare le statistiche</string>
<string name="shows_finished">%s visti completamente</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
<string name="action_movies_sort_release">תאריך הפצה</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">לא ניתן לחשב את הסטטיסטיקה.</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
<string name="action_movies_sort_release">発売日</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">統計情報を計算できませんでした。</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
<string name="action_movies_sort_release">개봉일</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">통계를 계산할 수 없습니다.</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-mk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Датум на емитување</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Неможе да се пресмета статистика.</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-nb/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Utgivelsesdato</string>
<string name="action_movies_filter">Filter movies</string>
<string name="title_similar_movies">Similar movies</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Kunne ikke beregne statistikk.</string>
<string name="shows_finished">%s finished watching</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
<string name="action_movies_sort_release">Releasedatum</string>
<string name="action_movies_filter">Films filteren</string>
<string name="title_similar_movies">Vergelijkbare films</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Kon statistieken niet berekenen.</string>
<string name="shows_finished">%s klaar met kijken</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
<string name="action_movies_sort_release">Data premiery</string>
<string name="action_movies_filter">Filtruj filmy</string>
<string name="title_similar_movies">Podobne filmy</string>
<string name="title_release_dates">Release dates</string>
<!-- Statistics -->
<string name="statistics_failed">Nie można obliczyć statystyk.</string>
<string name="shows_finished">Zakończono oglądanie %s</string>
Expand Down
Loading

0 comments on commit 27e0c60

Please sign in to comment.