Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.mattkranzler5:thetvdb-java:-SNAPSHOT'
}
dependencies {
implementation("com.github.mattkranzler5:thetvdb-java:-SNAPSHOT")
}
<dependency>
<groupId>com.github.mattkranzler5</groupId>
<artifactId>thetvdb-java</artifactId>
<version>-SNAPSHOT</version>
</dependency>
libraryDependencies += "com.github.mattkranzler5" % "thetvdb-java" % "-SNAPSHOT"
:dependencies [[com.github.mattkranzler5/thetvdb-java "-SNAPSHOT"]]
Pull requests (for example to support more API endpoints, bug fixes) are welcome!
<a href="https://search.maven.org/#search%7Cga%7C1%7Cthetvdb-java"><img src="https://img.shields.io/maven-central/v/com.uwetrottmann.thetvdb-java/thetvdb-java.svg?style=flat-square"></a>
The TVDB API wrapper in Java written using retrofit.
Currently supported The TVDB API version: 2.1.1
.
Get via Gradle:
compile 'com.uwetrottmann.thetvdb-java:thetvdb-java:1.3.0'
Or Maven:
<dependency>
<groupId>com.uwetrottmann.thetvdb-java</groupId>
<artifactId>thetvdb-java</artifactId>
<version>1.3.0</version>
</dependency>
Use like any other retrofit2 based service. Automatically gets a JSON web token so you only need to supply your API key. For example:
TheTvdb theTvdb = new TheTvdb(API_KEY);
retrofit2.Response<SeriesResponse> response = getTheTvdb().series()
.series(83462, "en")
.execute();
if (response.isSuccessful()) {
Series series = response.body().data;
System.out.println(series.seriesName + " is awesome!");
}
You likely will not use every method in this library, so it is probably useful to strip unused ones with Proguard. Just apply the [Proguard rules for retrofit][4].
Created by Uwe Trottmann. Except where noted otherwise, released into the public domain. Do not just copy, make it better.