ritschwumm / commonist

A file upload tool for mediawiki using its api.php interface
13 stars 4 forks source link

Custom description detection not working #16

Open tbertels opened 6 years ago

tbertels commented 6 years ago

As can be seen in commonist/src/main/resources/image_wikimedia_commons.bpp, the code exists to allow custom description but is commented out.

I suggest enabling it if there's no problem.

ritschwumm commented 6 years ago

not sure what you mean - i don't see anything commented out there except in line 2 and 3?

tbertels commented 6 years ago

Indeed, I confused # with the comments marker.

So then I don't understand why "{{Information" wasn't detected here: https://commons.wikimedia.org/w/index.php?title=File:10_-_Langhemarcq_-_Langemark.jpg&action=edit&oldid=316403155

tbertels commented 6 years ago

It only checks upload.description, so if a custom description is used in common.description, it's not taken into account.

ritschwumm commented 6 years ago

it might not be detected because if (!upload.description.startsWith("{{Information")) { relies on the description to start with the template, whereas on that page there's an == {{int:filedesc}} == before that.

ritschwumm commented 6 years ago

or is the information template in the common.description in your case? btw, you do know you can replace the image_wikimedia_commons.bpp template locally to play with alternative versions, without modifying the packaged application?

tbertels commented 6 years ago

That page was created by Commonist, with == {{int:filedesc}} == being https://github.com/ritschwumm/commonist/blob/master/src/main/resources/image_wikimedia_commons.bpp#L5 Indeed, the custom description was in common.description.

I tried to, but couldn't find the folder on Windows. A drawback of webstart is that the folder isn't in \Program files\.

tbertels commented 6 years ago

But now that I think about it, I wonder if "Custom description" checkboxes shouldn't be added to disable the other fields. Currently, this custom description feature is a hidden feature.

ritschwumm commented 6 years ago

the custom resources directory is in a directory named .commonist inside whatever directory the java system property user.home says. if you start the commonist manually (either from the capsule jar or from the start-script) it will log a line INFO("settings directory", settingsDir) with the full directory name into your console.

tbertels commented 6 years ago

I completely forgot to check on the website. You may want to mention it in the README file and in the repository description by the way.