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

Add option to skip downloading duplicate read chapters #1125

Merged
merged 30 commits into from
Aug 23, 2024

Conversation

shabnix
Copy link
Contributor

@shabnix shabnix commented Aug 14, 2024

Context

Some sources provide multiple scanlations for the same chapter, which can result in certain scanlators being ahead of others, and official releases often lagging behind. The current automatic download system downloads new chapters regardless of whether the same chapter has already been read from a different scanlator. This causes unnecessary downloads of already read content, increasing the load on sources and wasting storage space.

Change Introduced

This pull request introduces an option to prevent the downloading of chapters that have already been read. This functionality is enabled by default when the "download new chapters" setting is enabled, but it can be disabled.

@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch from fc8ef77 to 3a543c1 Compare August 19, 2024 21:47
@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch from 7c5caa1 to ac2a778 Compare August 20, 2024 10:56
@AntsyLich AntsyLich added this to the v0.17.0 milestone Aug 20, 2024
@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch from 96beb0c to 1a2dce7 Compare August 20, 2024 12:39
@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch from c3baa97 to 35bede5 Compare August 20, 2024 21:43
@shabnix
Copy link
Contributor Author

shabnix commented Aug 20, 2024

I am currently unable to test the latest changes, but I will provide an update on it tomorrow.

@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch from 4426eb6 to 839ad09 Compare August 21, 2024 14:12
Copy link
Member

@AntsyLich AntsyLich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally include this addition in the CHANGELOG.md file

@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch from 4076b96 to 81193cf Compare August 22, 2024 09:52
@shabnix shabnix force-pushed the prevent-download-duplicate-chapters branch 2 times, most recently from dcf721e to 5e3b91d Compare August 22, 2024 10:41
@AntsyLich
Copy link
Member

AntsyLich commented Aug 23, 2024

run spotlessApply command

@AntsyLich
Copy link
Member

Great work (tho i had to make you change everything with review 🫠)

@AntsyLich AntsyLich changed the title Add options to disable downloading already read chapters Add option to skip downloading duplicate read chapters Aug 23, 2024
@AntsyLich AntsyLich merged commit ca968f1 into mihonapp:main Aug 23, 2024
1 check passed
@shabnix shabnix deleted the prevent-download-duplicate-chapters branch August 23, 2024 11:55
cuong-tran pushed a commit to komikku-app/komikku that referenced this pull request Aug 24, 2024
…n#1125)

* Add query to get chapter count by manga and chapter number

* Add functions to get chapter count by manga and chapter number

* Only count read chapters

* Add interactor

* Savepoint

* Extract new chapter logic to separate function

* Update javadocs

* Add preference to toggle new functionality

* Add todo

* Add debug logcat

* Use string resource instead of hardcoding title

* Add temporary logcat for debugging

* Fix detekt issues

* Update javadocs

* Update download unread chapters preference

* Remove debug logcat calls

* Update javadocs

* Resolve issue where read chapters were still being downloaded during manual manga fetch

* Apply code review changes

* Apply code review changes

* Revert "Apply code review changes"

This reverts commit 1a2dce78acc66a7c529ce5b572bdaf94804b1a30.

* Revert "Apply code review changes"

This reverts commit ac2a77829313967ad39ce3cb0c0231083b9d640d.

* Group download chapter logic inside the interactor GetChaptersToDownload

* Update javadocs

* Apply code review

* Apply code review

* Apply code review

* Update CHANGELOG.md to include the new feature

* Run spotless

* Update domain/src/main/java/mihon/domain/chapter/interactor/FilterChaptersForDownload.kt

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit ca968f1)
cuong-tran pushed a commit to komikku-app/komikku that referenced this pull request Aug 24, 2024
…n#1125)

* Add query to get chapter count by manga and chapter number

* Add functions to get chapter count by manga and chapter number

* Only count read chapters

* Add interactor

* Savepoint

* Extract new chapter logic to separate function

* Update javadocs

* Add preference to toggle new functionality

* Add todo

* Add debug logcat

* Use string resource instead of hardcoding title

* Add temporary logcat for debugging

* Fix detekt issues

* Update javadocs

* Update download unread chapters preference

* Remove debug logcat calls

* Update javadocs

* Resolve issue where read chapters were still being downloaded during manual manga fetch

* Apply code review changes

* Apply code review changes

* Revert "Apply code review changes"

This reverts commit 1a2dce78acc66a7c529ce5b572bdaf94804b1a30.

* Revert "Apply code review changes"

This reverts commit ac2a77829313967ad39ce3cb0c0231083b9d640d.

* Group download chapter logic inside the interactor GetChaptersToDownload

* Update javadocs

* Apply code review

* Apply code review

* Apply code review

* Update CHANGELOG.md to include the new feature

* Run spotless

* Update domain/src/main/java/mihon/domain/chapter/interactor/FilterChaptersForDownload.kt

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit ca968f1)
cuong-tran pushed a commit to komikku-app/komikku that referenced this pull request Aug 25, 2024
…n#1125)

* Add query to get chapter count by manga and chapter number

* Add functions to get chapter count by manga and chapter number

* Only count read chapters

* Add interactor

* Savepoint

* Extract new chapter logic to separate function

* Update javadocs

* Add preference to toggle new functionality

* Add todo

* Add debug logcat

* Use string resource instead of hardcoding title

* Add temporary logcat for debugging

* Fix detekt issues

* Update javadocs

* Update download unread chapters preference

* Remove debug logcat calls

* Update javadocs

* Resolve issue where read chapters were still being downloaded during manual manga fetch

* Apply code review changes

* Apply code review changes

* Revert "Apply code review changes"

This reverts commit 1a2dce78acc66a7c529ce5b572bdaf94804b1a30.

* Revert "Apply code review changes"

This reverts commit ac2a77829313967ad39ce3cb0c0231083b9d640d.

* Group download chapter logic inside the interactor GetChaptersToDownload

* Update javadocs

* Apply code review

* Apply code review

* Apply code review

* Update CHANGELOG.md to include the new feature

* Run spotless

* Update domain/src/main/java/mihon/domain/chapter/interactor/FilterChaptersForDownload.kt

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit ca968f1)
cuong-tran pushed a commit to komikku-app/komikku that referenced this pull request Aug 25, 2024
…n#1125)

* Add query to get chapter count by manga and chapter number

* Add functions to get chapter count by manga and chapter number

* Only count read chapters

* Add interactor

* Savepoint

* Extract new chapter logic to separate function

* Update javadocs

* Add preference to toggle new functionality

* Add todo

* Add debug logcat

* Use string resource instead of hardcoding title

* Add temporary logcat for debugging

* Fix detekt issues

* Update javadocs

* Update download unread chapters preference

* Remove debug logcat calls

* Update javadocs

* Resolve issue where read chapters were still being downloaded during manual manga fetch

* Apply code review changes

* Apply code review changes

* Revert "Apply code review changes"

This reverts commit 1a2dce78acc66a7c529ce5b572bdaf94804b1a30.

* Revert "Apply code review changes"

This reverts commit ac2a77829313967ad39ce3cb0c0231083b9d640d.

* Group download chapter logic inside the interactor GetChaptersToDownload

* Update javadocs

* Apply code review

* Apply code review

* Apply code review

* Update CHANGELOG.md to include the new feature

* Run spotless

* Update domain/src/main/java/mihon/domain/chapter/interactor/FilterChaptersForDownload.kt

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit ca968f1)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants