Get manga info from tracker (#1271)
* Barebones setup (only AniList works) * Show tracker selection dialog when entry has more than one tracker * MangaUpdates implementation * Add logging and toast on error. * MyAnimeList implementation * Kitsu implementation * Fix MAL authors and artists * Decode AL description * Throw NotImplementedError instead of returning null * Use logcat from LogcatExtensions * Replace strings with MR strings * Missed a string * Delete unused Author class. * Add Bangumi & Shikimori support for info edit (#2) This adds the necessary API calls and DTOs to allow for editing an entry's data to the data from a tracker, specifically adding support for Bangumi and Shikimori. * Exclude enhanced trackers from tracker select dialog * MdList implementation * Remember getTracks and trackerManager Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com> --------- Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com> Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
This commit is contained in:
@@ -128,6 +128,36 @@ class MangaHandler(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getMangaMetadata(
|
||||
track: Track,
|
||||
sourceId: Long,
|
||||
coverQuality: String,
|
||||
tryUsingFirstVolumeCover: Boolean,
|
||||
altTitlesInDesc: Boolean,
|
||||
): SManga? {
|
||||
return withIOContext {
|
||||
val mangaId = MdUtil.getMangaId(track.tracking_url)
|
||||
val response = service.viewManga(mangaId)
|
||||
val coverFileName = if (tryUsingFirstVolumeCover) {
|
||||
service.fetchFirstVolumeCover(response)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
apiMangaParser.parseToManga(
|
||||
SManga.create().apply {
|
||||
url = track.tracking_url
|
||||
},
|
||||
sourceId,
|
||||
response,
|
||||
emptyList(),
|
||||
null,
|
||||
coverFileName,
|
||||
coverQuality,
|
||||
altTitlesInDesc,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getSimpleChapters(manga: SManga): List<String> {
|
||||
return runCatching { service.aggregateChapters(MdUtil.getMangaId(manga.url), lang) }
|
||||
.onFailure {
|
||||
|
||||
Reference in New Issue
Block a user