Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Add official variable to chapters and check for changes to official status#557

Open
TheyCallMeTravis wants to merge 13 commits intoC9Glax:cuttingedgefrom
TheyCallMeTravis:add-official-variable-and-check
Open

Add official variable to chapters and check for changes to official status#557
TheyCallMeTravis wants to merge 13 commits intoC9Glax:cuttingedgefrom
TheyCallMeTravis:add-official-variable-and-check

Conversation

@TheyCallMeTravis
Copy link
Contributor

Fixes #333.

  • Added isOfficial to chapter; null by default.
  • Added migrations.
  • Added isOfficial check to WeebCentral connector.
  • Added logic to RetrieveMangaChaptersFromMangaconnectorWorker to check if existing unofficial chapter is now official. If so, mark as not downloaded to queue to be downloaded.

NOTE: Everything works for isOfficial, but I have not tested the checking of existing chapters part; of the manga I have in my queue, the closest new official volume release is April :( If you have a better way to test this, please let me know!


Potential future enhancements:

  • Add variable in global settings for "Redownload official chapters"; if variable is FALSE, do not run the check on any chapters.
  • Add variable in connector for "has official status"; if variable NOT TRUE, do not run official check on that connector.
  • Add icon to website chapters page to indicate "official/unofficial" per chapter.
  • Add degub log to StartNewChapterDownloadsWorker for "Found # chapters available for upgrade to official."

@TheyCallMeTravis
Copy link
Contributor Author

Actually in hindsight to test this, I could add a PATCH endpoint to ChaptersController for "Toggle isOfficial by ChapterID", then use that to toggle an official chapter to unofficial and confirm that it gets updated/redownloaded automatically 🤔

I'm going afk for a bit, but I might write that up and test it when I return.

@TheyCallMeTravis
Copy link
Contributor Author

It works! I think this one is g2g!

@TheyCallMeTravis
Copy link
Contributor Author

The only thing I think that could be left to test is pushing this to a live database with existing data. It should update existing chapters with their current official status from WeebCentral, but not redownload anything since it is going from NULL to TRUE/FALSE.

Note: If a chapter was previously downloaded as unofficial but has since been replaced on WeebCentral with an official version, its IsOfficial flag will be set to TRUE; even though the local copy remains unofficial. To trigger a re-download on the next check, one would need to manually set IsOfficial back to FALSE.

@C9Glax
Copy link
Owner

C9Glax commented Feb 2, 2026

Hi I have been and am quiet occupied until Wednesday at least, so give me a bit longer to look at all of this!

@TheyCallMeTravis
Copy link
Contributor Author

No worries, brother. Whenever you get time, no rush 😁

Added logic for cases where `IsOfficial` is NULL and `incomingChapter` is TRUE/FALSE.

NULL to TRUE/FALSE do not re-download since there is no way to know whether existing chapter is official or not.
@TheyCallMeTravis
Copy link
Contributor Author

I got around to testing this with a copy of my existing database. I added logic for cases where IsOfficial is NULL and incomingChapter is TRUE/FALSE. Worked like a charm! All the existing WeebCentral chapters are flagged with IsOfficial now.

Logic is to only update the isOfficial flag when going from NULL to TRUE/FALSE, not to redownload anything; only redownload if going from FALSE to TRUE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants