Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup Manga To Local Source #1297

Open
4 tasks done
Tharow opened this issue Oct 27, 2024 · 0 comments
Open
4 tasks done

Backup Manga To Local Source #1297

Tharow opened this issue Oct 27, 2024 · 0 comments

Comments

@Tharow
Copy link

Tharow commented Oct 27, 2024

Describe your suggested feature

The whole idea behind this prevent the loss of access to manga because it's source/page is now gone.
and While the app does cache lost sources, there can many a case where a source will after a manga has completed pay wall 90% of the chapters, which when the manga gets to that state those downloaded chapters no longer show up even if the ui shows the count for example one of mine says "300|5|EN" but when i open it only 5 chapters show up.

The Following is a poor man's implementation of this by replacing the shareManga method for testing as i could not figure out how to add more items to the menu myself.
It's here simply as a jumping off point, and better explanation of the feature in question.

Other details

@RequiresApi(Build.VERSION_CODES.O)
    private fun shareManga(context: Context, manga: Manga?, source: Source?) {
        if (manga==null) {return}
        val localSourceFileSystem: LocalSourceFileSystem = Injekt.get()
        val downloadManager: DownloadManager = Injekt.get()
        val sourceDir = downloadManager.getMangaFolder(manga)
        val localBaseDir = localSourceFileSystem.getBaseDirectory()
        if (localBaseDir == null) return
        //val comicInfo: ComicInfo =manga.toSManga().getComicInfo()
        //val comicdatafile = XML.encodeToString(ComicInfo.serializer(), comicInfo).byteInputStream()
        try {
            val localMangaDir = localBaseDir.createDirectory(sourceDir.name)!!
            //Files.copy(comicdatafile, Path("${localMangaDir.filePath}/$COMIC_INFO_FILE"), StandardCopyOption.REPLACE_EXISTING)
            Log.i("MangaScreen", "source dir: ${sourceDir.filePath}, output dir: ${localBaseDir.filePath}")
            sourceDir.listFiles()?.forEach {
                Files.copy(Path(it.filePath!!), Path(localBaseDir.filePath!!+"/${sourceDir.name}/${it.name}"), StandardCopyOption.REPLACE_EXISTING)
            }
            context.toast("Copy Complete Check Local Source")
        } catch (e: IOException) {
            Log.e("MangaScreen", "sendToLocal", e)
        }
    }

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • I have written a short but informative title.
  • I have updated the app to version 1.10.5.
  • I will fill out all of the requested information in this form.
jobobby04 pushed a commit that referenced this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant