diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 6c8f6aea26..ac0eb94e3c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -52,6 +52,21 @@
android:scheme="tachiyomi" />
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt
index 73fa15c550..14558d1f1b 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt
@@ -4,6 +4,7 @@ import android.content.Context
import eu.kanade.tachiyomi.data.track.anilist.Anilist
import eu.kanade.tachiyomi.data.track.kitsu.Kitsu
import eu.kanade.tachiyomi.data.track.myanimelist.Myanimelist
+import eu.kanade.tachiyomi.data.track.shikomori.Shikomori
class TrackManager(private val context: Context) {
@@ -11,6 +12,7 @@ class TrackManager(private val context: Context) {
const val MYANIMELIST = 1
const val ANILIST = 2
const val KITSU = 3
+ const val SHIKOMORI = 4
}
val myAnimeList = Myanimelist(context, MYANIMELIST)
@@ -19,7 +21,9 @@ class TrackManager(private val context: Context) {
val kitsu = Kitsu(context, KITSU)
- val services = listOf(myAnimeList, aniList, kitsu)
+ val shikomori = Shikomori(context, SHIKOMORI)
+
+ val services = listOf(myAnimeList, aniList, kitsu, shikomori)
fun getService(id: Int) = services.find { it.id == id }
diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikomori/OAuth.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikomori/OAuth.kt
new file mode 100644
index 0000000000..ad6adc18a4
--- /dev/null
+++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikomori/OAuth.kt
@@ -0,0 +1,13 @@
+package eu.kanade.tachiyomi.data.track.shikomori
+
+data class OAuth(
+ val access_token: String,
+ val token_type: String,
+ val created_at: Long,
+ val expires_in: Long,
+ val refresh_token: String?) {
+
+ // Access token lives 1 day
+ fun isExpired() = (System.currentTimeMillis() / 1000) > (created_at + expires_in - 3600)
+}
+
diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikomori/Shikomori.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikomori/Shikomori.kt
new file mode 100644
index 0000000000..83fee74cf4
--- /dev/null
+++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikomori/Shikomori.kt
@@ -0,0 +1,138 @@
+package eu.kanade.tachiyomi.data.track.shikomori
+
+import android.content.Context
+import android.graphics.Color
+import com.google.gson.Gson
+import eu.kanade.tachiyomi.R
+import eu.kanade.tachiyomi.data.database.models.Track
+import eu.kanade.tachiyomi.data.track.TrackService
+import eu.kanade.tachiyomi.data.track.model.TrackSearch
+import rx.Completable
+import rx.Observable
+import uy.kohesive.injekt.injectLazy
+
+class Shikomori(private val context: Context, id: Int) : TrackService(id) {
+
+ override fun getScoreList(): List {
+ return IntRange(0, 10).map(Int::toString)
+ }
+
+ override fun displayScore(track: Track): String {
+ return track.score.toInt().toString()
+ }
+
+ override fun add(track: Track): Observable