-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: more thumbnails, descriptions (thanks to @yupcm)
- Loading branch information
1 parent
11655bd
commit 8822ef6
Showing
25 changed files
with
279 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package ani.dantotsu.others | ||
|
||
import ani.dantotsu.FileUrl | ||
import ani.dantotsu.Mapper | ||
import ani.dantotsu.client | ||
import ani.dantotsu.media.anime.Episode | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.json.JsonArray | ||
import kotlinx.serialization.json.decodeFromJsonElement | ||
|
||
object Anify { | ||
suspend fun fetchAndParseMetadata(id :Int): Map<String, Episode>? { | ||
val response = client.get("https://api.anify.tv/content-metadata/$id") | ||
.parsed<JsonArray>().map { | ||
Mapper.json.decodeFromJsonElement<ContentMetadata>(it) | ||
} | ||
return response.first().data.associate { | ||
it.number.toString() to Episode( | ||
number = it.number.toString(), | ||
title = it.title, | ||
desc = it.description, | ||
thumb = FileUrl[it.img], | ||
filler = it.isFiller, | ||
) | ||
} | ||
} | ||
@Serializable | ||
data class ContentMetadata( | ||
@SerialName("providerId") val providerId: String, | ||
@SerialName("data") val data: List<ProviderData> | ||
) | ||
|
||
@Serializable | ||
data class ProviderData( | ||
@SerialName("id") val id: String, | ||
@SerialName("description") val description: String, | ||
@SerialName("hasDub") val hasDub: Boolean, | ||
@SerialName("img") val img: String, | ||
@SerialName("isFiller") val isFiller: Boolean, | ||
@SerialName("number") val number: Int, | ||
@SerialName("title") val title: String, | ||
@SerialName("updatedAt") val updatedAt: Long, | ||
@SerialName("rating") val rating: Double? = null | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.