mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-25 18:38:23 +01:00
parent
2769525b2c
commit
f3ca4e76a8
@ -545,14 +545,12 @@ class Downloader(
|
|||||||
}
|
}
|
||||||
|
|
||||||
download.status = if (downloadedImagesCount == downloadPageCount) {
|
download.status = if (downloadedImagesCount == downloadPageCount) {
|
||||||
// TODO: Uncomment when #8537 is resolved
|
createComicInfoFile(
|
||||||
// val chapterUrl = download.source.getChapterUrl(download.chapter)
|
tmpDir,
|
||||||
// createComicInfoFile(
|
download.manga,
|
||||||
// tmpDir,
|
download.chapter,
|
||||||
// download.manga,
|
download.source,
|
||||||
// download.chapter.toDomainChapter()!!,
|
)
|
||||||
// chapterUrl,
|
|
||||||
// )
|
|
||||||
|
|
||||||
// Only rename the directory if it's downloaded
|
// Only rename the directory if it's downloaded
|
||||||
if (downloadPreferences.saveChaptersAsCBZ().get()) {
|
if (downloadPreferences.saveChaptersAsCBZ().get()) {
|
||||||
@ -606,23 +604,19 @@ class Downloader(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a ComicInfo.xml file inside the given directory.
|
* Creates a ComicInfo.xml file inside the given directory.
|
||||||
*
|
|
||||||
* @param dir the directory in which the ComicInfo file will be generated.
|
|
||||||
* @param manga the manga.
|
|
||||||
* @param chapter the chapter.
|
|
||||||
* @param chapterUrl the resolved URL for the chapter.
|
|
||||||
*/
|
*/
|
||||||
private fun createComicInfoFile(
|
private fun createComicInfoFile(
|
||||||
dir: UniFile,
|
dir: UniFile,
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
chapterUrl: String,
|
source: HttpSource,
|
||||||
) {
|
) {
|
||||||
|
val chapterUrl = source.getChapterUrl(chapter.toSChapter())
|
||||||
val comicInfo = getComicInfo(manga, chapter, chapterUrl)
|
val comicInfo = getComicInfo(manga, chapter, chapterUrl)
|
||||||
val comicInfoString = xml.encodeToString(ComicInfo.serializer(), comicInfo)
|
|
||||||
// Remove the old file
|
// Remove the old file
|
||||||
dir.findFile(COMIC_INFO_FILE)?.delete()
|
dir.findFile(COMIC_INFO_FILE)?.delete()
|
||||||
dir.createFile(COMIC_INFO_FILE).openOutputStream().use {
|
dir.createFile(COMIC_INFO_FILE).openOutputStream().use {
|
||||||
|
val comicInfoString = xml.encodeToString(ComicInfo.serializer(), comicInfo)
|
||||||
it.write(comicInfoString.toByteArray())
|
it.write(comicInfoString.toByteArray())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user