Currently, the format for these package names is "4chan.org - [board name] - [date]". The date isn't particularly useful beyond ensuring JD puts each thread in a separate folder. To me, it would seem more useful to put the thread number in there. On the slower boards, this would mean you could re-add a thread at a later date and only get the newer images, rather than re-downloading them all. Benefits are a saving in bandwidth and a saving in time. Where any threads in the queue are likely to expire, the time saved may mean the difference between getting all the images and the thread and images 404ing before you get to them.
I couldn't find an option to change this in the options, so I took to the source. It looks like it comes from this bit of code in Brds4Chnrg.java:
Code:
String domain = "4chan.org";
String cat = br.getRegex("<div class=\"boardTitle\">/.{1,3}/ - (
.*?)</div>").getMatch(0);
if (cat == null) cat = br.getRegex("<title>/b/ - (.*?)</title>")
.getMatch(0);
if (cat != null) {
cat = cat.replace("&", "&");
} else {
cat = "Unknown Cat";
}
String date = new Date().toString();
fp.setName(domain + " - " + cat + " - " + date);
The thread number for the image boards is after /res/ in the URL, and appears in the HTML like this:
Code:
<div class="thread" id="t12345678">
It also appears in the post form at the top, though this isn't shown if the thread is locked, so I wouldn't rely on it being there.
I'm happy to whip up a patch, though the prospect of making the change locally and getting it wiped out at each update is worrying. I suspect it's as simple as changing the last two lines above to:
Code:
String threadno = br.getRegex("<div class=\"thread\" id=\"t([0-9]+)\">").getMatch(0);
fp.setName(domain + " - " + cat + " - " + threadno);
What do you guys think?