gvellut / jncep

Command-line tool to generate EPUB files for J-Novel Club pre-pub novels
GNU General Public License v3.0
43 stars 11 forks source link

[Feature Request] track sync --beginning #33

Closed pajoh closed 1 year ago

pajoh commented 1 year ago

Add --beginning flag to add newly followed tracks from the first part. As it is now I do 3 commands each update update --sync update track sync --delete update

with this change I would only need to do update track sync --delete --beginning update

Got a PR if it's ok. Very simple, only add flag and hook into the current check if no parts available yet.

gvellut commented 1 year ago

Thank you for your feedback and your PR.

Wouldn't it be better to add an option to the update command to perform the 3 commands?

update --sync
track sync --delete
update

Is the goal being able to use the "Follow" button on the JNC to manage tracked series? (instead of doing track <URL>). I am asking because, at some point, I wanted to make a simple GUI that would have had a single button "Update" and leave the management of followed series to the JNC website (using the "Follow" button). And the 3 commands above were those that would have been launched when clicking on that button. I didn't follow through with that GUI nor implemented the functionality in the end but I had named it "sync-plus" ie adding a "--sync-plus" parameter to update.

But the PR is simple enough so I am fine with adding it as is. Let me know.

pajoh commented 1 year ago

You're right. It would be better to do it that way. I was looking through the code a bit, and saw that it would be very easy to do it this way.

The way I'm using this is that I've got a schedule task running every night where I sync all the new follows, remove any that has been unfollowed, and download all the new parts. This way I'm pretty much using JNC's website as the GUI for this program.

Still think this change kinda make sense for the track command? And then change the update command to be able to do sync and delete as part of the update?

pajoh commented 1 year ago

I made a quick PR that make it possible to add --delete and --beginning with the update command also. --beginning is meaningless though since other code force start from beginning, so might want to remove it, or change the code. changing the code whould be changing functionality though, which might not be good.

could also change it back so --beginning is removed, and update --sync is the way to add tracked from the start.

gvellut commented 1 year ago

Still think this change kinda make sense for the track command? And then change the update command to be able to do sync and delete as part of the update?

Yes. I think that would be the way to go. I prefer leaving the other options as is and add a single option to the update command that would do the 3 commands you propose. I don't know if I will use your PR but I will make the change in the next few days.

pajoh commented 1 year ago

Sounds good with me. I don't feel strongly about keeping it the way I did it. If there's something I can do let me know, otherwise I'll just wait paitently for your update.

Thanks for all your time.

gvellut commented 1 year ago

I have made a new release with the features you added (--whole-final and --beginning). Thank you for your contribution.