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

Feature/mark-chapters-as-read-based-on-tracker-history #708

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

taos15
Copy link
Contributor

@taos15 taos15 commented Apr 5, 2024

This pull request includes the following changes:

  • Refactor: creates utility functions to work with lists

  • Refactor(chapters): removes commented out code and implements utility function to clean up the file

  • Refactor TrackMangaButton to update local source if the tracker last read is higher than local

  • Merge branch 'master' of github.com:Suwayomi/Suwayomi-WebUI into feature/mark-chapters-as-read-based-on-tracker-history

  • Refactor(packe.json): adds --host flag to the vite command to be able to run the dev server remotely

@taos15
Copy link
Contributor Author

taos15 commented Apr 5, 2024

This PR implement feature request 699

Copy link
Contributor Author

@taos15 taos15 left a comment

Choose a reason for hiding this comment

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

I need to add logic to support partial chapters. like 56.1

Copy link
Collaborator

@schroda schroda left a comment

Choose a reason for hiding this comment

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

this should be an action in the options menu of an active track binding (TrackerActiveCard)
it also should not fetch the chapter list and only sync the known chapters

}

return allChapters.slice(index + 1);
return getPreviousChapters(chapter.id, allChapters);
Copy link
Collaborator

Choose a reason for hiding this comment

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

use the Chapters class - same for all the added util functions

@taos15
Copy link
Contributor Author

taos15 commented Apr 14, 2024

Since it check which tracker has the more chapter read, should the action be in the modal instead of the trackerCard? Like a button somewhere in the model (sync read)?

For the chapters, you mean work with the current chapter that the manga has and not try to pull the latest? I might have done without knowing, but I did not know I was fetching the chapters. My intent was to only fetch the trackers history (trackerBind), and use the current chapters list to comprare (I use the requestManager because I though it return it from cache, kid of a cache store).

@@ -28,8 +29,67 @@ export const TrackMangaButton = ({ manga }: { manga: TManga }) => {

const loggedInTrackers = Trackers.getLoggedIn(trackerList.data?.trackers.nodes ?? []);
const trackersInUse = Trackers.getLoggedIn(Trackers.getTrackers(mangaTrackers));
const mangaChaptersQuery = requestManager.useGetMangaChapters(manga.id, {});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I this the line you are talking about that is fetching the chapters? @schroda

Copy link
Collaborator

Choose a reason for hiding this comment

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

no, it's this

        // Fetch new chapters if behind tracker
        if (localBehindTracker) {
            await requestManager.getMangaChaptersFetch(manga.id, { awaitRefetchQueries: true }).response;
        }

Copy link
Contributor Author

@taos15 taos15 Apr 14, 2024

Choose a reason for hiding this comment

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

Ok. If the local manga is behind (last chapter is 100 but last read in tracker is 103) there wont be a way to find the last chapter that match the tracker. In that case, do you propose to not get the last chapter and instead mark every chapter as read?. In the example, the last local chapter is 100 and the last read in tracker is 103, every chapter before 103 should be read; in this case all the local chapters should be marked as read?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, I am

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I can do that.

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