jncep icon indicating copy to clipboard operation
jncep copied to clipboard

Set jncep to track everything

Open K-o-R opened this issue 8 months ago • 5 comments

(Why, yes, I do want a light novel library of Alexandria)

I've not really used the series tracking feature—I used the (now gone :( ) JNC RSS feed to periodically run jncep to grab single parts. With that no longer an option, is there a way to set jncep to track everything (and add all new series automatically)?

K-o-R avatar Apr 19 '25 00:04 K-o-R

It could be added. But you could add it with a script (to run by yourself from time to time). There is an endpoint .../series in the API:

https://labs.j-novel.club/app/v2/series?format=json

So you could process that, by also reading the tracked.json of jncep and add the missing series (or just those after a certain date) either in jncep directly (jncep track ...) or by adding them to the followed series (through the API) on J-Novel Club (that can be picked up later by jncep to setup tracking)

If adding that functionality to jncep, you would have to decide:

  • should the series be added to jncep directly for tracking or added to the followed series on JNC?
  • when does that addition happen? Through a dedicated command (or option) or as part of another one?
  • which series to add? ie keep track of a date and add series started after or specify a date range in the command part that adds the series?

It shouldn't be very hard to add it (but I don't think I will be coding this, at least not in the short term, since I don't follow a lot of series and have limited interest for that feature). But I am open for someone to add that, for example as an option to a command.

gvellut avatar Apr 19 '25 16:04 gvellut

Thank you for the suggestions!

I have figured something out using the program jq: (Windows CMD so escaping quotes etc. may be different for your system)

type nul > series.txt
curl "https://labs.j-novel.club/app/v2/series?format=json&skip=0" | "jq-windows-amd64.exe" -r ".series[] | select(.type==\"NOVEL\") | .slug" >> series.txt

gives the most recent 50 series (that are novels rather than manga) as a .txt file.

Using a loop with step 50, I can get additional pages (currently there are between 450 and 500 series total on JNC)

To add to jncep track: (credentials stored in config, ping to add a wait and avoid hammering the site)

for /f "tokens=*" %%s in (series.txt) do (

[path]\jncep track add https://j-novel.club/series/%%s

ping ::1 -n 2

)

As I understand it, if I run jncep update it will attempt to redownload everything for any series that has updated since the last check? Can I tell it to ignore expired volumes? And is it possible to set the "track point" to zero for every series as a sort of "first time" run option? I notice it seems to start tracking after the point at which the series is added.

Probably should have figured this method out in the first place rather than faffing around with the RSS feed, haha.

K-o-R avatar Apr 21 '25 11:04 K-o-R

jncep update will indeed try to download every update since the last check.

  • By default, when doing track add the pointer of when to start tracking is set to the date of the last released part. So only the parts released after are considered for download. Then the pointer is incremented when new parts are downloaded.
  • You can set the pointer to the beginning by adding the --beginning option to track add so a next update will download all possible parts. This includes Part 1 (always available) from expired volumes.

Currently, there is no possibility to tell the update command to avoid expired volume but I suppose that would be useful for when --beginning is used. Is that the reason you are asking for the feature? But I think that would make sense for thetrack add pointer to be optionally set to the beginning of the current (non-expired) volume (instead of simply --beginning which refers to the start of the series).

Also for https://labs.j-novel.club/app/v2/series it is possible to add the limit argument (I think up with a value up to 500 but maybe it can be more) so you wouldn't have to paginate as much.

gvellut avatar Apr 21 '25 15:04 gvellut

Huh, limit didn't seem to work before but now it does. Must have messed up on the formatting. Or I was only trying stuff like 0, -1. Looks like it's 500 max, any unacceptable number results in 50.

Yes, having it go to the most recent not-expired volume start makes sense. Will a track add --beginning override the series already being tracked (resetting the start pointer), or should I clear my tracked completely first?

(on a related note, thank you for the catchup option!)

(oh, and I just remembered that there is sort of an RSS feed for items "followed" on JNC... so jncep's "follow sync" feature would possibly work with that too)

K-o-R avatar Apr 21 '25 15:04 K-o-R

track add --beginning will not modify an existing tracking configuration if the series is already tracked. So you would have to track rm the series first then add it again if you want to reset the tracking pointer (or, you could delete the full tracked.json file before, if you are going to resubscribe to all the series anyway).

gvellut avatar Apr 22 '25 18:04 gvellut

I have released a new version with option --first-available-volume (on top of --beginning) which sets the tracking pointer to the start of the first complete (available) volume so the expired volumes are ignored and there should not be any Part 1 by itself.

gvellut avatar Jun 10 '25 09:06 gvellut